[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign
hubicka at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Sun Feb 22 18:47:00 GMT 2009
------- Comment #29 from hubicka at gcc dot gnu dot org 2009-02-22 18:46 -------
I mean aligned(64).
I guess something like this then?
Index: config/i386/i386.c
===================================================================
--- config/i386/i386.c (revision 144373)
+++ config/i386/i386.c (working copy)
@@ -19351,6 +19351,12 @@ unsigned int
ix86_local_alignment (tree type, enum machine_mode mode,
unsigned int align)
{
+ /* We don't want to align DImode to 64bit for compilation with
+ -mpreferred-stack-boundary=2 to not enforce dynamic stack alignment
+ prologue. */
+ if (mode == DImode && !TARGET_64BIT && ix86_preferred_stack_boundary < 64)
+ align = 32;
+
/* If TYPE is NULL, we are allocating a stack slot for caller-save
register in MODE. We will return the largest alignment of XF
and DF. */
@@ -19360,6 +19366,12 @@ ix86_local_alignment (tree type, enum ma
align = GET_MODE_ALIGNMENT (DFmode);
return align;
}
+ if (!TARGET_64BIT
+ && align == 64
+ && ix86_preferred_stack_boundary < 64
+ && (mode == DImode || (type && TYPE_MODE (type) == DImode))
+ && (!type || !TYPE_USER_ALIGN (type)))
+ align = 32;
/* x86-64 ABI requires arrays greater than 16 bytes to be aligned
to 16byte boundary. */
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39137
More information about the Gcc-bugs
mailing list