===================================================================
@@ -1,3 +1,8 @@
+2013-03-15 Vladimir Makarov <vmakarov@redhat.com>
+
+ * lra.c (lra): Allign non-empty stack frame.
+ * lra-spills.c (lra_spill): Allign stack after spilling pseudos.
+
2013-03-08 Vladimir Makarov <vmakarov@redhat.com>
* lra-constraints.c (process_alt_operands): Don't penalize
===================================================================
@@ -548,6 +548,11 @@ lra_spill (void)
for (i = 0; i < n; i++)
if (pseudo_slots[pseudo_regnos[i]].mem == NULL_RTX)
assign_mem_slot (pseudo_regnos[i]);
+ if (n > 0 && crtl->stack_alignment_needed)
+ /* If we have a stack frame, we must align it now. The stack size
+ may be a part of the offset computation for register
+ elimination. */
+ assign_stack_local (BLKmode, 0, crtl->stack_alignment_needed);
if (lra_dump_file != NULL)
{
for (i = 0; i < slots_num; i++)
===================================================================
@@ -2272,6 +2272,11 @@ lra (FILE *f)
bitmap_initialize (&lra_split_regs, ®_obstack);
bitmap_initialize (&lra_optional_reload_pseudos, ®_obstack);
live_p = false;
+ if (get_frame_size () != 0 && crtl->stack_alignment_needed)
+ /* If we have a stack frame, we must align it now. The stack size
+ may be a part of the offset computation for register
+ elimination. */
+ assign_stack_local (BLKmode, 0, crtl->stack_alignment_needed);
for (;;)
{
for (;;)