From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CE08C3858416; Sun, 5 Sep 2021 07:01:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CE08C3858416 From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/89954] missed optimization for signed extension for x86-64 Date: Sun, 05 Sep 2021 07:01:16 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 8.3.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: NEW 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_severity 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: Sun, 05 Sep 2021 07:01:16 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D89954 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |enhancement --- Comment #3 from Andrew Pinski --- So at combine we have: (insn 5 2 6 2 (set (reg:QI 87 [ c ]) (mem/c:QI (symbol_ref:DI ("c") [flags 0x2] ) [0 c+0 S1 A8])) "/app/example.cpp":5:14 77 {*movqi_internal} (nil)) (insn 6 5 7 2 (parallel [ (set (reg:QI 86) (xor:QI (reg:QI 87 [ c ]) (const_int 1 [0x1]))) (clobber (reg:CC 17 flags)) ]) "/app/example.cpp":5:14 546 {*xorqi_1} (expr_list:REG_DEAD (reg:QI 87 [ c ]) (expr_list:REG_UNUSED (reg:CC 17 flags) (expr_list:REG_EQUAL (xor:QI (mem/c:QI (symbol_ref:DI ("c") [fl= ags 0x2] ) [0 c+0 S1 A8]) (const_int 1 [0x1])) (nil))))) (insn 7 6 12 2 (set (reg:SI 85) (sign_extend:SI (reg:QI 86))) "/app/example.cpp":5:14 154 {extendqi= si2} (expr_list:REG_DEAD (reg:QI 86) (nil))) The load is not loaded into the full SI/DI register yet. The change to SI m= ode for xor happens after reload in split2. So yes it is a target issue.=