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

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
So the difference between func3 and func4 is the following:

func3 does:
```
  D.2811 = 1;
  _4 = num;
  _7 = D.2811;
  if (_4 < _7)
```

While func4 does:
```
  D.2821 = 1;
  _4 = D.2821;
  _7 = num;
  if (_4 < _7)
```

func3 will reduce to `num < 1` which itself is just `num != 0` and then we get
`num != 0 ? 1 : num` and that reduces `num != 0 ? 1 : 0` which then reduces to
just `num != 0`
While for func4 we get:
`num > 1` and `num > 1 ? num : 1` which reduces down to just `min<num, 1>` and
GCC does not reduce that further to `num != 0` and that is what PR 104296  is
about.

Reply via email to