public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ebotcazou at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/107346] [13 Regression] gnat.dg/loop_optimization23_pkg.ad failure afer r13-3413-ge10ca9544632db
Date: Sun, 23 Oct 2022 11:12:03 +0000	[thread overview]
Message-ID: <bug-107346-4-7YI8p5EJGW@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-107346-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107346

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ebotcazou at gcc dot gnu.org

--- Comment #8 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> I am wondering whether I should try to support this, or bail out of
> vect_check_gather_scatter if pbitpos is not a multiple of BITS_PER_UNIT. The
> latter obviously feels safer.

It turns out that this vect_check_gather_scatter problem was latent since I can
reproduce it with the GCC 12 compiler in Ada, and the following fix:

diff --git a/gcc/tree-vect-data-refs.cc b/gcc/tree-vect-data-refs.cc
index e32b1779c5d..a22eb2d763d 100644
--- a/gcc/tree-vect-data-refs.cc
+++ b/gcc/tree-vect-data-refs.cc
@@ -4013,7 +4013,7 @@ vect_check_gather_scatter (stmt_vec_info stmt_info,
loop_vec_info loop_vinfo,
      that can be gimplified before the loop.  */
   base = get_inner_reference (base, &pbitsize, &pbitpos, &off, &pmode,
                              &punsignedp, &reversep, &pvolatilep);
-  if (reversep)
+  if (!multiple_p (pbitpos, BITS_PER_UNIT) || reversep)
     return false;

   poly_int64 pbytepos = exact_div (pbitpos, BITS_PER_UNIT);

is sufficient to get rid of it.

  parent reply	other threads:[~2022-10-23 11:12 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-21  9:53 [Bug tree-optimization/107346] New: " avieira at gcc dot gnu.org
2022-10-21  9:58 ` [Bug tree-optimization/107346] " avieira at gcc dot gnu.org
2022-10-21 11:12 ` rguenth at gcc dot gnu.org
2022-10-21 11:13 ` [Bug tree-optimization/107346] [13 Regression] " rguenth at gcc dot gnu.org
2022-10-21 11:24 ` avieira at gcc dot gnu.org
2022-10-21 11:35 ` avieira at gcc dot gnu.org
2022-10-21 11:49 ` ebotcazou at gcc dot gnu.org
2022-10-21 11:50 ` avieira at gcc dot gnu.org
2022-10-21 11:52 ` ebotcazou at gcc dot gnu.org
2022-10-23 11:12 ` ebotcazou at gcc dot gnu.org [this message]
2022-10-23 14:47 ` avieira at gcc dot gnu.org
2022-10-28 14:09 ` cvs-commit at gcc dot gnu.org
2022-10-29  8:34 ` ebotcazou at gcc dot gnu.org

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=bug-107346-4-7YI8p5EJGW@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).