[Bug middle-end/54167] New: excessive alignment
drepper.fsp at gmail dot com
gcc-bugzilla@gcc.gnu.org
Fri Aug 3 15:03:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54167
Bug #: 54167
Summary: excessive alignment
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: middle-end
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: drepper.fsp@gmail.com
Compile the following code:
struct c
{
int a, b;
/*constexpr*/ c() : a(1), b(2) { }
};
c v;
The variable v will be defined with:
.bss
.align 16
.type v, @object
.size v, 8
v:
.zero 8
The variable has alignment 16!
If you uncomment the constexpr and compile with -std=gnu++11 it can be seen
that the compiler does know what the correct alignment is:
.globl v
.data
.align 4
.type v, @object
.size v, 8
v:
.long 1
.long 2
This happens with the current svn version as well as with 4.7.0.
More information about the Gcc-bugs
mailing list