public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jan Hubicka <hubicka@ucw.cz>
To: gcc-patches@gcc.gnu.org, mliska@suse.cz
Subject: Prevent merging across COMDAT group boundary
Date: Sat, 28 Feb 2015 22:42:00 -0000	[thread overview]
Message-ID: <20150228223958.GC1771@kam.mff.cuni.cz> (raw)

Hi,
tihs patch fixes one case I forgot in sem_function::merge: When target is not
in comdat group, we still can not make alias in the case source is.

Bootstrapped/regtested x86_64-linux, Martin, can you double check this fixes the xalancbmk?

Honza

	PR ipa/65237
	* ipa-icf.c (sem_function::merge): Do not attempt to produce alias
	across COMDAT group boundary.

Index: ipa-icf.c
===================================================================
--- ipa-icf.c	(revision 221076)
+++ ipa-icf.c	(working copy)
@@ -745,12 +755,17 @@ sem_function::merge (sem_item *alias_ite
 	it is an external functions where we can not create an alias
 	(ORIGINAL_DISCARDABLE)
      3) if target do not support symbol aliases.
+     4) original and alias lie in different comdat groups.
 
      If we can not produce alias, we will turn ALIAS into WRAPPER of ORIGINAL
      and/or redirect all callers from ALIAS to ORIGINAL.  */
   if ((original_address_matters && alias_address_matters)
-      || original_discardable
-      || !sem_item::target_supports_symbol_aliases_p ())
+      || (original_discardable
+	  && (!DECL_COMDAT_GROUP (alias->decl)
+	      || (DECL_COMDAT_GROUP (alias->decl)
+		  != DECL_COMDAT_GROUP (original->decl))))
+      || !sem_item::target_supports_symbol_aliases_p ()
+      || DECL_COMDAT_GROUP (alias->decl) != DECL_COMDAT_GROUP (original->decl))
     {
       /* First see if we can produce wrapper.  */
 

                 reply	other threads:[~2015-02-28 22:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150228223958.GC1771@kam.mff.cuni.cz \
    --to=hubicka@ucw.cz \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=mliska@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).