public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Martin Jambor <jamborm@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-4662] sra: Fix the fix for PR 102505 (PR 102886)
Date: Mon, 25 Oct 2021 13:27:11 +0000 (GMT)	[thread overview]
Message-ID: <20211025132711.D98BD3858C27@sourceware.org> (raw)

https://gcc.gnu.org/g:f217e87972a2a207e793101fc05cfc9dd095c678

commit r12-4662-gf217e87972a2a207e793101fc05cfc9dd095c678
Author: Martin Jambor <mjambor@suse.cz>
Date:   Mon Oct 25 15:22:06 2021 +0200

    sra: Fix the fix for PR 102505 (PR 102886)
    
    I was not careful with the fix for PR 102505 and did not craft the
    check to satisfy the verifier carefully, which lead to PR 102886.
    (The verifier has the test structured differently and somewhat
    redundantly, so I could not just copy it).
    
    This patch fixes it.  I hope it is quite obvious correction of an
    oversight and so will commit it if survives bootstrap and testing on
    x86_64-linux and ppc64le-linux.
    
    Testcase for this bug is gcc.dg/tree-ssa/sra-18.c (but only on
    platforms with constant pools).  I will backport the two fixes
    to the release branches squashed.
    
    gcc/ChangeLog:
    
    2021-10-22  Martin Jambor  <mjambor@suse.cz>
    
            PR tree-optimization/102886
            * tree-sra.c (totally_scalarize_subtree): Fix the out of
            access-condition.

Diff:
---
 gcc/tree-sra.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index f561e1a2133..76e3aae405c 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -3288,7 +3288,7 @@ totally_scalarize_subtree (struct access *root)
 	      continue;
 
 	    HOST_WIDE_INT pos = root->offset + int_bit_position (fld);
-	    if (pos + fsize > root->size)
+	    if (pos + fsize > root->offset + root->size)
 	      return false;
 	    enum total_sra_field_state
 	      state = total_should_skip_creating_access (root,


                 reply	other threads:[~2021-10-25 13:27 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=20211025132711.D98BD3858C27@sourceware.org \
    --to=jamborm@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).