When expanding fabs inline, GCC attempts to use a sequence without jumps.  If
that sequence fails, GCC falls back to the equivalent of

if (x >= 0.0)
  return x;
return -x;

This sequence is incorrect for the IEEE floating point value -0.0.

This problem normally does not occur because most architectures have an
instruction to compute fabs or one can perform bit-twiddling, especially for
software floating point emulation.  However, for the cases such as software
floating point emulation of long double, the jump sequence is produced, leading
to wrong results for the corner case.


-- 
           Summary: expand_abs wrong default code for floating point
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dje at gcc dot gnu dot org
 GCC build triplet: *-*-*
  GCC host triplet: *-*-*
GCC target triplet: *-*-*


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

Reply via email to