From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 584513858D32; Sun, 21 Apr 2024 11:47:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 584513858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1713700046; bh=KfzZA6IASPG3j6PS+wvZAczHN5I3aijR8HQrXcsp5J0=; h=From:To:Subject:Date:From; b=oRiksFPPfh0y2VZu2Cpjjc0ZaWi5WyBfeSzcmFuhKLwksViM0/Q4LbBsaNm6lrkB2 eDlZboKoEta2YOeygfRrgtBL8+XTAljvP61nMocUWFICMC5FAn45bG53es67U1SWXS LE4OaZR7BGj2XoszWeKkH6uYoHVibhNbKY9UxC5A= From: "zhendong.su at inf dot ethz.ch" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/114793] New: wrong code at -O1 with "-fschedule-insns2 -fselective-scheduling2" on x86_64-linux-gnu (the generated code hangs) Date: Sun, 21 Apr 2024 11:47:25 +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: 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: 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114793 Bug ID: 114793 Summary: wrong code at -O1 with "-fschedule-insns2 -fselective-scheduling2" on x86_64-linux-gnu (the generated code hangs) Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: zhendong.su at inf dot ethz.ch Target Milestone: --- It seems to be a recent regression as it does not reproduce with 13.2 and earlier. Compiler Explorer: https://godbolt.org/z/b3cc1MqP9 [538] % 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/14.0.1/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 --enable-mu= ltilib Thread model: posix Supported LTO compression algorithms: zlib gcc version 14.0.1 20240421 (experimental) (GCC)=20 [539] %=20 [539] % gcctk -O0 small.c [540] % ./a.out [541] %=20 [541] % gcctk -O1 -fschedule-insns2 -fselective-scheduling2 small.c [542] % timeout -s 9 10 ./a.out Killed [543] %=20 [543] % cat small.c int printf(const char *, ...); volatile int a; int b, c, d =3D 1, e, f; int main() { int g =3D 1; for (; b; b -=3D d) g =3D e; for (; c < 2; c++) { if (g) { if (!d) printf("%d", f); continue; } a; } return 0; }=