public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Do not dissolve comdat groups in inliner
@ 2015-03-02 20:12 Jan Hubicka
  0 siblings, 0 replies; only message in thread
From: Jan Hubicka @ 2015-03-02 20:12 UTC (permalink / raw)
  To: gcc-patches

Hi,
in the testcase bellow the comdat local function is inlined and inliner mistakely
dissolve the whole comdat group.  This is wrong and leads to ICE here, but it also
may lead to undefined symbols due to groups being wrong.

Bootstrapped/regtested x86_64-linux, comitted.

	PR ipa/64988
	* ipa-inline-transform.c (clone_inlined_nodes): Do not dissolve
	comdat groups.
	* g++.dg/torture/pr64988.C: New testcase.
Index: ipa-inline-transform.c
===================================================================
--- ipa-inline-transform.c	(revision 221122)
+++ ipa-inline-transform.c	(working copy)
@@ -213,7 +213,7 @@ clone_inlined_nodes (struct cgraph_edge
 	     For now we keep the ohter functions in the group in program until
 	     cgraph_remove_unreachable_functions gets rid of them.  */
 	  gcc_assert (!e->callee->global.inlined_to);
-	  e->callee->dissolve_same_comdat_group_list ();
+	  e->callee->remove_from_same_comdat_group ();
 	  if (e->callee->definition
 	      && inline_account_function_p (e->callee))
 	    {
@@ -243,7 +243,7 @@ clone_inlined_nodes (struct cgraph_edge
 	}
     }
   else
-    e->callee->dissolve_same_comdat_group_list ();
+    e->callee->remove_from_same_comdat_group ();
 
   e->callee->global.inlined_to = inlining_into;
 
Index: testsuite/g++.dg/torture/pr64988.C
===================================================================
--- testsuite/g++.dg/torture/pr64988.C	(revision 0)
+++ testsuite/g++.dg/torture/pr64988.C	(revision 0)
@@ -0,0 +1,12 @@
+// { dg-do compile }
+// { dg-options "-O -fdeclone-ctor-dtor" }
+struct A {
+  virtual ~ A ();
+};
+
+struct B : virtual A {};
+struct C : virtual A {};
+
+struct D : B, C {};
+
+D d;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-03-02 20:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-02 20:12 Do not dissolve comdat groups in inliner Jan Hubicka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).