Commit c0560887 by Ian Lance Taylor

Copy a CONST_INT rtx in force_const_mem

From-SVN: r13490
parent 8839fca4
...@@ -3407,19 +3407,25 @@ force_const_mem (mode, x) ...@@ -3407,19 +3407,25 @@ force_const_mem (mode, x)
pool_offset &= ~ (align - 1); pool_offset &= ~ (align - 1);
/* If RTL is not being placed into the saveable obstack, make a /* If RTL is not being placed into the saveable obstack, make a
copy of X that is in the saveable obstack in case we are being copy of X that is in the saveable obstack in case we are
called from combine or some other phase that discards memory being called from combine or some other phase that discards
it allocates. We need only do this if it is a CONST, since memory it allocates. We used to only do this if it is a
no other RTX should be allocated in this situation. */ CONST; however, reload can allocate a CONST_INT when
eliminating registers. */
if (rtl_obstack != saveable_obstack if (rtl_obstack != saveable_obstack
&& GET_CODE (x) == CONST) && (GET_CODE (x) == CONST || GET_CODE (x) == CONST_INT))
{ {
push_obstacks_nochange (); push_obstacks_nochange ();
rtl_in_saveable_obstack (); rtl_in_saveable_obstack ();
if (GET_CODE (x) == CONST)
x = gen_rtx (CONST, GET_MODE (x), x = gen_rtx (CONST, GET_MODE (x),
gen_rtx (PLUS, GET_MODE (x), gen_rtx (PLUS, GET_MODE (x),
XEXP (XEXP (x, 0), 0), XEXP (XEXP (x, 0), 1))); XEXP (XEXP (x, 0), 0),
XEXP (XEXP (x, 0), 1)));
else
x = GEN_INT (INTVAL (x));
pop_obstacks (); pop_obstacks ();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment