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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |pinskia at gcc dot 
gnu.org
         Depends on|                            |14295

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I have a fix for this but it is part of copy prop for arg patch set.

With that fix we get:
```
int main ()
{
  int i.0_1;
  int _2;
  int i.1_3;

  <bb 2> [local count: 118111600]:
  goto <bb 4>; [100.00%]

  <bb 3> [local count: 955630224]:
  bar31_ ();
  i.0_1 = i;
  _2 = i.0_1 + 1;
  i = _2;

  <bb 4> [local count: 1073741824]:
  i.1_3 = i;
  if (i.1_3 != 0)
    goto <bb 3>; [89.00%]
  else
    goto <bb 5>; [11.00%]

  <bb 5> [local count: 118111600]:
  return 0;

}
```

Basically we can convert:
```
  j = l;
  m = j;
  k = m;
  _4 = k.h.b;
```
into:
```
  j = l;
  m = l;
  k = l;
  _4 = l.h.b;
```
Which is exactly what you need to optimize this without SRA's help for copy
prop.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=14295
[Bug 14295] [tree-ssa] copy propagation for aggregates

Reply via email to