------- Comment #37 from jakub at gcc dot gnu dot org 2009-03-11 16:26 -------
Created an attachment (id=17440)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17440&action=view)
gcc44-pr39137.patch
Patch I'm going to bootstrap/regtest now. I've re-added the TYPE_USER_ALIGN
check, because it fixes the f3 function in:
/* { dg-options "-Os -m32 -mpreferred-stack-boundary=2" } */
void fn (void *);
void f1 (void)
{
unsigned long long a;
fn (&a);
}
void f2 (void)
{
unsigned long long a __attribute__((aligned (8)));
fn (&a);
}
void f3 (void)
{
typedef unsigned long long L __attribute__((aligned (8)));
L a;
fn (&a);
}
void f4 (void)
{
unsigned long long a __attribute__((aligned (16)));
fn (&a);
}
void f5 (void)
{
typedef unsigned long long L __attribute__((aligned (16)));
L a;
fn (&a);
}
To cure even f2, we'd have to invent a new macro (LOCAL_DATA_ALIGNMENT), which
would be passed the DECL instead of type (in i386 case both could just call
ix86_local_alignment and if the first argument is non-NULL, if could just use
DECL_P vs. TYPE_P to find out if it is a decl or type).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39137