[Bug sanitizer/84340] [8 regression] g++.dg/asan/use-after-scope-types-1.C (and others) fails after r257585

marxin at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Feb 13 09:35:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84340

--- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> ---
There's example of how a check is optimized out:

before the r257585:

__attribute__((noinline))
void test() [with T = bool] ()
{
  bool x;
  struct Ptr ptr;
  bool * _8;

  <bb 2> [100.00%]:
  ASAN_MARK (UNPOISON, &ptr, 8);
  ASAN_MARK (UNPOISON, &x, 1);
  ptr.t = &x;
  ASAN_MARK (POISON, &x, 1);
  _8 = ptr.t;
  *_8 = 0;
  ASAN_MARK (POISON, &ptr, 8);
  return;

}

after:

__attribute__((noinline))
test<bool> ()
{
  bool x;
  struct Ptr ptr;

  <bb 2> :
  ASAN_MARK (UNPOISON, &ptr, 8);
  ASAN_MARK (UNPOISON, &x, 1);
  ptr.t = &x;
  ASAN_MARK (POISON, &x, 1);
  x = 0;
  ASAN_MARK (POISON, &ptr, 8);
  return;

}


More information about the Gcc-bugs mailing list