@@ -5971,6 +5971,10 @@ handle_optimize_attribute (tree *node, tree name, tree args,
if (prev_target_node != target_node)
DECL_FUNCTION_SPECIFIC_TARGET (*node) = target_node;
+ /* Also update the cgraph_node, if it's already built. */
+ if (cgraph_node *cn = cgraph_node::get (*node))
+ cn->semantic_interposition = flag_semantic_interposition;
+
/* Restore current options. */
cl_optimization_restore (&global_options, &global_options_set,
&cur_opts);
@@ -17832,6 +17832,9 @@ start_preparsed_function (tree decl1, tree attrs, int flags)
doing_friend = true;
}
+ /* Adjust for #pragma target/optimize. */
+ decl_attributes (&decl1, NULL_TREE, 0);
+
if (DECL_DECLARED_INLINE_P (decl1)
&& lookup_attribute ("noinline", attrs))
warning_at (DECL_SOURCE_LOCATION (decl1), 0,
new file mode 100644
@@ -0,0 +1,8 @@
+// PR c++/109753
+// { dg-do compile { target x86_64-*-* } }
+
+#pragma GCC target("avx2")
+struct aa {
+ __attribute__((__always_inline__)) aa() {}
+};
+aa _M_impl;