On Thu, Dec 14, 2017 at 09:55:30AM -0200, Alexandre Oliva wrote: > for gcc/ChangeLog > > PR bootstrap/83396 > * config/arc/arc.c (hwloop_optimize): Skip debug insns. > * config/sh/sh-protos.h (sh_find_set_of_reg): Adjust. > * config/sh/sh.c: Skip debug insns besides notes. > * config/sh/sh.md: Likewise. > * config/sh/sh_treg_combine.cc: Likewise. > * config/sh/sync.md: Likewise.
Please fix up formatting. Otherwise LGTM. > --- a/gcc/config/sh/sh-protos.h > +++ b/gcc/config/sh/sh-protos.h > @@ -122,7 +122,7 @@ struct set_of_reg > > /* Given a reg rtx and a start insn, try to find the insn that sets the > specified reg by using the specified insn stepping function, such as > - 'prev_nonnote_insn_bb'. When the insn is found, try to extract the rtx > + 'prev_nonnote_nondebug_insn_bb'. When the insn is found, try to extract > the rtx Too long line. > of the reg set. */ > template <typename F> inline set_of_reg > sh_find_set_of_reg (rtx reg, rtx_insn* insn, F stepfunc, > diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c > index 0d7d7bc53ca2..3776415f1589 100644 > --- a/gcc/config/sh/sh.c > +++ b/gcc/config/sh/sh.c > @@ -11897,7 +11897,7 @@ sh_is_logical_t_store_expr (rtx op, rtx_insn* insn) > else > { > set_of_reg op_set = sh_find_set_of_reg (ops[i], insn, > - prev_nonnote_insn_bb); > + > prev_nonnote_nondebug_insn_bb); Likewise. Just do: - set_of_reg op_set = sh_find_set_of_reg (ops[i], insn, - prev_nonnote_insn_bb); + set_of_reg op_set + = sh_find_set_of_reg (ops[i], insn, prev_nonnote_nondebug_insn_bb); > @@ -11929,7 +11929,7 @@ sh_try_omit_signzero_extend (rtx extended_op, > rtx_insn* insn) > if (GET_MODE (extended_op) != SImode) > return NULL_RTX; > > - set_of_reg s = sh_find_set_of_reg (extended_op, insn, > prev_nonnote_insn_bb); > + set_of_reg s = sh_find_set_of_reg (extended_op, insn, > prev_nonnote_nondebug_insn_bb); Likewise. > if (s.set_src == NULL_RTX) > return NULL_RTX; > > @@ -11966,9 +11966,9 @@ sh_split_movrt_negc_to_movt_xor (rtx_insn* curr_insn, > rtx operands[]) > return false; > > set_of_reg t_before_negc = sh_find_set_of_reg (get_t_reg_rtx (), curr_insn, > - prev_nonnote_insn_bb); > + prev_nonnote_nondebug_insn_bb); > set_of_reg t_after_negc = sh_find_set_of_reg (get_t_reg_rtx (), curr_insn, > - next_nonnote_insn_bb); > + next_nonnote_nondebug_insn_bb); 2x further. > > if (t_before_negc.set_rtx != NULL_RTX && t_after_negc.set_rtx != NULL_RTX > && rtx_equal_p (t_before_negc.set_rtx, t_after_negc.set_rtx) > @@ -12010,7 +12010,7 @@ sh_find_extending_set_of_reg (rtx reg, rtx_insn* > curr_insn) > cases, where a zero_extend is followed an (implicit) sign_extend, and it > fails to see the sign_extend. */ > sh_extending_set_of_reg result = > - sh_find_set_of_reg (reg, curr_insn, prev_nonnote_insn_bb, true); > + sh_find_set_of_reg (reg, curr_insn, prev_nonnote_nondebug_insn_bb, > true); Likewise. > @@ -3106,7 +3106,7 @@ > if (GET_CODE (pat) == SET > && t_reg_operand (XEXP (pat, 0), SImode) > && negt_reg_operand (XEXP (pat, 1), SImode)) > - prev_set_t_insn = prev_nonnote_insn_bb (prev_set_t_insn); > + prev_set_t_insn = prev_nonnote_nondebug_insn_bb (prev_set_t_insn); Likewise. > @@ -3206,7 +3206,7 @@ > if (GET_CODE (pat) == SET > && t_reg_operand (XEXP (pat, 0), SImode) > && negt_reg_operand (XEXP (pat, 1), SImode)) > - prev_set_t_insn = prev_nonnote_insn_bb (prev_set_t_insn); > + prev_set_t_insn = prev_nonnote_nondebug_insn_bb (prev_set_t_insn); Likewise. > @@ -750,7 +750,7 @@ sh_treg_combine::record_set_of_reg (rtx reg, rtx_insn > *start_insn, > log_msg ("tracing ccreg\n"); > new_entry.setcc = > find_set_of_reg_bb (m_ccreg, > - prev_nonnote_insn_bb (new_entry.cstore.insn)); > + prev_nonnote_nondebug_insn_bb > (new_entry.cstore.insn)); Likewise. + = shouldn't be at the end of line. I'm afraid best will be to use a temporary here. > > // If cstore was found but setcc was not found continue anyway, as > // for some of the optimization types the setcc is irrelevant. > @@ -1353,7 +1353,7 @@ sh_treg_combine::try_optimize_cbranch (rtx_insn *insn) > // (set (reg ccreg) (eq (reg) (const_int 0))) > // The testing insn could also be outside of the current basic block, but > // for now we limit the search to the current basic block. > - trace.setcc = find_set_of_reg_bb (m_ccreg, prev_nonnote_insn_bb (insn)); > + trace.setcc = find_set_of_reg_bb (m_ccreg, prev_nonnote_nondebug_insn_bb > (insn)); Likewise. > > if (trace.setcc.set_src () == NULL_RTX) > log_return_void ("could not find set of ccreg in current BB\n"); > @@ -1413,7 +1413,7 @@ sh_treg_combine::try_optimize_cbranch (rtx_insn *insn) > trace.bb_entries.push_front (bb_entry (trace.bb ())); > > record_return_t res = > - record_set_of_reg (trace_reg, prev_nonnote_insn_bb (trace.setcc.insn), > + record_set_of_reg (trace_reg, prev_nonnote_nondebug_insn_bb > (trace.setcc.insn), Likewise. The indentation and = is wrong. Jakub