From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 39C013858D38; Sat, 15 Oct 2022 20:45:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 39C013858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665866732; bh=0IwF41XlyTOG4wdUQ4gq/t2Dpgh5qGJWpOSfM6SCbQ0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Ym8qCbNnu3jlSk2/6K0+HJsV45t0jvAKodqtqLMVJCtVlXcxsQaXODqs8K79VLcRA d+uoBzmBoPHKI1VNkugqBZHRLK/lFkvv53zcQ0s5mN1fTnGGwrNQyqVi11lWGDodns 7X35yjbXSvrDuBTRmztdXiffIPX9HbCUwzodKPC8= 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: Sat, 15 Oct 2022 20:45:31 +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 #2 from Zhendong Su --- Another related instance: [642] % 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 20221015 (experimental) [master r13-3311-gbaeec7cc83b] (= GCC) [643] % [643] % gcctk -O1 small.c; ./a.out [644] % [644] % gcctk -O1 -fno-tree-ccp small.c [645] % ./a.out Aborted [646] % [646] % cat small.c char a; unsigned b; int d =3D 39381789, e, f, g =3D 1; long h, i; int main() { int j =3D 38; long k =3D 1; for (; e < 8; e++) if (k) while (1) { int l =3D j * h; char m =3D j; if (g) m =3D a; f =3D j; b =3D d; j =3D d =3D b * f; if (d < 665) break; if (f > d) k =3D m; long n =3D ~(b - i); i =3D ~h; if (b <=3D 46295405) break; h =3D n; int *c =3D &j; if (i > 10843) __builtin_abort(); } return 0; }=