[Bug middle-end/116135] __builtin_mul_overflow inefficient for _BitInt(31) (with widening multiply)
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Jul 29 22:36:51 GMT 2024
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116135
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Similarly for:
```
int f1(unsigned _BitInt(9) x, unsigned _BitInt(9) y, unsigned _BitInt(9) * res)
{
return __builtin_mul_overflow(x, y, res);
}
int f2(unsigned _BitInt(9) x, unsigned _BitInt(9) y, unsigned _BitInt(9) * res)
{
unsigned int xx = x;
unsigned int yy = y;
unsigned int t = xx * yy;
*res = t;
return (t >> (9)) != 0;
}
```
More information about the Gcc-bugs
mailing list