This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign
- From: "hjl dot tools at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Feb 2009 15:38:26 -0000
- Subject: [Bug target/39137] [4.4 Regression] -mpreferred-stack-boundary=2 causes lots of dynamic realign
- References: <bug-39137-87@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #28 from hjl dot tools at gmail dot com 2009-02-21 15:38 -------
(In reply to comment #26)
> I had somehting along this lines in mind:
> Index: config/i386/i386.c
> ===================================================================
> *** config/i386/i386.c (revision 144352)
> --- config/i386/i386.c (working copy)
> *************** unsigned int
> *** 19332,19337 ****
> --- 19332,19343 ----
> 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. */
>
Will it work with
---
void foo (unsigned long long *);
void
bar (void)
{
unsigned long long l __attribute__ ((aligned(32)));
foo (&l);
}
---
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39137