From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B28FE3861002; Fri, 23 Oct 2020 19:23:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B28FE3861002 From: "su at cs dot ucdavis.edu" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/97555] New: wrong code at -Os and above on x86_64-pc-linux-gnu Date: Fri, 23 Oct 2020 19:23:06 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: su at cs dot ucdavis.edu 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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: Fri, 23 Oct 2020 19:23:06 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97555 Bug ID: 97555 Summary: wrong code at -Os and above on x86_64-pc-linux-gnu Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: su at cs dot ucdavis.edu Target Milestone: --- [536] % gcctk -v Using built-in specs. COLLECT_GCC=3Dgcctk COLLECT_LTO_WRAPPER=3D/local/suz-local/software/local/gcc-trunk/libexec/gcc= /x86_64-pc-linux-gnu/11.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc-trunk/configure --disable-bootstrap --prefix=3D/local/suz-local/software/local/gcc-trunk --enable-languages=3Dc= ,c++ --disable-werror --enable-multilib --with-system-zlib Thread model: posix Supported LTO compression algorithms: zlib gcc version 11.0.0 20201023 (experimental) [master revision 7991e963239:9cbfe237f74:757ba6653c2699761c2243e0194749a6695112d8] (GCC)=20 [537] %=20 [537] % gcctk -O1 small.c; ./a.out [538] %=20 [538] % gcctk -Os small.c [539] % ./a.out Floating point exception [540] %=20 [540] % cat small.c struct { int a:1; } b; int c, d, e, f =3D 1, g; int main () { for (; d < 3; d++) { char h =3D 1 % f, i =3D ~(0 || ~0); c =3D h; f =3D ~b.a; ~b.a | 1 ^ ~i && g; if (~e) i =3D b.a; b.a =3D i; } return 0; }=