From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9A30D3858D37; Mon, 26 Jun 2023 09:12:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9A30D3858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1687770737; bh=4elqUwoEQ70R+NyxsZ1DaKKNUTln6PpIKOONbvEbQzI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=xsyOjMMnRyBWUruCZDvuhOTIpDRxrGKo0sBdO/rgRCbV7JIlqPbt7oUmXjP2vpVGJ axfTU3QbNhzOXGs7XRSV57KPLC4eJW1smItsWbKaUyodZPv513OWdEIDJS0R5TuJF9 dZXrMxKKSjFRi6foceK5WySUILTF9zCNCgET6MZo= From: "zhendong.su at inf dot ethz.ch" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/110391] [12/13/14 Regression] wrong code at -O2 and -O3 with "-fsel-sched-pipelining -fselective-scheduling2" on x86_64-linux-gnu Date: Mon, 26 Jun 2023 09:12:15 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: wrong-code 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: 12.4 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=3D110391 --- Comment #2 from Zhendong Su --- A likely related reproducer that affects 10.* and later.=20 Compiler Explorer: https://godbolt.org/z/KP6PnTKPj [579] % gcctk -v Using built-in specs. COLLECT_GCC=3Dgcctk COLLECT_LTO_WRAPPER=3D/local/home/suz/suz-local/software/local/gcc-trunk/bi= n/../libexec/gcc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc-trunk/configure --disable-bootstrap --enable-checking=3Dyes --prefix=3D/local/suz-local/software/local/gcc-trunk --enable-sanitizers --enable-languages=3Dc,c++ --disable-werror --disable-multilib Thread model: posix Supported LTO compression algorithms: zlib gcc version 14.0.0 20230625 (experimental) [master r14-924-gd709841ae0f] (G= CC)=20 [580] %=20 [580] % gcctk -O2 -fsel-sched-pipelining -fschedule-insns -fselective-scheduling2 small.c [581] % ./a.out Floating point exception [582] %=20 [582] % gcctk -O2 small.c; ./a.out [583] %=20 [583] % cat small.c int printf(const char *, ...); int a, d, e =3D -2; char b; long c =3D -2; int main() { int g, h; d =3D e; g =3D c; L: h =3D d; c =3D 1; d =3D c % ~e; e =3D e >> ~g; if (e > b) printf("%ld", c); if (g > c) printf("%d", a); if (b) goto L; e =3D h; return 0; }=