This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Perform constant folding of math builtins
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Roger Sayle <roger at eyesopen dot com>
- Cc: Brad Lucier <lucier at math dot purdue dot edu>, <gcc-patches at gcc dot gnu dot org>
- Date: 26 Aug 2002 11:23:22 +0200
- Subject: Re: [PATCH] Perform constant folding of math builtins
- Organization: CodeSourcery, LLC
- References: <Pine.LNX.4.33.0208252114360.27636-100000@www.eyesopen.com>
Roger Sayle <roger@eyesopen.com> writes:
| I agree that potentially real errors such as sqrt(-1)*sqrt(-1) could
| be masked, but if not by "-funsafe-math-optimizations" we'd need another
| flag for "unsafe" math optimizations.
I think -funsafe-math-optimizations is a good flag to apply that
transformation.
[...]
| log(exp(x)) = x should be safe even in the presence of NaNs, signed
| infinities and signed zeros, so could be enabled by default unless
| "-fsignaling-nans" is specified by the user.
Yes, that transformation is always valid for non trapping values.
-- Gaby