diff mbox

Don't ICE in function_and_variable_visibility on Tru64 UNIX (PR middle-end/49062)

Message ID yddd3j7f57i.fsf@manam.CeBiTec.Uni-Bielefeld.DE
State New
Headers show

Commit Message

Rainer Orth May 25, 2011, 10:24 a.m. UTC
Almost 400 c++ and libstdc++ testcases ICE on Tru64 UNIX since Jan's
patch

2011-05-06  Jan Hubicka  <jh@suse.cz>

    * cgraph.c (cgraph_add_thunk): Create real function node instead
    of alias node; finalize it and mark needed/reachale; arrange visibility
    to be right and add it into the corresponding same comdat group list.
    (dump_cgraph_node): Dump thunks.

as described in the PR.

He provided the following patch in private mail.  I tested it on
alpha-dec-osf5.1b by rebuilding cc1plus and rerunning the g++ and
libstdc++-v3 testsuites: all failures were gone.

Approved in private mail, committed to mainline.

	Rainer


2011-05-25  Jan Hubicka  <jh@suse.cz>

	PR middle-end/49062
	* ipa.c (function_and_variable_visibility): Only add to same
	comdat group list if DECL_ONE_ONLY.
diff mbox

Patch

diff --git a/gcc/ipa.c b/gcc/ipa.c
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -897,7 +897,7 @@  function_and_variable_visibility (bool w
 	    {
 	      DECL_COMDAT (node->decl) = 1;
 	      DECL_COMDAT_GROUP (node->decl) = DECL_COMDAT_GROUP (decl_node->decl);
-	      if (!node->same_comdat_group)
+	      if (DECL_ONE_ONLY (decl_node->decl) && !node->same_comdat_group)
 		{
 		  node->same_comdat_group = decl_node;
 		  if (!decl_node->same_comdat_group)