]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: pragma target and static init [PR109753]
authorJason Merrill <jason@redhat.com>
Wed, 14 Feb 2024 22:18:17 +0000 (17:18 -0500)
committerJason Merrill <jason@redhat.com>
Wed, 29 May 2024 13:51:40 +0000 (09:51 -0400)
commiteff00046409a7289bfdc1861e68b532895f91c0e
tree9d5484d42bfc3c309f7f0ff94c33dc8abcbd1c7c
parent3ae02dcb108df426838bbbcc73d7d01855bc1196
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.
gcc/c-family/c-attribs.cc
gcc/cp/decl.cc
gcc/testsuite/g++.dg/opt/always_inline1.C [new file with mode: 0644]