http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60554

--- Comment #1 from Luchezar Belev <l_belev at yahoo dot com> ---
since all (x^0x80000000), (x+0x80000000) and (x-0x80000000) are equivalend in
this case, if GCC had used the subtraction (instead of the addition) it could
optimize the code even further by considering the fact that intermediate result
is not needed and use cmpl instead of subl:

_is_float_negative:
   cmpl $0x80000000, 4(%esp)
   setg %al
   movzbl %al, %eax
   ret

which is the same as if the function was written as
 int is_float_negative(int x) { return (unsigned)x > 0x80000000; }

Reply via email to