From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D85EE396E861; Tue, 13 Jul 2021 19:39:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D85EE396E861 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/101129] [11/12 Regression] wrong code at -O1 since r11-5839 Date: Tue, 13 Jul 2021 19:39:57 +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: 12.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.2 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: Tue, 13 Jul 2021 19:39:58 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101129 --- Comment #4 from Jakub Jelinek --- I think this is a bug in the swaps rs6000 specific pass. It in particular changes (insn 20 19 21 2 (set (reg:DI 155) (mult:DI (reg:DI 224) - (subreg:DI (reg:V16QI 148) 0))) "pr101129.c":14:8 154 {muldi3} + (subreg:DI (reg:V16QI 148) 8))) "pr101129.c":14:8 154 {muldi3} (nil)) (insn 21 20 22 2 (set (reg:DI 156) (subreg:DI (mult:TI (zero_extend:TI (reg:DI 224)) - (zero_extend:TI (subreg:DI (reg:V16QI 148) 0))) 8)) "pr101129.c":14:8 166 {umuldi3_highpart_le} + (zero_extend:TI (subreg:DI (reg:V16QI 148) 8))) 0)) "pr101129.c":14:8 166 {umuldi3_highpart_le} (nil)) The SUBREG_BYTE changes in subregs of pseudo 148 look reasonable as the pass removed a xxswapd_v16qi that was swapping the value set to that pseudo. But the 8 to 0 change of SUBREG_BYTE with SUBREG_REG of MULT looks wrong, t= hat wouldn't even match unless simplified and turns a highpart multiply into lowpart multiply. So either the swaps pass needs to be fixed not to do that, or the highpart multiply instructions should be changed to e.g. use lshiftrt by 64 instead = of highpart subreg of the result.=