This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/12105] New: Local Variabels on "Out-of-phase" Alignment on x86
- From: "dfoesch at cs dot nmsu dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Aug 2003 16:06:06 -0000
- Subject: [Bug c/12105] New: Local Variabels on "Out-of-phase" Alignment on x86
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12105
Summary: Local Variabels on "Out-of-phase" Alignment on x86
Product: gcc
Version: 3.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dfoesch at cs dot nmsu dot edu
CC: gcc-bugs at gcc dot gnu dot org
With the following code:
int main(void)
{
int a __attribute__((mode(v4sf))) __attribute__((aligned(16)));
printf("%i %p\n", __alignof__(a), &a);
return 0;
}
I get the following information. The address of a is supposed to be 16-byte
alligned (correct), but the actual address ends in a 4 (hex) which is surely not
16-byte aligned.
If I alter the potential position of the address with the following code:
int main(void)
{
int i;
int a __attribute__((mode(v4sf))) __attribute__((aligned(16)));
printf("%i %p\n", __alignof__(i), &i);
printf("%i %p\n", __alignof__(a), &a);
return 0;
}
I still get that it is supposed to be 16-byte aligned, and I still get an
address which ends in a 4 (hex), just the next 16-byte alligned segment up.
If I compile the first to assembly, a is then stored in -24(%ebp), and changing
it to -28(%ebp) makes the code then work.
But I need a generic solution/workaround, which will compile without assistance,
that will make this work.