public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Guenther <rguenther@suse.de>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH][last/n] LTO type merging cleanup
Date: Mon, 23 May 2011 15:54:00 -0000	[thread overview]
Message-ID: <alpine.LNX.2.00.1105231716390.810@zhemvz.fhfr.qr> (raw)


This is the last (planned) bit for the regular type merging machinery
(there is still some issues with TYPE_CANONICAL that I will try to
address next).  It avoids merging types which have different names
as that leads to interesting debuginfo issues.

LTO-bootstrapped and tested on x86_64-unknown-linux-gnu, SPEC 2k6
non--g built (w/o any but the TYPE_CANONICAL issues), SPEC 2k6 -g
build running.

Richard.

2011-05-23  Richard Guenther  <rguenther@suse.de>

	* gimple.c (gimple_types_compatible_p_1): Always compare type names.
	(iterative_hash_gimple_type): Always hash type names.

Index: gcc/gimple.c
===================================================================
*** gcc/gimple.c	(revision 174065)
--- gcc/gimple.c	(working copy)
*************** gimple_types_compatible_p_1 (tree t1, tr
*** 3587,3592 ****
--- 3587,3596 ----
       SCCs this assumption may get revisited.  */
    state->u.same_p = 1;
  
+   /* The struct tags shall compare equal.  */
+   if (!compare_type_names_p (t1, t2, false))
+     goto different_types;
+ 
    /* If their attributes are not the same they can't be the same type.  */
    if (!attribute_list_equal (TYPE_ATTRIBUTES (t1), TYPE_ATTRIBUTES (t2)))
      goto different_types;
*************** gimple_types_compatible_p_1 (tree t1, tr
*** 3797,3806 ****
        {
  	tree f1, f2;
  
- 	/* The struct tags shall compare equal.  */
- 	if (!compare_type_names_p (t1, t2, false))
- 	  goto different_types;
- 
  	/* For aggregate types, all the fields must be the same.  */
  	for (f1 = TYPE_FIELDS (t1), f2 = TYPE_FIELDS (t2);
  	     f1 && f2;
--- 3801,3806 ----
*************** iterative_hash_gimple_type (tree type, h
*** 4093,4099 ****
       smaller sets; when searching for existing matching types to merge,
       only existing types having the same features as the new type will be
       checked.  */
!   v = iterative_hash_hashval_t (TREE_CODE (type), 0);
    v = iterative_hash_hashval_t (TYPE_QUALS (type), v);
    v = iterative_hash_hashval_t (TREE_ADDRESSABLE (type), v);
  
--- 4093,4100 ----
       smaller sets; when searching for existing matching types to merge,
       only existing types having the same features as the new type will be
       checked.  */
!   v = iterative_hash_name (TYPE_NAME (type), 0);
!   v = iterative_hash_hashval_t (TREE_CODE (type), v);
    v = iterative_hash_hashval_t (TYPE_QUALS (type), v);
    v = iterative_hash_hashval_t (TREE_ADDRESSABLE (type), v);
  
*************** iterative_hash_gimple_type (tree type, h
*** 4175,4182 ****
        unsigned nf;
        tree f;
  
-       v = iterative_hash_name (TYPE_NAME (type), v);
- 
        for (f = TYPE_FIELDS (type), nf = 0; f; f = TREE_CHAIN (f))
  	{
  	  v = iterative_hash_name (DECL_NAME (f), v);
--- 4176,4181 ----

             reply	other threads:[~2011-05-23 15:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-23 15:54 Richard Guenther [this message]
2011-05-23 16:16 ` H.J. Lu
2011-05-23 16:19   ` Richard Guenther

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=alpine.LNX.2.00.1105231716390.810@zhemvz.fhfr.qr \
    --to=rguenther@suse.de \
    --cc=gcc-patches@gcc.gnu.org \
    /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).