From 21cd8589291a1b415106740acd56509e0143356d Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Tue, 3 Dec 2019 19:24:00 +0100 Subject: [PATCH] Clear calls_comdat_local when comdat group is dissolved while looking into Firefox inlining dumps I noticed that we often do not inline because we think function calls comdat local while the comdat group itself has been dissolved. * cgraph.c (cgraph_node::verify_node): Check that calls_comdat_local is set only for symbol in comdat group. * symtab.c (symtab_node::dissolve_same_comdat_group_1): Clear it. From-SVN: r278944 --- gcc/ChangeLog | 6 ++++++ gcc/cgraph.c | 5 +++++ gcc/symtab.c | 2 ++ 3 files changed, 13 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 58696cefaac..89bdf3b43e1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-12-03 Jan Hubicka + + * cgraph.c (cgraph_node::verify_node): Check that calls_comdat_local + is set only for symbol in comdat group. + * symtab.c (symtab_node::dissolve_same_comdat_group_1): Clear it. + 2019-12-03 Jan Hubicka * cgraph.c: Include tree-into-ssa.h diff --git a/gcc/cgraph.c b/gcc/cgraph.c index ae61de4849e..7288440708e 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -3094,6 +3094,11 @@ cgraph_node::verify_node (void) error ("inline clone is forced to output"); error_found = true; } + if (calls_comdat_local && !same_comdat_group) + { + error ("calls_comdat_local is set outside of a comdat group"); + error_found = true; + } for (e = indirect_calls; e; e = e->next_callee) { if (e->aux) diff --git a/gcc/symtab.c b/gcc/symtab.c index f4317d02b71..a88f45c4341 100644 --- a/gcc/symtab.c +++ b/gcc/symtab.c @@ -489,6 +489,8 @@ symtab_node::dissolve_same_comdat_group_list (void) { next = n->same_comdat_group; n->same_comdat_group = NULL; + if (dyn_cast (n)) + dyn_cast (n)->calls_comdat_local = false; /* Clear comdat_group for comdat locals, since make_decl_local doesn't. */ if (!TREE_PUBLIC (n->decl)) -- 2.30.2