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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[13/14 regression] Bogus    |[13/14/15/16 regression]
                   |`maybe-uninitialized` on    |Bogus `maybe-uninitialized`
                   |std::variant with           |on std::variant with
                   |std::string with -O3        |std::string with -O3
   Last reconfirmed|                            |2025-12-19
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
There is a missed optimization too:
```
  # .MEM_9 = VDEF <.MEM_8>
  MEM[(struct _Variant_storage *)&D.45542]._M_index = 0;
  # VUSE <.MEM_9>
  _14 = vec_2(D)->D.43881._M_impl.D.43192._M_finish;
  # VUSE <.MEM_9>
  _15 = vec_2(D)->D.43881._M_impl.D.43192._M_end_of_storage;
  if (_14 != _15)
    goto <bb 3>; [70.00%]
  else
    goto <bb 15>; [30.00%]

  <bb 3> [local count: 751619280]:
  # .MEM_48 = VDEF <.MEM_9>
  *_14 ={v} {CLOBBER(bob)};
  _16 = &MEM[(struct _Copy_assign_base *)_14].D.44801;
  # .MEM_49 = VDEF <.MEM_48>
  MEM[(struct _Variant_storage *)_14]._M_index = 255;
  # .MEM_50 = VDEF <.MEM_49>
  D.53625.__this = _16;
  # VUSE <.MEM_50>
  _24 = D.45542.D.45442.D.45021.D.44936.D.44801.D.44684.D.44585._M_index;
```

_24 can only be 0.

Reply via email to