From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0B6FA3986C09; Tue, 15 Jun 2021 06:14:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0B6FA3986C09 From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/101076] RTL Combine pass won't generate sign_extnd RTX in some senario Date: Tue, 15 Jun 2021 06:14:39 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: WAITING 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: cf_reconfirmed_on everconfirmed bug_status 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: Tue, 15 Jun 2021 06:14:40 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101076 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2021-06-15 Ever confirmed|0 |1 Status|UNCONFIRMED |WAITING --- Comment #1 from Andrew Pinski --- What target is this for? For both x86_64 and aarch64 we have both shifts in SI mode so we don't end = up with problem. We get the following RTL for aarch64 (before combine): (insn 6 3 7 2 (set (reg:SI 96) (ashift:SI (reg/v:SI 94 [ a ]) (const_int 16 [0x10]))) "t551.c":3:15 692 {*aarch64_ashl_sisd_or_int_si3} (expr_list:REG_DEAD (reg/v:SI 94 [ a ]) (nil))) (insn 7 6 12 2 (set (reg:SI 95) (ashiftrt:SI (reg:SI 96) (const_int 16 [0x10]))) "t551.c":3:22 696 {*aarch64_ashr_sisd_or_int_si3} (expr_list:REG_DEAD (reg:SI 96) (nil))) And then we get: Trying 6 -> 7: 6: r96:SI=3Dr97:SI<<0x10 REG_DEAD r97:SI 7: r95:SI=3Dr96:SI>>0x10 REG_DEAD r96:SI Successfully matched this instruction: (set (reg:SI 95) (sign_extend:SI (subreg:HI (reg:SI 97) 0))) In combine. I Noticed you have: r76:SI=3Dr78:DI#0<<0x10 7: r75:SI=3Dr76:SI>>0x10 In combine, so you have a subreg of r78, where is the subreg produced ...=