diff options
author | Jan Hubicka <jh@suse.cz> | 2020-03-19 17:12:56 +0100 |
---|---|---|
committer | Jan Hubicka <jh@suse.cz> | 2020-03-19 17:12:56 +0100 |
commit | f22712bd8a2ed57d3cc7e6fa92730bd5852e27b3 (patch) | |
tree | b1cc53660ac9b44ff141b8908117343bba6e1b3f /gcc/cgraphunit.c | |
parent | c8429c2aba80f845939ffa6b2cfe8a0be1b50078 (diff) | |
download | gcc-f22712bd8a2ed57d3cc7e6fa92730bd5852e27b3.zip gcc-f22712bd8a2ed57d3cc7e6fa92730bd5852e27b3.tar.gz gcc-f22712bd8a2ed57d3cc7e6fa92730bd5852e27b3.tar.bz2 |
Fix inliner ICE on alias with flatten attribute [PR92372]
gcc/ChangeLog:
2020-03-19 Jan Hubicka <hubicka@ucw.cz>
PR ipa/92372
* cgraphunit.c (process_function_and_variable_attributes): warn
for flatten attribute on alias.
* ipa-inline.c (ipa_inline): Do not ICE on flatten attribute on alias.
gcc/testsuite/ChangeLog:
2020-03-19 Jan Hubicka <hubicka@ucw.cz>
PR ipa/92372
* gcc.c-torture/pr92372.c: New test.
* gcc.dg/attr-flatten-1.c: New test.
Diffstat (limited to 'gcc/cgraphunit.c')
-rw-r--r-- | gcc/cgraphunit.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index fd58636..d7ed405 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -851,6 +851,14 @@ process_function_and_variable_attributes (cgraph_node *first, node = symtab->next_function (node)) { tree decl = node->decl; + + if (node->alias + && lookup_attribute ("flatten", DECL_ATTRIBUTES (decl))) + { + warning_at (DECL_SOURCE_LOCATION (node->decl), OPT_Wattributes, + "%<flatten%>" + " attribute attribute is ignored on aliases"); + } if (DECL_PRESERVE_P (decl)) node->mark_force_output (); else if (lookup_attribute ("externally_visible", DECL_ATTRIBUTES (decl))) |