https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84997
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Optimize integer operations |Optimize integer operations |on floating point constants |on floating point constants |without -ffast-math |without -ffast-math but | |with -fno-trapping-math --- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> --- >clang optimizes to the following assembly Note clang defaults to -fno-trapping-math. Using -ftrapping-math with clang produces what GCC produces currently: cvtsi2sd %edi, %xmm0 addsd .LCPI0_0(%rip), %xmm0 cvttsd2si %xmm0, %eax retq