struct qty_table_elem *ent;
struct reg_eqv_elem *eqv;
- if (next_qty >= max_qty)
- abort ();
+ gcc_assert (next_qty < max_qty);
q = REG_QTY (reg) = next_qty++;
ent = &qty_table[q];
ent = &qty_table[q];
/* Nothing should become eqv until it has a "non-invalid" qty number. */
- if (! REGNO_QTY_VALID_P (old))
- abort ();
+ gcc_assert (REGNO_QTY_VALID_P (old));
REG_QTY (new) = q;
firstr = ent->first_reg;
/* If X is a register and we haven't made a quantity for it,
something is wrong. */
- if (REG_P (x) && ! REGNO_QTY_VALID_P (REGNO (x)))
- abort ();
+ gcc_assert (!REG_P (x) || REGNO_QTY_VALID_P (REGNO (x)));
/* If X is a hard register, show it is being put in the table. */
if (REG_P (x) && REGNO (x) < FIRST_PSEUDO_REGISTER)
return;
default:
- abort ();
+ gcc_unreachable ();
}
}
\f
fmt = GET_RTX_FORMAT (code);
for (; i >= 0; i--)
{
- if (fmt[i] == 'e')
+ switch (fmt[i])
{
+ case 'e':
/* If we are about to do the last recursive call
needed at this level, change it into iteration.
This function is called enough to be worth it. */
hash += hash_rtx (XEXP (x, i), 0, do_not_record_p,
hash_arg_in_memory_p, have_reg_qty);
- }
+ break;
- else if (fmt[i] == 'E')
- for (j = 0; j < XVECLEN (x, i); j++)
- {
+ case 'E':
+ for (j = 0; j < XVECLEN (x, i); j++)
hash += hash_rtx (XVECEXP (x, i, j), 0, do_not_record_p,
hash_arg_in_memory_p, have_reg_qty);
- }
+ break;
- else if (fmt[i] == 's')
- hash += hash_rtx_string (XSTR (x, i));
- else if (fmt[i] == 'i')
- hash += (unsigned int) XINT (x, i);
- else if (fmt[i] == '0' || fmt[i] == 't')
- /* Unused. */
- ;
- else
- abort ();
+ case 's':
+ hash += hash_rtx_string (XSTR (x, i));
+ break;
+
+ case 'i':
+ hash += (unsigned int) XINT (x, i);
+ break;
+
+ case '0': case 't':
+ /* Unused. */
+ break;
+
+ default:
+ gcc_unreachable ();
+ }
}
return hash;
break;
default:
- abort ();
+ gcc_unreachable ();
}
}
new = simplify_unary_operation (code, mode,
const_arg0 ? const_arg0 : folded_arg0,
mode_arg0);
- if (new != 0 && is_const)
+ /* NEG of PLUS could be converted into MINUS, but that causes
+ expressions of the form
+ (CONST (MINUS (CONST_INT) (SYMBOL_REF)))
+ which many ports mistakenly treat as LEGITIMATE_CONSTANT_P.
+ FIXME: those ports should be fixed. */
+ if (new != 0 && is_const
+ && GET_CODE (new) == PLUS
+ && (GET_CODE (XEXP (new, 0)) == SYMBOL_REF
+ || GET_CODE (XEXP (new, 0)) == LABEL_REF)
+ && GET_CODE (XEXP (new, 1)) == CONST_INT)
new = gen_rtx_CONST (mode, new);
}
break;
|| (GET_CODE (trial) == LABEL_REF
&& ! condjump_p (insn))))
{
+ /* Don't substitute non-local labels, this confuses CFG. */
+ if (GET_CODE (trial) == LABEL_REF
+ && LABEL_REF_NONLOCAL_P (trial))
+ continue;
+
SET_SRC (sets[i].rtl) = trial;
cse_jumps_altered = 1;
break;
/* If this SET is now setting PC to a label, we know it used to
be a conditional or computed branch. */
- else if (dest == pc_rtx && GET_CODE (src) == LABEL_REF)
+ else if (dest == pc_rtx && GET_CODE (src) == LABEL_REF
+ && !LABEL_REF_NONLOCAL_P (src))
{
/* Now emit a BARRIER after the unconditional jump. */
if (NEXT_INSN (insn) == 0
}
}
- if (next_qty > max_qty)
- abort ();
+ gcc_assert (next_qty <= max_qty);
free (qty_table + max_reg);
return;
case INSN_LIST:
- abort ();
+ gcc_unreachable ();
default:
break;
rtx last_insns[2];
unsigned int i;
rtx newreg;
+ edge_iterator ei;
/* We expect to have two successors. Look at both before picking
the final mode for the comparison. If we have more successors
found_equiv = false;
mode = GET_MODE (cc_src);
insn_count = 0;
- for (e = bb->succ; e; e = e->succ_next)
+ FOR_EACH_EDGE (e, ei, bb->succs)
{
rtx insn;
rtx end;
if (e->flags & EDGE_COMPLEX)
continue;
- if (! e->dest->pred
- || e->dest->pred->pred_next
+ if (EDGE_COUNT (e->dest->preds) != 1
|| e->dest == EXIT_BLOCK_PTR)
continue;
if (mode != comp_mode)
{
- if (! can_change_mode)
- abort ();
+ gcc_assert (can_change_mode);
mode = comp_mode;
PUT_MODE (cc_src, mode);
}
submode = cse_cc_succs (e->dest, cc_reg, cc_src, false);
if (submode != VOIDmode)
{
- if (submode != mode)
- abort ();
+ gcc_assert (submode == mode);
found_equiv = true;
can_change_mode = false;
}
mode = cse_cc_succs (bb, cc_reg, cc_src, true);
if (mode != VOIDmode)
{
- if (mode != GET_MODE (cc_src))
- abort ();
+ gcc_assert (mode == GET_MODE (cc_src));
if (mode != orig_mode)
{
rtx newreg = gen_rtx_REG (mode, REGNO (cc_reg));