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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c++                         |rtl-optimization
            Version|unknown                     |8.2.1

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
GIMPLE at -O1 looks OK-ish - release on all paths:

main ()
{
  struct allocator D.41475;
  struct _Sp_make_shared_tag D.41474;
  struct shared_ptr tg;
  struct _Sp_counted_base * _5;
  struct _Sp_counted_base * _16;
  _Atomic_word * _17;
  int _18;
  int _19;

  <bb 2> [local count: 1073741825]:
  std::__shared_ptr<blob,
(__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<blob> > (&tg.D.36194,
D.41474, &D.41475);
  D.41475 ={v} {CLOBBER};
  _16 = MEM[(const struct __shared_count &)&tg + 8]._M_pi;
  if (_16 != 0B)
    goto <bb 3>; [70.00%]
  else
    goto <bb 6>; [30.00%]

  <bb 3> [local count: 751619277]:
  if (__gthrw___pthread_key_create != 0B)
    goto <bb 4>; [53.47%]
  else
    goto <bb 5>; [46.53%]

  <bb 4> [local count: 401890827]:
  _17 = &_16->_M_use_count;
  __atomic_fetch_add_4 (_17, 1, 4);
  goto <bb 9>; [100.00%]

  <bb 5> [local count: 349728449]:
  _18 = MEM[(_Atomic_word *)_16 + 8B];
  _19 = _18 + 1;
  MEM[(_Atomic_word *)_16 + 8B] = _19;
  goto <bb 9>; [100.00%]

  <bb 6> [local count: 1073741824]:
  _5 = MEM[(struct __shared_count *)&tg + 8B]._M_pi;
  if (_5 != 0B)
    goto <bb 7>; [53.47%]
  else
    goto <bb 8>; [46.53%]

  <bb 7> [local count: 574129753]:
  std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (_5);

  <bb 8> [local count: 1073741824]:
  tg ={v} {CLOBBER};
  return 0;

  <bb 9> [local count: 574129754]:
  std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (_16);
  goto <bb 6>; [100.00%]

Reply via email to