[Bug jit/64020] jit misses sin/cos optimizations

joseph at codesourcery dot com gcc-bugzilla@gcc.gnu.org
Mon Nov 24 23:05:00 GMT 2014


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64020

--- Comment #3 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
On Mon, 24 Nov 2014, dmalcolm at gcc dot gnu.org wrote:

> [would it be even better to optimize this to just a sin (2 * theta) ?]

Only with -funsafe-math-optimizations (it's unsafe for large arguments 
where 2 * theta overflows, and that transformation can also lose underflow 
exceptions for small arguments where sin (theta) is in the tiny range but 
sin (2 * theta) isn't).



More information about the Gcc-bugs mailing list