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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
         Depends on|                            |61810
          Component|c++                         |tree-optimization

--- Comment #1 from Drea Pinski <pinskia at gcc dot gnu.org> ---
Note C++26 changes this to zero initialized anyways.


Before eSRA:
```
int caller ()
{
  int D.2716;
  struct S s;
  struct S D.2686;
  int _2;

  <bb 2> :
  s = D.2686;
  foo (&s.a);
```

After:
```

  <bb 2> :
  MEM <int> [(struct S *)&s] = SR.2_10(D);
  MEM <int> [(struct S *)&s + 4B] = SR.3_5(D);
  MEM <int> [(struct S *)&s + 8B] = SR.4_12(D);
  MEM <int> [(struct S *)&s + 12B] = SR.5_14(D);
  MEM <int> [(struct S *)&s + 16B] = SR.6_16(D);
  foo (&s.a);
```

I am not 100% sure but I think this is correct.  And then things are
initialized via init-regs.cc code on the rtl.


I have looked into removing stores that are done from uninitialized default
variables but I didn't get it working ...


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61810
[Bug 61810] init-regs.c papers over issues elsewhere

Reply via email to