diff options
author | Jakub Jelinek <jakub@redhat.com> | 2022-04-13 10:12:56 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2022-04-13 10:12:56 +0200 |
commit | 41f8f8b8a4ffcf28961cdc077fd7f0770f4bb7cc (patch) | |
tree | aae38443a5b8ba3deb3bcbd98d2fe087d3e5abe0 /gcc/d/expr.cc | |
parent | 4e892de6774f86540d36385701aa7b0a2bba5155 (diff) | |
download | gcc-41f8f8b8a4ffcf28961cdc077fd7f0770f4bb7cc.zip gcc-41f8f8b8a4ffcf28961cdc077fd7f0770f4bb7cc.tar.gz gcc-41f8f8b8a4ffcf28961cdc077fd7f0770f4bb7cc.tar.bz2 |
attribs: Restrict decl_attributes DECL_FUNCTION_SPECIFIC_TARGET changes to targets that care about target attributes/pragmas [PR105234]
The following code is rejected e.g. on mips64el-linux (but I think many
other targets which don't support target attribute or pragma).
The problem is that the change to decl_attributes below is done
unconditionally and with just #pragma GCC push_options/pop_options pair
we have target_option_default_node NULL, but after popping options
target_option_current_node becomes non-NULL and this decl_attribute
spot fills in DECL_FUNCTION_SPECIFIC_TARGET of a subset of a functions.
Those appearing before push_options/pop_options will have it NULL and
as target_option_default_node is also NULL on those targets, the default
can_inline_p will refuse to inline any functions defined with NULL
DECL_FUNCTION_SPECIFIC_TARGET into any function with non-NULL
DECL_FUNCTION_SPECIFIC_TARGET (even when nothing in the options really
changed).
The following patch restricts that snippet to targets that care (initialize
target_option_default_node to non-NULL to the command line options early)
which include all targets that actually implement target attribute and/or
pragma.
2022-04-13 Jakub Jelinek <jakub@redhat.com>
PR target/105234
* attribs.cc (decl_attributes): Don't set
DECL_FUNCTION_SPECIFIC_TARGET if target_option_default_node is
NULL.
* gcc.c-torture/compile/pr105234.c: New test.
Diffstat (limited to 'gcc/d/expr.cc')
0 files changed, 0 insertions, 0 deletions