This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/48377] [4.6/4.7 regression] miscompilation at -O3
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 7 Apr 2011 13:16:37 +0000
- Subject: [Bug middle-end/48377] [4.6/4.7 regression] miscompilation at -O3
- Auto-submitted: auto-generated
- References: <bug-48377-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48377
--- Comment #28 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-04-07 13:16:13 UTC ---
I mean a and g are 8 with -m64 -malign-power, but f is 4. If you do:
extern void abort (void);
struct S { long long x; int a; double b[10000]; int c; } s;
double *p = &s.b[0];
int
main ()
{
if (((long) p) & (__alignof__ (*p) - 1))
abort ();
return 0;
}
I believe it will fail with -m64 -malign-power, and here it doesn't help at all
that you check get_object_alignment, because __alignof__ (*p) is still 8,
but
.comm s,80016,8
...
p:
.quad s+12
This isn't the default ABI for powerpc64-linux fortunately, but anyway.
But, the above fails on i?86 too (without non-default -malign-double).
So, we need some target hook that will tell us if ADJUST_FIELD_ALIGN could ever
lower alignment of the type when present in structs...