From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 545023858417; Thu, 29 Jun 2023 17:33:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 545023858417 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1688059991; bh=YIyYWGPk9eKvqVON6fGTibCMf8p4iJv4KD8mFO+O7uQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=oL43MxuF/C4BZLpcAPtoWTsEeEU99xpQ5Kx9BHoKJHveKP1hDCJRmZUQv1qQvsWCq LECuUOGdhxh6NGuC3In1es/ysc90QdOhbpmVsr3EEBhPjXgfunkILLHYeYSMgMM3co 6DBdB5q9XTAT3O9jPNjwURmG9qD4QIGe9CPAoBaU= 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: Thu, 29 Jun 2023 17:33:11 +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 #4 from Zhendong Su --- Another likely related reproducer that affects 9.* and later. Compiler Explorer: https://godbolt.org/z/8vTd7rx6d [641] % 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 20230629 (experimental) [master r14-924-gd709841ae0f] (G= CC)=20 [642] %=20 [642] % gcctk -O2 -fselective-scheduling2 -fno-tree-pre small.c [643] % ./a.out 34 [644] % gcctk -O2 small.c [645] % ./a.out 1 [646] % cat small.c int printf(const char *, ...); int a, b; int main() { unsigned int c =3D 0; unsigned char d =3D 33; for (; a < 1; a++) { unsigned int e =3D 0; unsigned char f =3D 0; if (c < 1) { e =3D f =3D d; c =3D b * 4; if (c < b) printf("%ld", (long)d); if (!f) break; } c =3D e; d =3D f; } printf("%d\n", a); return 0; }=