[Bug middle-end/91709] Missed optimization for multiplication on 1.5 and 1.25

joseph at codesourcery dot com gcc-bugzilla@gcc.gnu.org
Mon Sep 9 20:16:00 GMT 2019


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

--- Comment #2 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
If the result of multiplying by 1.5 is outside the range of the integer 
type, the version with multiplication is required to raise the FE_INVALID 
exception for the out-of-range conversion to integer, so the 
transformation is not valid with -ftrapping-math (which is on by default).

Note also that the transformation would not be valid when the constant is 
1.5f (generally, any case where the types / values involved mean the 
conversion from integer to floating, or the multiplication, might not be 
exact in the floating-point type).


More information about the Gcc-bugs mailing list