http://bugzilla.novell.com/show_bug.cgi?id=582222
http://bugzilla.novell.com/show_bug.cgi?id=582222#c12
--- Comment #12 from Michael Matz 2010-02-24 15:23:21 UTC ---
Thanks, I can reproduce it now, it's a latent kernel problem that is now
exposed with GCC 4.5. It can be demonstrated with such testcase:
struct X {
char c[176];
};
#define __used __attribute__((__used__))
#define __al4 __attribute__((__aligned__(4)))
static struct X x;
static struct X __used __al4 __attribute__((section("x"))) x = { .c[0] = 1 };
Here the object 'x' will have alignment of 8 (in gcc44 or less) or 32 (since
gcc45), despite the aligned(4) attribute. This is because the first seen
declaration doesn't have such attribute. The attributes of all decls of
the same object are merged, and for alignment this means choosing the larger
one (this is correct because there might have been code emitted that only
saw the first decl relying on the larger default alignment).
You either need to remove the first decl, or annotate it with the same
attributes (at least with the aligned attribute).
This wasn't exposed with former GCCs because there the default alignment
was 8 (and as the struct size is 176, which is divisible by 8, align to 8 or 4
doesn't make a difference, but you can see the wrong .align 8 directives also
with gcc44 in the .s file). More recent GCCs align large structs to 32byte
by default.
--
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.