+2008-03-22 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.c (assign_386_stack_local): Align DImode slots
+ to their natural alignment to avoid store forwarding stalls.
+
2008-03-21 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR target/27946
assign_386_stack_local (enum machine_mode mode, enum ix86_stack_slot n)
{
struct stack_local_entry *s;
+ int align;
gcc_assert (n < MAX_386_STACK_LOCALS);
if (s->mode == mode && s->n == n)
return copy_rtx (s->rtl);
+ /* Align DImode slots to their natural alignment
+ to avoid store forwarding stalls. */
+ if (mode == DImode
+ && (GET_MODE_BITSIZE (mode) > GET_MODE_ALIGNMENT (mode)))
+ align = GET_MODE_BITSIZE (mode);
+ else
+ align = 0;
+
s = (struct stack_local_entry *)
ggc_alloc (sizeof (struct stack_local_entry));
s->n = n;
s->mode = mode;
- s->rtl = assign_stack_local (mode, GET_MODE_SIZE (mode), 0);
+ s->rtl = assign_stack_local (mode, GET_MODE_SIZE (mode), align);
s->next = ix86_stack_locals;
ix86_stack_locals = s;