https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64835
Bug ID: 64835
Summary: -fno-ipa-cp is inconsitently supported when attributes
optimize or target are used
Product: gcc
Version: 5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: chrbr at gcc dot gnu.org
Created attachment 34606
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34606&action=edit
testcase
When using the target attributes on ARM, all ipa/inline tests that use
-fno-ipa-cp fails. Althought the target attribute should have no impact on
-fno-ipa-cp.
This is a more general issue with the DECL_FUNCTION_SPECIFIC_OPTIMIZATION macro
test which is used both for the target attributes and the optimize attributes.
This can be observed with the attached test on i386. Compiled with "-O3
-fno-early-inlining -fno-ipa-cp"
indeed
ipa_proc.c::ipa_func_spec_opts_forbid_analysis_p as a explicit test for
-fno-ipa-pc, and none is checked for the global optimisation level.
---------
tree fs_opts = DECL_FUNCTION_SPECIFIC_OPTIMIZATION (node->decl);
if (!fs_opts)
return false;
return !opt_for_fn (node->decl, optimize) || !opt_for_fn (node->decl,
flag_ipa_cp);
---------
it seems that to be consistent, we shoud apply the same test if no
specific_optimiaation. something linke:
if (!fs_opts)
- return false;
+ return !optimize || !flag_ipa_cp;
however then a few tests are failing . e.g iinline-1.c. because they force
-fno-ipa-cp. Strangly those tests test that inlining is performed so the
-fno-ipa-cp is weird as the logic seems to be inversed.