https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96793
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |glisse at gcc dot gnu.org --- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Uroš Bizjak from comment #7) > Created attachment 49144 [details] > Proposed patch > > Patch in testing. OTOH we _do_ try to compensate for HONOR_SIGNED_ZEROS so I wonder whether we really need to punt for -frounding-math? I also doubt glibc gets it correct, does it? I guess /* Compensate: xa = xa - (xa > operand1 ? 1 : 0) */ tmp = ix86_expand_sse_compare_mask (UNGT, xa, res, !do_floor); emit_insn (gen_rtx_SET (tmp, gen_rtx_AND (mode, one, tmp))); tmp = expand_simple_binop (mode, do_floor ? MINUS : PLUS, xa, tmp, NULL_RTX, 0, OPTAB_DIRECT); might be in error for FE_DOWNWARD if 0 - 0 behaves differently depending on rounding mode... or the compensation is off if (HONOR_SIGNED_ZEROS (mode)) ix86_sse_copysign_to_positive (res, res, force_reg (mode, operand1), mask);