From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 43691385B512; Fri, 27 Jan 2023 17:07:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 43691385B512 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1674839265; bh=DVLsD6DZ8bnKxvut3ulEl7m35XGB64d7G/1Fqdl7RwA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=giRMs2jBMVbsvZju6H42PQz1S2h7tvY0+sWevKOi+kbjiduBlqvSQ0gGg9eHszQ+w jEjj6Z7Fp1MYT6qPivhkyWprsPbn0BNNemaMAKWqYnVHaTUcPEXiV0+AJ/W+PAq2NH D4eZ5sy0cPXy7EkzeBr4UtF7JpKiGho6KsDMFq2w= From: "zhendong.su at inf dot ethz.ch" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/108574] wrong code at -Os and above on x86_64-linux-gnu Date: Fri, 27 Jan 2023 17:07:45 +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: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: zhendong.su at inf dot ethz.ch X-Bugzilla-Status: UNCONFIRMED 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108574 --- Comment #1 from Zhendong Su --- Here is another reproducer likely for the same bug. Compiler Explorer: https://godbolt.org/z/Efvczc6f8 [556] % gcctk -O3 small.c [557] % ./a.out Floating point exception [558] %=20 [558] % cat small.c int a, b, c, d, e, f, g =3D -1, h; void l() { if (!e) goto i; for (; g; g++) { b =3D ~d; int j =3D 0, k =3D 1; if (k && (b || f)) j =3D b; i: a =3D ~j; } } int main() { h =3D 3; for (; h; h--) { e =3D 1; int m =3D ~a, n =3D 1 % m; c =3D n; l(); } return 0; }=