This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/70690] [6/7 Regression] r235002 miscompiles tcmalloc
- From: "jason at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 18 Apr 2016 18:25:09 +0000
- Subject: [Bug c++/70690] [6/7 Regression] r235002 miscompiles tcmalloc
- Auto-submitted: auto-generated
- References: <bug-70690-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70690
--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> ---
GCC bug: we're clearing 'cache' during its dynamic initialization even though
default-initialization should have no effect.
struct A {
A() {}
};
struct APadded : public A {
char pad[63];
};
int f();
int i = f();
APadded cache[50];
APadded *p = cache;
int f()
{
cache[0].pad[0] = 42;
return 1;
}
int main()
{
if (cache[0].pad[0] != 42)
__builtin_abort();
}