From: Jim Wilson Date: Mon, 1 May 1995 23:43:28 +0000 (-0700) Subject: (combine_instrutions): Set subst_prev_insn to zero. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bcd49eb7a878144a4990385d764e2cbfafc1016a;p=gcc.git (combine_instrutions): Set subst_prev_insn to zero. (try_combine, undo_all): Likewise. (get_last_value): Return zero if subst_prev_insn set. From-SVN: r9559 --- diff --git a/gcc/combine.c b/gcc/combine.c index 827141c2e5f..229479fd145 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -518,6 +518,10 @@ combine_instructions (f, nregs) label_tick = 1; + /* We need to initialize it here, because record_dead_and_set_regs may call + get_last_value. */ + subst_prev_insn = NULL_RTX; + setup_incoming_promotions (); for (insn = f, i = 0; insn; insn = NEXT_INSN (insn)) @@ -2337,6 +2341,10 @@ try_combine (i3, i2, i1) combine_successes++; + /* Clear this here, so that subsequent get_last_value calls are not + affected. */ + subst_prev_insn = NULL_RTX; + if (added_links_insn && (newi2pat == 0 || INSN_CUID (added_links_insn) < INSN_CUID (i2)) && INSN_CUID (added_links_insn) < INSN_CUID (i3)) @@ -2364,6 +2372,10 @@ undo_all () obfree (undobuf.storage); undobuf.num_undo = 0; + + /* Clear this here, so that subsequent get_last_value calls are not + affected. */ + subst_prev_insn = NULL_RTX; } /* Find the innermost point within the rtx at LOC, possibly LOC itself, @@ -9965,10 +9977,15 @@ get_last_value (x) This does not work if there exists an instruction which is temporarily not on the insn chain. */ - if (INSN_CUID (reg_last_set[regno]) >= subst_low_cuid && ! subst_prev_insn) + if (INSN_CUID (reg_last_set[regno]) >= subst_low_cuid) { rtx insn, set; + /* We can not do anything useful in this case, because there is + an instruction which is not on the insn chain. */ + if (subst_prev_insn) + return 0; + /* Skip over USE insns. They are not useful here, and they may have been made by combine, in which case they do not have a INSN_CUID value. We can't use prev_real_insn, because that would incorrectly