From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 22D143840C2A; Mon, 4 Jan 2021 16:24:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 22D143840C2A From: "marxin at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/98513] [10/11 Regression] Wrong code with -O3 since r10-2804-gbf05a3bbb58b3558 Date: Mon, 04 Jan 2021 16:24:39 +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: 11.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: marxin at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: marxin at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.3 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: Mon, 04 Jan 2021 16:24:40 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98513 --- Comment #2 from Martin Li=C5=A1ka --- Even more reduced test-case: $ cat combined.cc unsigned var; unsigned array[2]; int zero =3D 0, minus_2 =3D -2; const int &max(const int &a, const int &b) { return a > b ? a : b; } void test(int minus_1) { for (unsigned i_0 =3D 0; i_0 < 2; i_0++) { for (int i_3 =3D 0; i_3 < zero; i_3++) for (int i_4 =3D 0; i_4 < 2; i_4++) var =3D max(minus_1, 0); for (int i_6 =3D minus_2 + 2; i_6 < minus_1 + 3; i_6++) array[i_6] =3D zero; } } int main() { test(-1); }=