[Bug c++/65945] C++ alignment of nullptr_t is 1 and might cause unaligned stores to the frame
foom at fuhm dot net
gcc-bugzilla@gcc.gnu.org
Fri May 22 18:20:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65945
James Y Knight <foom at fuhm dot net> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |foom at fuhm dot net
--- Comment #9 from James Y Knight <foom at fuhm dot net> ---
This also happens on Sparc. A test-case is really easy to make:
int foo(bool&&, decltype(nullptr)&&, bool&&);
void doit() {
foo(false, nullptr, false);
}
save %sp, -104, %sp
stb %g0, [%fp-6]
/* WTF unaligned store */
st %g0, [%fp-5]
stb %g0, [%fp-1]
add %fp, -6, %g3
add %fp, -5, %g2
add %fp, -1, %g1
mov %g3, %o0
mov %g2, %o1
mov %g1, %o2
call _Z3fooObODnS_, 0
nop
return %i7+8
nop
.ident "GCC: (Debian 4.9.2-10) 4.9.2"
This breaks building recent versions of clang on Sparc, because it calls
emplace_back with nullptr, which results in an expression like the above.
More information about the Gcc-bugs
mailing list