[Bug tree-optimization/57994] Constant folding of infinity

paolo.carlini at oracle dot com gcc-bugzilla@gcc.gnu.org
Thu Oct 24 12:35:00 GMT 2013


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

--- Comment #17 from Paolo Carlini <paolo.carlini at oracle dot com> ---
If I play with some constexprs, I understand that, irrespective of the command
line switches, we never fold to a constant the log. However, only for
-fno-math-errno -funsafe-math-optimizations the library call returns -nan,
instead of 0. Ok..

For the log, the check at the beginning of do_mpfr_arg1:

      if (!real_isnan (ra)
      && (!min || real_compare (inclusive ? GE_EXPR: GT_EXPR , ra, min))
      && (!max || real_compare (inclusive ? LE_EXPR: LT_EXPR , ra, max)))

is false, because real_compare (inclusive ? GE_EXPR: GT_EXPR , ra, min) is
false. It seems we never fold log(0).



More information about the Gcc-bugs mailing list