[Bug ipa/67600] [5/6 Regression] Segfault when assigning only one char to ostreambuf_iterator<char> compiled with -O2 or -O3

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Sep 16 11:37:00 GMT 2015


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

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
It must conclude that

  <bb 2>:
  std::basic_ostringstream<char>::basic_ostringstream (&ostr, 16);
  _52 = MEM[(char_type * *)&ostr + 48B];
  _53 = MEM[(char_type * *)&ostr + 56B];
  if (_52 < _53)
    goto <bb 3>;
  else
    goto <bb 4>;

  <bb 3>:
  *_52 = 88;
  _57 = MEM[(char_type * *)&ostr + 48B];
  _58 = _57 + 1;
  MEM[(char_type * *)&ostr + 48B] = _58;
  goto <bb 5>;

  <bb 4>:
  _65 = MEM[(struct basic_streambuf *)&ostr + 8B]._vptr.basic_streambuf;
  _66 = MEM[(int (*__vtbl_ptr_type) () *)_65 + 104B];
  OBJ_TYPE_REF(_66;(struct basic_streambuf)&ostr._M_stringbuf->13)
(&ostr._M_stringbuf, 88);

the call in bb 4 is not possible thus the block gets unreachable.



More information about the Gcc-bugs mailing list