From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 100E13858D28; Fri, 12 Nov 2021 10:18:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 100E13858D28 From: "aldyh at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/103202] [12 regression] gcc miscompiles ed-1.17 since r12-3876-g4a960d548b7d7d94 Date: Fri, 12 Nov 2021 10:18:40 +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: 12.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: aldyh at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.0 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2021 10:18:40 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103202 --- Comment #6 from Aldy Hernandez --- Not looking at this yet, but disabling jump threading from all passes (dom included) makes the problem go away: $ ./xgcc -B./ a.c -w -O2 -fno-thread-jumps && ./a.out element 1 element 2 element 3 ...so *maybe* threading related. The minimum number of threads that reproduces this is: ./xgcc -B./ a.c -w -O2 -fdbg-cnt=3Dregistered_jump_thread:1-1:3-3:5-5 && ./a.out ***dbgcnt: lower limit 1 reached for registered_jump_thread.*** ***dbgcnt: upper limit 1 reached for registered_jump_thread.*** ***dbgcnt: lower limit 3 reached for registered_jump_thread.*** ***dbgcnt: upper limit 3 reached for registered_jump_thread.*** ***dbgcnt: lower limit 5 reached for registered_jump_thread.*** ***dbgcnt: upper limit 5 reached for registered_jump_thread.*** element 1 element 2 $ grep 'Register.*jump' a.c.* a.c.111t.threadfull1: [1] Registering jump thread: (6, 7) incoming edge; = (7, 9) nocopy;=20 a.c.126t.thread1: [3] Registering jump thread: (2, 4) incoming edge; (4, = 12) nocopy;=20 a.c.191t.thread2: [5] Registering jump thread: (13, 11) incoming edge; (1= 1, 10) nocopy;=