===================================================================
@@ -134,6 +134,7 @@ extern void add_clobbers (rtx, int);
extern int added_clobbers_hard_reg_p (int);
extern void insn_extract (rtx_insn *);
extern void extract_insn (rtx_insn *);
+extern void extract_constrain_insn (rtx_insn *insn);
extern void extract_constrain_insn_cached (rtx_insn *);
extern void extract_insn_cached (rtx_insn *);
extern void preprocess_constraints (int, int, const char **,
===================================================================
@@ -2110,6 +2110,17 @@ extract_insn_cached (rtx_insn *insn)
recog_data.insn = insn;
}
+/* Do uncached extract_insn, constrain_operands and complain about failures.
+ This should be used when extracting a pre-existing constrained instruction
+ if the caller wants to know which alternative was chosen. */
+void
+extract_constrain_insn (rtx_insn *insn)
+{
+ extract_insn (insn);
+ if (!constrain_operands (reload_completed))
+ fatal_insn_not_found (insn);
+}
+
/* Do cached extract_insn, constrain_operands and complain about failures.
Used by insn_attrtab. */
void
===================================================================
@@ -1919,8 +1919,9 @@ check_rtl (bool final_p)
{
if (final_p)
{
- extract_insn (insn);
- lra_assert (constrain_operands (1));
+#ifdef ENABLED_CHECKING
+ extract_constrain_insn (insn);
+#endif
continue;
}
/* LRA code is based on assumption that all addresses can be
===================================================================
@@ -401,15 +401,11 @@ reload_cse_simplify_operands (rtx_insn *
/* Array of alternatives, sorted in order of decreasing desirability. */
int *alternative_order;
- extract_insn (insn);
+ extract_constrain_insn (insn);
if (recog_data.n_alternatives == 0 || recog_data.n_operands == 0)
return 0;
- /* Figure out which alternative currently matches. */
- if (! constrain_operands (1))
- fatal_insn_not_found (insn);
-
alternative_reject = XALLOCAVEC (int, recog_data.n_alternatives);
alternative_nregs = XALLOCAVEC (int, recog_data.n_alternatives);
alternative_order = XALLOCAVEC (int, recog_data.n_alternatives);
===================================================================
@@ -469,8 +469,7 @@ check_asm_stack_operands (rtx_insn *insn
/* Find out what the constraints require. If no constraint
alternative matches, this asm is malformed. */
- extract_insn (insn);
- constrain_operands (1);
+ extract_constrain_insn (insn);
preprocess_constraints (insn);
@@ -2016,8 +2015,7 @@ subst_asm_stack_regs (rtx_insn *insn, st
/* Find out what the constraints required. If no constraint
alternative matches, that is a compiler bug: we should have caught
such an insn in check_asm_stack_operands. */
- extract_insn (insn);
- constrain_operands (1);
+ extract_constrain_insn (insn);
preprocess_constraints (insn);
const operand_alternative *op_alt = which_op_alt ();
===================================================================
@@ -762,9 +762,7 @@ copyprop_hardreg_forward_1 (basic_block
}
set = single_set (insn);
- extract_insn (insn);
- if (! constrain_operands (1))
- fatal_insn_not_found (insn);
+ extract_constrain_insn (insn);
preprocess_constraints (insn);
const operand_alternative *op_alt = which_op_alt ();
n_ops = recog_data.n_operands;
@@ -865,9 +863,7 @@ copyprop_hardreg_forward_1 (basic_block
}
/* We need to re-extract as validate_change clobbers
recog_data. */
- extract_insn (insn);
- if (! constrain_operands (1))
- fatal_insn_not_found (insn);
+ extract_constrain_insn (insn);
preprocess_constraints (insn);
}
@@ -893,9 +889,7 @@ copyprop_hardreg_forward_1 (basic_block
}
/* We need to re-extract as validate_change clobbers
recog_data. */
- extract_insn (insn);
- if (! constrain_operands (1))
- fatal_insn_not_found (insn);
+ extract_constrain_insn (insn);
preprocess_constraints (insn);
}
}
===================================================================
@@ -1564,9 +1564,7 @@ build_def_use (basic_block bb)
to be marked unrenamable or even cause us to abort the entire
basic block. */
- extract_insn (insn);
- if (! constrain_operands (1))
- fatal_insn_not_found (insn);
+ extract_constrain_insn (insn);
preprocess_constraints (insn);
const operand_alternative *op_alt = which_op_alt ();
n_ops = recog_data.n_operands;
===================================================================
@@ -994,9 +994,7 @@ get_reg_class (rtx_insn *insn)
{
int i, n_ops;
- extract_insn (insn);
- if (! constrain_operands (1))
- fatal_insn_not_found (insn);
+ extract_constrain_insn (insn);
preprocess_constraints (insn);
n_ops = recog_data.n_operands;
===================================================================
@@ -17022,10 +17022,7 @@ note_invalid_constants (rtx_insn *insn,
{
int opno;
- extract_insn (insn);
-
- if (!constrain_operands (1))
- fatal_insn_not_found (insn);
+ extract_constrain_insn (insn);
if (recog_data.n_alternatives == 0)
return;
===================================================================
@@ -406,8 +406,7 @@ (define_special_predicate "execute_opera
if (icode < 0)
return false;
- extract_insn (insn);
- constrain_operands (1);
+ extract_constrain_insn (insn);
return which_alternative >= 0;
})