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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|pinskia at gcc dot gnu.org         |unassigned at gcc dot 
gnu.org
             Status|ASSIGNED                    |NEW
                 CC|                            |hubicka at gcc dot gnu.org

--- Comment #10 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I suspect if we fix this, it will fix a lot more of the "Invalid sum"s that
show up.
I think we need to prop the costs on both sides for the successor until we end
up in the same bb but how to handle loops. I don't know.


Also vect produces some odd code which it could prove as false:

We have:
```
  _28 = (unsigned int) end_11(D);
  _27 = (unsigned int) start_9(D);
  _26 = _28 - _27;
  _25 = _26 + 4294967295;
  _24 = _25 > 2;
  if (_24 != 0)

````
And:
```
  _63 = (unsigned int) end_11(D);
  _64 = (unsigned int) start_9(D);
  _65 = _63 - _64;
  _66 = _65 + 4294967295;
  if (_66 <= 2)
```

This is how fre4 is able to figure out `_66 <= 2` is false.




Honza,
  So the problem is when we have say `if (a) goto b[75%]; else goto c[25%];`
and there are a lot of blocks between the common parts until sucessors of b and
sucessors of c meet. and we have found that a is either true or false. There
seems like we have no way to update the counts on those 2 pathes.
Which is why we end up with "Invalid sum" in this case.

Reply via email to