Commit 20ec31d3 by Joern Rennecke

(output_stack_adjust): When splitting an adjustment into two parts,

make sure the stack is aligned at all times.

From-SVN: r13846
parent 74452ac3
...@@ -2490,11 +2490,15 @@ output_stack_adjust (size, reg, temp) ...@@ -2490,11 +2490,15 @@ output_stack_adjust (size, reg, temp)
if (! CONST_OK_FOR_I (size)) if (! CONST_OK_FOR_I (size))
{ {
if (CONST_OK_FOR_I (size / 2) && CONST_OK_FOR_I (size - size / 2)) /* Try to do it with two partial adjustments; however, must make
sure that the stack is properly aligned at all times, in case
an interrupt occurs between the two partial adjustments. */
if (CONST_OK_FOR_I (size / 2 & -4)
&& CONST_OK_FOR_I (size - (size / 2 & -4)))
{ {
val = GEN_INT (size / 2); val = GEN_INT (size / 2 & -4);
emit_insn (gen_addsi3 (reg, reg, val)); emit_insn (gen_addsi3 (reg, reg, val));
val = GEN_INT (size - size / 2); val = GEN_INT (size - (size / 2 & -4));
} }
else else
{ {
......
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