From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3BE6E3858C30; Fri, 13 Oct 2023 06:28:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3BE6E3858C30 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1697178509; bh=kfZy8GSaKsLnbCer0oRo+JIR1D9c7SiioGhC9v4fZ0E=; h=From:To:Subject:Date:From; b=v+WljgcE/HNRG10zaMBTrudGb22ZOjHhVPayZ/4ow0MrR84kAwBnzqf4WeloFKjG3 14zIz+75unm0RBKPXPsa1BMuFPsoUW8VhTkEYH28956WSK9rz3/XsmQEz5tah+froU 5dR1lhVnHcye73xqdWk0klQ3hFWLqOcDh7Z1bjhE= From: "zhendong.su at inf dot ethz.ch" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/111792] New: wrong code at -O3 on x86_64-linux-gnu Date: Fri, 13 Oct 2023 06:28:28 +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=3D111792 Bug ID: 111792 Summary: wrong code at -O3 on x86_64-linux-gnu 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. compiler Explorer: https://godbolt.org/z/7vfzPYTrn [537] % 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.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 --enable-mu= ltilib Thread model: posix Supported LTO compression algorithms: zlib gcc version 14.0.0 20231013 (experimental) (GCC)=20 [538] %=20 [538] % gcctk -O2 small.c; ./a.out [539] %=20 [539] % gcctk -O3 small.c [540] % ./a.out Aborted [541] % cat small.c int c, d, h, i, j, l, *n =3D &h; short e, f, g, *k, m; long o; short p(short p1, int q) { return q >=3D 32 || p1 > 5 >> q ? 1 : p1 << q; } long u(unsigned p1) { int r =3D 50, s, *t =3D &c; L: m && (*k =3D 0); for (d =3D 1; d; d--) for (s =3D 0; s < 3; s++) { *n =3D i ^ p1; *t =3D p1 > (unsigned)p((unsigned)(o =3D 4073709551615) >=3D p1 && 5,= r); if (f) goto L; } for (; e < 1;) return j; int *b[2] =3D {&s, &r}; for (; l; l--) { long a[1]; for (r =3D 0; r < 1; r++) { h =3D a[0]; if (g) goto L; } } return 0; } int main() { u(6); if (c !=3D 1) __builtin_abort(); return 0; }=