From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4C7B93858D37; Thu, 2 Nov 2023 06:47:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4C7B93858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1698907665; bh=kA1I4+sBr8IXBYdHWgzVTPHZGi4xRcyV9YcHekpUocw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=E0j3Rlp+KYSvZkyD+Pe+UeeEs0ekiv6cLKk3w7UeWgcqFAy9wm7YPF2e50QK4hgjm 0Fz+x3L6gZumriObfo5PwTIkPQYOFwm5gYRaTTJniWTthIr4h1fisHTu3IiF0jmWRN Ru5MAFpuAmH/dPQZYaNxZBPKDdCLNX8torzTUTi8= From: "jwzeng at nuaa dot edu.cn" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/112344] [14 Regression] Wrong code at -O2 on x86_64-pc-linux-gnu Date: Thu, 02 Nov 2023 06:47:45 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jwzeng at nuaa dot edu.cn 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: 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=3D112344 --- Comment #3 from Junwei Zeng --- (In reply to Andrew Pinski from comment #2) > Corrected testcase: > ``` > int printf(const char *, ...); > void a() { > long b =3D 2036854775807; > char c =3D 3; > short d; > int e =3D -2147483648, f =3D 0; > for (; f < 7; f++) > while (e < 20) { > e +=3D 2; > d =3D c -=3D b; > } > printf("%d\n", d); > } > int main() { a(); } > ``` Sorry, I copied the wrong test case, the correct test case is the one in Compiler explorer, which is the one you mentioned. Compiler explorer: https://godbolt.org/z/8hq64asT5=