public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Richard Biener <rguenth@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r11-7596] tree-optimization/99510 - fix type reuse of build_aligned_type
Date: Wed, 10 Mar 2021 12:14:24 +0000 (GMT)	[thread overview]
Message-ID: <20210310121424.7DC153842415@sourceware.org> (raw)

https://gcc.gnu.org/g:6ceb712e2699a493da544b1755f6f73d62930f9b

commit r11-7596-g6ceb712e2699a493da544b1755f6f73d62930f9b
Author: Richard Biener <rguenther@suse.de>
Date:   Wed Mar 10 11:57:21 2021 +0100

    tree-optimization/99510 - fix type reuse of build_aligned_type
    
    The fix for PR94775 added more strict checking for type reuse
    to check_aligned_type, specifically matching TYPE_USER_ALIGN.
    But then build_aligned_type sets TYPE_USER_ALIGN on the built
    variant so if the type we build an aligned variant for does not
    have TYPE_USER_ALIGN we'll never re-use the newly created aligned
    variant.  This results in ~35000 identical variants being created
    for polyhedron doduc.
    
    The following instead checks that the candidate has TYPE_USER_ALIGN set.
    
    2021-03-10  Richard Biener  <rguenther@suse.de>
    
            PR tree-optimization/99510
            * tree.c (check_aligned_type): Check that the candidate
            has TYPE_USER_ALIGN set instead of matching with the
            original type.

Diff:
---
 gcc/tree.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gcc/tree.c b/gcc/tree.c
index 8fa99951df7..7c44c226a33 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -6609,7 +6609,9 @@ check_aligned_type (const_tree cand, const_tree base, unsigned int align)
 	  && TYPE_CONTEXT (cand) == TYPE_CONTEXT (base)
 	  /* Check alignment.  */
 	  && TYPE_ALIGN (cand) == align
-	  && TYPE_USER_ALIGN (cand) == TYPE_USER_ALIGN (base)
+	  /* Check this is a user-aligned type as build_aligned_type
+	     would create.  */
+	  && TYPE_USER_ALIGN (cand)
 	  && attribute_list_equal (TYPE_ATTRIBUTES (cand),
 				   TYPE_ATTRIBUTES (base))
 	  && check_lang_type (cand, base));


                 reply	other threads:[~2021-03-10 12:14 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=20210310121424.7DC153842415@sourceware.org \
    --to=rguenth@gcc.gnu.org \
    --cc=gcc-cvs@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).