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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2024-04-22
     Ever confirmed|0                           |1
          Component|rtl-optimization            |tree-optimization

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
  tr = {};
  tr.f1 = 1;
  tr.f3 = 3;
  foo (&tr);

We are able to do DSE for tr.f0 and tr.f2 but not the original tr = {}.


Note there is some slightly difference IR from the front-ends (C does not
produce the `= {};` part while C++ does)

C++ front-end (before gimplification):
  <<cleanup_point   struct thresh_restart tr = {.f1=1, .f2=2, .f3=3};>>;
  <<cleanup_point <<< Unknown tree: expr_stmt
    tr.f0 = b >>>>>;

C front-end:
    struct thresh_restart tr = {.f0=b, .f1=1, .f2=2, .f3=3};

Note this is the DECL_EXPR here.

Reply via email to