This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/57994] Constant folding of infinity
- From: "paolo.carlini at oracle dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 24 Oct 2013 12:35:53 +0000
- Subject: [Bug tree-optimization/57994] Constant folding of infinity
- Auto-submitted: auto-generated
- References: <bug-57994-4 at http dot gcc dot gnu dot org/bugzilla/>
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).