This is the mail archive of the gcc-bugs@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]

[Bug rtl-optimization/82153] missed optimization: double rounding


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

--- Comment #1 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
floor rounds towards -inf.  Conversion to int rounds towards 0.  That is, 
it wouldn't be valid to omit the roundsd because results would be 
different for integer arguments.  That said, if you replace floor by 
trunc, the optimization should be valid (given the default 
-ffp-int-builtin-inexact, anyway, or -fno-trapping-math; as I understand 
it, cvttsd2si raises "inexact" for noninteger arguments, whereas with 
-fno-fp-int-builtin-inexact, trunc isn't allowed to and neither is a 
conversion of an integer floating-point value to an integer type).

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