From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0FC1C3858D37; Sat, 20 Apr 2024 10:53:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0FC1C3858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1713610389; bh=v0mDUCEORm0t5QhcxGYiaLpvZ6RA/4Kmg2L4cOm0U0I=; h=From:To:Subject:Date:From; b=THBT7rVHJDaq13kQobErAhSKU7vXk1Y8DtYiIaOD2p3vQ9TR7jHJlg3mcR8JmfiAa nAcY/O0s2qXlJYzmnKcjx5UmMyc67ybkyj/9U6qlM8IBw/ScVdJIgQsKyshcRF8s0X /NLBE4QBK0oLroLCP6IyztAceA6F5H9yyDLIszYk= From: "zhendong.su at inf dot ethz.ch" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/114787] New: wrong code at -O1 on x86_64-linux-gnu (the generated code hangs) Date: Sat, 20 Apr 2024 10:53:07 +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=3D114787 Bug ID: 114787 Summary: wrong code at -O1 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 appears to be a recent regression and does not reproduce with 13.2 and earlier.=20 Compiler Explorer: https://godbolt.org/z/6sbh8Wr1e [663] % 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 20240420 (experimental) (GCC)=20 [664] %=20 [664] % gcctk -O0 small.c; ./a.out [665] %=20 [665] % gcctk -O1 small.c [666] % timeout -s 9 10 ./a.out Killed [667] %=20 [667] % cat small.c int a, b, c, d, e =3D -1, f, g, h, j, k, n, o, p; int main() { int i, l =3D 2, m; for (b =3D 0; b < 1; b++) l =3D 0; for (; a >=3D 0; a--) for (m =3D 3; m; m--) { k =3D g; i =3D 0; for (; i < 1; i++) for (; f < 1; f++) h =3D g; n =3D 2 & ((e ^ d) | 1) * j; o =3D ~(e & n); q: if (c <=3D e) return 0; e =3D o; } p =3D l; l =3D 0; if (p) goto q; return 0; }=