https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109753
--- Comment #18 from GCC Commits ---
The trunk branch has been updated by Jason Merrill :
https://gcc.gnu.org/g:eff00046409a7289bfdc1861e68b532895f91c0e
commit r15-902-geff00046409a7289bfdc1861e68b532895f91c0e
Author: Jason Merrill
Date: Wed Feb 14 17:18:17 2024 -0500
c++: pragma target and static init [PR109753]
#pragma target and optimize should also apply to implicitly-generated
functions like static initialization functions and defaulted special
member
functions.
The handle_optimize_attribute change is necessary to avoid regressing
g++.dg/opt/pr105306.C; maybe_clone_body creates a cgraph_node for the ~B
alias before handle_optimize_attribute, and the alias never goes through
finalize_function, so we need to adjust semantic_interposition somewhere
else.
PR c++/109753
gcc/c-family/ChangeLog:
* c-attribs.cc (handle_optimize_attribute): Set
cgraph_node::semantic_interposition.
gcc/cp/ChangeLog:
* decl.cc (start_preparsed_function): Call decl_attributes.
gcc/testsuite/ChangeLog:
* g++.dg/opt/always_inline1.C: New test.