Thank you for the bug report. I've confirmed this with gcc-linaro-4.6-2012.01 on ARM:
asa-san@ursa4:~/bugs/alignment$ ~/bench/cbuild/slaves/ursa4/gcc-linaro-4.6-2012.01/gcc-binary/bin/gcc -c example.c
asa-san@ursa4:~/bugs/alignment$ readelf -t example.o
There are 11 section headers, starting at offset 0x108:
Section Headers:
[Nr] Name
Type Addr Off Size ES Lk Inf Al
Flags
...
[ 4] .rodata
PROGBITS 00000000 000034 000004 00 0 0 4
[00000002]: ALLOC
...
The work-around, as stated in the ticket, is to specify the size of the array.
The fault also exists in a late revisions of FSF trunk (gcc-4.7~svn183205).
The fault does not exist in gcc-linaro-4.5-2012.01.
The fault did not exist in gcc-linaro-4.6-2011.12. Investigation is needed to decide in which revision of gcc-linaro-4.6 the fault was introduced.
I've set it to medium priority for now, since there is a work around.
Thank you for the bug report. I've confirmed this with gcc-linaro- 4.6-2012. 01 on ARM:
asa-san@ ursa4:~ /bugs/alignment $ ~/bench/ cbuild/ slaves/ ursa4/gcc- linaro- 4.6-2012. 01/gcc- binary/ bin/gcc -c example.c ursa4:~ /bugs/alignment $ readelf -t example.o
asa-san@
There are 11 section headers, starting at offset 0x108:
Section Headers:
[Nr] Name
Type Addr Off Size ES Lk Inf Al
Flags
...
[ 4] .rodata
PROGBITS 00000000 000034 000004 00 0 0 4
[00000002]: ALLOC
...
The work-around, as stated in the ticket, is to specify the size of the array.
The fault also exists in a late revisions of FSF trunk (gcc-4. 7~svn183205) . 4.5-2012. 01. 4.6-2011. 12. Investigation is needed to decide in which revision of gcc-linaro-4.6 the fault was introduced.
The fault does not exist in gcc-linaro-
The fault did not exist in gcc-linaro-
I've set it to medium priority for now, since there is a work around.