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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2026-03-05
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=23384
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
We have:
    const int D.4300;
    const int & result;
  <<cleanup_point <<< Unknown tree: expr_stmt
    (void) (result = D.4300 = get (), (const int &) &D.4300) >>>>>;

Which then gimplifies into:

      _1 = .DEFERRED_INIT (4, 3, &"D.4300"[0]);
      D.4300 = _1;
      result = .DEFERRED_INIT (8, 3, &"result"[0]);
      _2 = get ();
      D.4300 = _2;
      result = &D.4300;

And we warn about:
  _1 = .DEFERRED_INIT (4, 3, &"D.4300"[0]);
  D.4300 = _1; // <--- this "store"
  result_6 = .DEFERRED_INIT (8, 3, &"result"[0]);
  _8 = get (); // <--- here


But D.4300 does not escape before the next bb so dse does not remove the store
to D.4300

Reply via email to