From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5F0BB3857B94; Sun, 10 Jul 2022 19:26:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5F0BB3857B94 From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/106247] GCC12 warning in Eigen: array subscript is partly outside array bounds Date: Sun, 10 Jul 2022 19:26:27 +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: 12.1.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: WAITING X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jul 2022 19:26:27 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106247 --- Comment #2 from Andrew Pinski --- the warning is correct in the sense the load is there in IR, though it looks like it is dead (but only because b and a are unused): array.7_137 =3D (long unsigned int) &MEM [(void *)&b + 8B]; _139 =3D array.7_137 >> 3; _140 =3D -_139; _141 =3D _140 & 3; first_142 =3D (long int) _141; _143 =3D MIN_EXPR ; _145 =3D 2 - _143; alignedEnd_148 =3D _143; goto ; [100.00%] [local count: 8655976563]: index.12_166 =3D (long unsigned int) index_165; _167 =3D index.12_166 * 8; _168 =3D &MEM [(void *)&a + 16B] + _167; _171 =3D &MEM [(void *)&b + 8B] + _167; _172 =3D *_168; MEM[(double &)_171] =3D _172; index_173 =3D index_165 + 1; [local count: 9725816346]: # index_165 =3D PHI <0(2), index_173(3)> if (_143 > index_165) goto ; [89.00%] else goto ; [11.00%] [local count: 8655976563]: index.10_152 =3D (long unsigned int) index_151; _153 =3D index.10_152 * 8; _154 =3D &MEM [(void *)&a + 16B] + _153; _155 =3D MEM[(__m256d_u * {ref-all})_154]; _158 =3D &MEM [(void *)&b + 8B] + _153; MEM[(__m256d * {ref-all})_158] =3D _155; index_159 =3D index_151 + 4; [local count: 9725816346]: # index_151 =3D PHI <_143(4), index_159(5)> if (alignedEnd_148 > index_151) goto ; [89.00%] else goto ; [11.00%]=