register rtx x;
{
if (GET_CODE (x) == MEM
- || (CONSTANT_P (x) && LEGITIMATE_CONSTANT_P (x)
+ || (CONSTANT_P (x) && CONSTANT_ADDRESS_P (x)
&& GET_MODE (x) != VOIDmode))
{
register rtx temp = force_reg (GET_MODE (x), x);
/* By passing constant addresses thru registers
we get a chance to cse them. */
- if (! cse_not_expected && CONSTANT_P (x) && LEGITIMATE_CONSTANT_P (x))
+ if (! cse_not_expected && CONSTANT_P (x) && CONSTANT_ADDRESS_P (x))
return force_reg (Pmode, x);
/* Accept a QUEUED that refers to a REG
abort ();
}
- if (sa != 0)
- sa = validize_mem (sa);
-
if (after)
{
rtx seq;
start_sequence ();
+ /* We must validize inside the sequence, to ensure that any instructions
+ created by the validize call also get moved to the right place. */
+ if (sa != 0)
+ sa = validize_mem (sa);
emit_insn (fcn (sa, stack_pointer_rtx));
seq = gen_sequence ();
end_sequence ();
emit_insn_after (seq, after);
}
else
- emit_insn (fcn (sa, stack_pointer_rtx));
+ {
+ if (sa != 0)
+ sa = validize_mem (sa);
+ emit_insn (fcn (sa, stack_pointer_rtx));
+ }
}
/* Restore the stack pointer for the purpose in SAVE_LEVEL. SA is the save
{
return LIBCALL_VALUE (mode);
}
+
+/* Look up the tree code for a given rtx code
+ to provide the arithmetic operation for REAL_ARITHMETIC.
+ The function returns an int because the caller may not know
+ what `enum tree_code' means. */
+
+int
+rtx_to_tree_code (code)
+ enum rtx_code code;
+{
+ enum tree_code tcode;
+
+ switch (code)
+ {
+ case PLUS:
+ tcode = PLUS_EXPR;
+ break;
+ case MINUS:
+ tcode = MINUS_EXPR;
+ break;
+ case MULT:
+ tcode = MULT_EXPR;
+ break;
+ case DIV:
+ tcode = RDIV_EXPR;
+ break;
+ case SMIN:
+ tcode = MIN_EXPR;
+ break;
+ case SMAX:
+ tcode = MAX_EXPR;
+ break;
+ default:
+ tcode = LAST_AND_UNUSED_TREE_CODE;
+ break;
+ }
+ return ((int) tcode);
+}