This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Perform constant folding of math builtins


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]