[Bug middle-end/113130] `abs(a) == b` could be expanded as `(a == b || a == -b)`
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Dec 29 01:16:43 GMT 2023
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113130
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Oh right but the following testcase it should be valid to do and not worry
about INT_MIN either:
```
int f(int a, unsigned short c)
{
// c = 1;
int b = a > 0 ? a : -a;
return b == c;
}
int f1(int a, unsigned short c)
{
// c = 1;
return a == -c || a == c;
}
```
More information about the Gcc-bugs
mailing list