From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 62BB6384403C; Tue, 6 Apr 2021 15:37:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 62BB6384403C From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/99927] [11 Regression] Maybe wrong code since r11-39-gf9e1ea10e657af9f Date: Tue, 06 Apr 2021 15:37:05 +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: 11.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: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: assigned_to 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, 06 Apr 2021 15:37:05 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99927 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|jakub at gcc dot gnu.org |unassigned at gcc d= ot gnu.org Status|ASSIGNED |NEW --- Comment #7 from Jakub Jelinek --- Ah, create_log_links wants to work like that. So, the bug seems to be that insn 108 has REG_DEAD (reg:CC 17 flags) note. It doesn't initially, but it is added during 106 -> 108 combination (gdb) p debug_rtx (i3) (insn 108 107 111 6 (set (reg:QI 96 [ var_lsm_flag.12 ]) (if_then_else:QI (eq (reg:CCZ 17 flags) (const_int 0 [0])) (reg:QI 134) (reg:QI 135))) "pr99927.c":13:24 1104 {*movqicc_noc} (expr_list:REG_DEAD (reg:QI 134) (nil))) $151 =3D void (gdb) p debug_rtx (i2) (insn 106 105 107 6 (parallel [ (set (reg:QI 134) (and:QI (subreg:QI (reg:SI 107) 0) (const_int 1 [0x1]))) (clobber (reg:CC 17 flags)) ]) "pr99927.c":13:24 491 {*andqi_1} (expr_list:REG_UNUSED (reg:CC 17 flags) (nil))) The combination of those 2 insns is successful - into: (insn 108 107 111 6 (set (reg:QI 96 [ var_lsm_flag.12 ]) (if_then_else:QI (eq (reg:CCZ 17 flags) (const_int 0 [0])) (subreg:QI (reg:SI 107) 0) (reg:QI 135))) "pr99927.c":13:24 1104 {*movqicc_noc} (expr_list:REG_DEAD (reg:SI 107) (expr_list:REG_DEAD (reg:CC 17 flags) (nil)))) but the distribute_notes that turned REG_UNUSED (reg:CC 17 flags) note from insn 106 into REG_DEAD (reg:CC 17 flags) note on insn 108 is what looks bro= ken to me, the flags register is set by insn 107 in between those two and is used by s= ome insns after insn 108 (111 and 85) and the new combined pattern certainly doesn't kill the register in any way. Segher, could you please have a look? Thanks.=