From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E7C4F3858D1E; Sun, 23 Oct 2022 11:12:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E7C4F3858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666523525; bh=CHtyB5DyA3pZF/O/bZMwlSrClSPmG+hmiXHKFvZ6pu4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=IP7AmVP+51AELrPQNrj+Mjk6c6ZgaK3fE2/QQlLSJxs+J5RPly7v+j8z0M3lIn1jj Hq4KtYPRYYAaUxtlrQSh/NW1EAYizJK7CkUC0fopOYuSV4eiwoFTU2JG+0R/d6u7qz weMgWAb8xEFSyT7mGb/1jgUKeLyz4sl1WVVTnOY8= From: "ebotcazou at gcc dot 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: ebotcazou at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: avieira at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107346 Eric Botcazou changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ebotcazou at gcc dot gnu.o= rg --- Comment #8 from Eric Botcazou --- > 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 =3D 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 =3D exact_div (pbitpos, BITS_PER_UNIT); is sufficient to get rid of it.=