Commit 8a723db2 by DJ Delorie Committed by DJ Delorie

function.c (expand_main_function): Make sure stack adjustments happen before sjlj exception setup.

* function.c (expand_main_function): Make sure stack adjustments
happen before sjlj exception setup.

From-SVN: r48316
parent b92b324d
2001-12-26 DJ Delorie <dj@redhat.com>
* function.c (expand_main_function): Make sure stack adjustments
happen before sjlj exception setup.
2001-12-26 David Edelsohn <edelsohn@gnu.org> 2001-12-26 David Edelsohn <edelsohn@gnu.org>
* rs6000.md (indirect_jump): Prefer CTR over LR. * rs6000.md (indirect_jump): Prefer CTR over LR.
......
...@@ -6278,8 +6278,9 @@ expand_main_function () ...@@ -6278,8 +6278,9 @@ expand_main_function ()
if (FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN) if (FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN)
{ {
int align = PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT; int align = PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT;
rtx tmp; rtx tmp, seq;
start_sequence ();
/* Forcibly align the stack. */ /* Forcibly align the stack. */
#ifdef STACK_GROWS_DOWNWARD #ifdef STACK_GROWS_DOWNWARD
tmp = expand_simple_binop (Pmode, AND, stack_pointer_rtx, GEN_INT(-align), tmp = expand_simple_binop (Pmode, AND, stack_pointer_rtx, GEN_INT(-align),
...@@ -6296,6 +6297,16 @@ expand_main_function () ...@@ -6296,6 +6297,16 @@ expand_main_function ()
/* Enlist allocate_dynamic_stack_space to pick up the pieces. */ /* Enlist allocate_dynamic_stack_space to pick up the pieces. */
tmp = force_reg (Pmode, const0_rtx); tmp = force_reg (Pmode, const0_rtx);
allocate_dynamic_stack_space (tmp, NULL_RTX, BIGGEST_ALIGNMENT); allocate_dynamic_stack_space (tmp, NULL_RTX, BIGGEST_ALIGNMENT);
seq = gen_sequence ();
end_sequence ();
for (tmp = get_last_insn (); tmp; tmp = PREV_INSN (tmp))
if (NOTE_P (tmp) && NOTE_LINE_NUMBER (tmp) == NOTE_INSN_FUNCTION_BEG)
break;
if (tmp)
emit_insn_before (seq, tmp);
else
emit_insn (seq);
} }
#endif #endif
......
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