https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110860
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
Last reconfirmed| |2023-07-31
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed. This code definitely looks questionable:
__guess += max((int)__builtin_log10(__builtin_abs(__v)) / 2,
1);
So in this case, most likely the author of the above code thought __builtin_abs
was type generic rather than takes an integer type.
The reason why I say that is because below we have:
if (!__builtin_signbit(__v))
Most likely __builtin_abs(__v) should be replaced with `(__builtin_signbit(__v)
? -__v : __v)` (which does get optimized to just `ABS_EXPR` internally.