From f22712bd8a2ed57d3cc7e6fa92730bd5852e27b3 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Thu, 19 Mar 2020 17:12:56 +0100 Subject: Fix inliner ICE on alias with flatten attribute [PR92372] gcc/ChangeLog: 2020-03-19 Jan Hubicka 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 PR ipa/92372 * gcc.c-torture/pr92372.c: New test. * gcc.dg/attr-flatten-1.c: New test. --- gcc/cgraphunit.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'gcc/cgraphunit.c') 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, + "%" + " attribute attribute is ignored on aliases"); + } if (DECL_PRESERVE_P (decl)) node->mark_force_output (); else if (lookup_attribute ("externally_visible", DECL_ATTRIBUTES (decl))) -- cgit v1.1