From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id ED1B13858C39; Sat, 18 Nov 2023 22:22:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ED1B13858C39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1700346166; bh=BcKxLB9RtrjJ70Uqg/trRGxVpIioRTBhBxZEQ0TWrfQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=AhwgOnZpe0Lgx0b5SNCt14/3LZWDdVNHipHd1Vd6gSYqBHLlhE8A5jTFvufbbbWbr d6nE/9HXlZDMY+w3Ns8zm+JyO4o5Cru9cgAYYkfdf38By18YkI/dU6tcnW8HdjYr+2 wWTMCiwS6Mca/UkruLSyzhn0QA7OXvXUy303jEU8= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/112572] [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1 Date: Sat, 18 Nov 2023 22:22:46 +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: blocker X-Bugzilla-Who: pinskia 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: 14.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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D112572 --- Comment #21 from Andrew Pinski --- So originally we had in vzeroupper: ``` (insn # # # 2 (set (reg/f:DI 43 r15 [orig:126 _84 ] [126]) (reg/f:DI 2 cx [orig:126 _84 ] [126])) "/home/sam/git/llvm-project/llvm/include/llvm/ADT/SmallVector.h":272:42 dis= crim 2# {*movdi_internal} (expr_list:REG_UNUSED (reg/f:DI 43 r15 [orig:126 _84 ] [126]) (nil))) (insn # # # 2 (set (reg/f:DI 43 r15 [orig:126 _84 ] [126]) (reg/f:DI 2 cx [orig:126 _84 ] [126])) "/tmp/build/include/c++/14.0.0/bits/stl_algo.h":1897:7# {*movdi_internal} (expr_list:REG_DEAD (reg/f:DI 2 cx [orig:126 _84 ] [126]) (nil))) ``` And then in postreload we changed it to just: ``` (insn # # # 2 (set (reg/f:DI 43 r15 [orig:126 _84 ] [126]) (reg/f:DI 2 cx [orig:126 _84 ] [126])) "/home/sam/git/llvm-project/llvm/include/llvm/ADT/SmallVector.h":272:42 dis= crim 2# {*movdi_internal} (expr_list:REG_UNUSED (reg/f:DI 43 r15 [orig:126 _84 ] [126]) (nil))) ``` Without updating the REG notes there. I suspect if we moved vzeroupper after postreload it would also just had worked. reload/LRA looks like it likes to generate extra moves that do the same thing ... Moving vzeroupper after postreload will also reduce memory and compile time= due to less REG_DEAD/REG_UNUSED being generated ...=