From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 414DD385801C; Fri, 14 Oct 2022 18:29:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 414DD385801C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665772181; bh=qgbEiVWPwTdRMnUmbkFls2rM6AU0z3mP3ApJpWgzwwc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=b+2VART6Ro/6au6b6kNVtiqkPur7EY5i4+RhYqYhwOfh6CDPFboTCCZY2iW8VIiME 6OPV6G3umANSs75eweLwEproIT/ZnjLdFpNxfvNHTO0yJdOjQ929h0Z9t57+ht0kTA i7EzoLqqIBqj2qsgvxUdtY6utyGEYaJifFA0M0sk= From: "zhendong.su at inf dot ethz.ch" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/107269] wrong code at -O1 and above with "-fno-tree-ccp" on x86_64-linux-gnu Date: Fri, 14 Oct 2022 18:29:41 +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: unknown X-Bugzilla-Keywords: wrong-code 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: 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=3D107269 --- Comment #1 from Zhendong Su --- A related instance: [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/13.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 --with-system-zlib Thread model: posix Supported LTO compression algorithms: zlib gcc version 13.0.0 20221014 (experimental) [master r13-3307-g8efc38347a7] (= GCC)=20 [538] %=20 [538] % gcctk -O1 small.c; ./a.out [539] %=20 [539] % gcctk -O1 -fno-tree-ccp small.c [540] % timeout -s 9 5 ./a.out Killed [541] %=20 [541] % cat small.c int a, c, d; unsigned b; int main() { int f =3D 1; L1: c =3D f; L2: b & f; short i =3D -f; if (!a) { d =3D f; f =3D ~(b % f); if (d > -1) goto L2; } f =3D i; if (a) goto L1; int *j =3D &f; return 0; }=