This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/70690] [6/7 Regression] r235002 miscompiles tcmalloc


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();
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]