From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9299C3858D35; Thu, 22 Jun 2023 18:36:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9299C3858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1687458980; bh=c2/dc+2IN4BPB9kvN+1FyncsuPquK6qhvpIY+Yx7/2Y=; h=From:To:Subject:Date:From; b=MUMBvjQhqwKl3/vqDdHTjZ6XwcpgLS3sKTB4HGtr/p3CmB64TzH+iOJYOBdXECz0d Gg+lMmmf4qEPD3U2RW1Z6Ur7E5A1dfTw3IGBI+3SXPrTEGAjWLnU29s8vsUgQ8wKgg Dbq9z8amHxxmeGIUVaeTA7oTZdDSZZjGV2BoyAgU= From: "zhendong.su at inf dot ethz.ch" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/110369] New: wrong code on x86_64-linux-gnu Date: Thu, 22 Jun 2023 18:36:20 +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=3D110369 Bug ID: 110369 Summary: wrong code 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. I'm unsure how interesting the test i= s as it uses a few non-default flags, but here it is. Compiler Explorer: https://godbolt.org/z/rvsrfzb1K [813] % gcctk -v Using built-in specs. COLLECT_GCC=3Dgcctk COLLECT_LTO_WRAPPER=3D/local/home/suz/suz-local/software/local/gcc-trunk/bi= n/../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 --disable-multilib Thread model: posix Supported LTO compression algorithms: zlib gcc version 14.0.0 20230622 (experimental) [master r14-924-gd709841ae0f] (G= CC)=20 [814] %=20 [814] % gcctk -O3 -fno-thread-jumps -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops -fno-split-loops -fno-tree-loop-ivcanon -fselective-scheduling2 -w small.c [815] % timeout -s 9 5 ./a.out Killed [816] %=20 [816] % gcctk -O3 -w small.c; ./a.out [817] %=20 [817] % cat small.c int printf(const char *, ...); int a, b[2] =3D {0, 0}, c; void d() { int e, f; for (f =3D 0; f < 2; f++) if (a) { for (e =3D 0; e < 5; e++) { printf("%d", b[e]); if (c) printf("\n"); } } } int main() { d(); }=