From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D2E833846012; Thu, 1 Apr 2021 12:26:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D2E833846012 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/99863] [10/11 Regression] wrong code with -O -fno-tree-forwprop -mno-sse2 since r10-7268-g529ea7d9596b26ba Date: Thu, 01 Apr 2021 12:26:41 +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: 11.0 X-Bugzilla-Keywords: needs-bisection, 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: 10.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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: Thu, 01 Apr 2021 12:26:41 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99863 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #10 from Jakub Jelinek --- I think the REG_DEAD note isn't the problem here. At least, when I dump bb 2 in rest_of_handle_dse right before df_analyze ca= ll, there is (insn 6 3 7 2 (set (reg:CCZ 17 flags) (compare:CCZ (reg/v:DI 203 [ y ]) (const_int 0 [0]))) "pr99863.c":14:12 8 {*cmpdi_ccno_1} (nil)) (insn 7 6 8 2 (set (reg:QI 205) (eq:QI (reg:CCZ 17 flags) (const_int 0 [0]))) "pr99863.c":14:12 802 {*setcc_qi} (expr_list:REG_DEAD (reg:CCZ 17 flags) (nil))) ... (insn 40 38 41 2 (set (reg:QI 220) (ne:QI (reg:CCZ 17 flags) (const_int 0 [0]))) "pr99863.c":15:11 802 {*setcc_qi} (expr_list:REG_DEAD (reg:CCZ 17 flags) (nil))) but if I dump it right after df_analyze call, I see: (insn 6 3 7 2 (set (reg:CCZ 17 flags) (compare:CCZ (reg/v:DI 203 [ y ]) (const_int 0 [0]))) "pr99863.c":14:12 8 {*cmpdi_ccno_1} (expr_list:REG_DEAD (reg/v:DI 203 [ y ]) (nil))) (insn 7 6 8 2 (set (reg:QI 205) (eq:QI (reg:CCZ 17 flags) (const_int 0 [0]))) "pr99863.c":14:12 802 {*setcc_qi} (nil)) ... (insn 40 38 41 2 (set (reg:QI 220) (ne:QI (reg:CCZ 17 flags) (const_int 0 [0]))) "pr99863.c":15:11 802 {*setcc_qi} (expr_list:REG_DEAD (reg:CCZ 17 flags) (nil))) i.e. the problematic REG_DEAD note is gone and I think at this point DF kno= ws that CC is live there. But replace_read has code to check for live hard regs, see note_stores (this_insn, look_for_hardregs, regs_set); in there etc.=