GCC converts calls such as (float)exp((double)f), where f is a float, into
calls to the corresponding mathematical functions for float, such as expf.

However, if the result overflows the range of float but not that of double, the
conversion is unsafe with -fmath-errno (on by default on most targets): errno
may be set by the call to the float function but not by the call to the double
function, so the compiler may be wrongly causing errno to be set for such
arguments.

This problem applies to all of the functions where the result for some float
argument overflows the range of float but not double.

(This is a regression from the compiler versions without this optimization.)


-- 
           Summary: [4.1/4.2/4.3 Regression] exp->expf transformation
                    incorrect with -fmath-errno
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jsm28 at gcc dot gnu dot org


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

Reply via email to