From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 607623858D34; Sun, 21 Apr 2024 16:03:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 607623858D34 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1713715423; bh=qITZ60CVDPnti7je5unbL7U+hAwAgGTX4J1LvI5qzUU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=RduzuTLJfMvFC3kpZadSDu2cHodRrCGwPymU6AixV2lhdVLd+AaiWLFZ3O6LIem8w h+tYxyCJ1/fMLH5yi7L6XL2VBbuv/iAeFgfFPbgBldCNjTAreGZs9KwhFBZ5btUhQq ujZ/iWOABBczR6eZ2uXbn+LTV/3a2sM2gb2160So= From: "hjl.tools at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/114793] [14 Regression] wrong code at -O1 with "-fschedule-insns2 -fselective-scheduling2" on x86_64-linux-gnu (the generated code hangs) Date: Sun, 21 Apr 2024 16:03:43 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hjl.tools at gmail dot com X-Bugzilla-Status: NEW 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: 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=3D114793 --- Comment #3 from H.J. Lu --- (In reply to Zhendong Su from comment #1) > The following reproducer is different, but perhaps is the same or related. >=20 > Compiler Explorer: https://godbolt.org/z/411rzMP1n >=20 > [588] % gcctk -v > Using built-in specs. > COLLECT_GCC=3Dgcctk > COLLECT_LTO_WRAPPER=3D/local/suz-local/software/local/gcc-trunk/libexec/g= cc/ > 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-tr= unk > --enable-sanitizers --enable-languages=3Dc,c++ --disable-werror > --enable-multilib > Thread model: posix > Supported LTO compression algorithms: zlib > gcc version 14.0.1 20240421 (experimental) (GCC)=20 > [589] %=20 > [589] % gcctk -O1 -fno-tree-forwprop -fselective-scheduling2 > -fschedule-insns2 -fsel-sched-pipelining small.c > [590] % ./a.out > Aborted > [591] %=20 > [591] % cat small.c > int printf(const char *, ...); > int a, d, g, h; > volatile int b =3D 1; > static unsigned c =3D 1; > char e, f =3D 1, i; > static int j() { > int k, l =3D g, m =3D 1 << l, n =3D -e, o =3D -1 % ((f && 1) ^ i), p = =3D ~n - o; > if (m) { > int q, s, t, r =3D 1 % (((1 % f) & (~e | c)) ^ b); > q =3D f; > s =3D i; > t =3D e; > f =3D -b; > k =3D f; > d =3D -1; > u: > e =3D 0 & b; > if (i > f) > if (!b) > goto v; > if (d > t) > __builtin_abort(); > if (b < 1 || !d || !c) { > printf("%d\n", i); > f =3D ((i | b) & (k - r)) << (e << ~t ^ q) << s; > goto u; > } > if (i) > f =3D q; > v: > i =3D n & o & l; > printf("%ld\n", (long)t); > } > i =3D p; > return h; > } > int main() { > for (; a < 3; a++) > j(); > return 0; > } This is caused by r14-2524.=