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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|runtime Segmentation fault  |[12/13/14 Regression]
                   |with '-O3                   |runtime Segmentation fault
                   |-fno-code-hoisting          |with '-O3
                   |-fno-early-inlining         |-fno-code-hoisting
                   |-fno-tree-fre               |-fno-early-inlining
                   |-fno-tree-loop-optimize     |-fno-tree-fre
                   |-fno-tree-pre'              |-fno-tree-loop-optimize
                   |                            |-fno-tree-pre'
   Target Milestone|---                         |12.4
             Status|UNCONFIRMED                 |NEW
                 CC|                            |marxin at gcc dot gnu.org
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2023-10-19
          Component|middle-end                  |ipa

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.
It is the inliner which messes up and introduces the store to a const variable.
We go from:
```
int main ()
{
  <bb 2> [local count: 1073741824]:
  h (c);
  return 0;

}


void h (const struct a i)
{
  const short int i$b;
  int _1;

  <bb 2> [local count: 1073741824]:
  i$b_5 = i.b;
  i.b = i$b_5;
```

To:
```
int main ()
{
  int D.2031;
  const short int i$b;
  int _4;
  int _6;

  <bb 2> [local count: 1073741824]:
  i$b_3 = 0;
  c.b = i$b_3;
```

Which is totally wrong.

Reply via email to