This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Improve PR28796
- From: Roger Sayle <roger at eyesopen dot com>
- To: Richard Guenther <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 24 Aug 2006 10:03:02 -0600 (MDT)
- Subject: Re: [PATCH] Improve PR28796
Hi Richard,
On Thu, 24 Aug 2006, Richard Guenther wrote:
> - /* If we're doing fast math, we don't care about comparison order
> - wrt NaNs. This lets us use a shorter comparison sequence. */
> - if (flag_unsafe_math_optimizations)
> + /* If we are doing finite math only, we don't need to care about
> + comparison order wrt NaNs. This lets us use a shorter comparison
> + sequence. */
> + if (flag_unsafe_math_optimizations && flag_finite_math_only)
> target_flags &= ~MASK_IEEE_FP;
I think this condition should be just
if (flag_finite_math_only)
target &= ~MASK_IEEE_FP;
and as mentioned in comment #9 of PR target/19116, you should also take
the opportunity to clean-up the remaining misuse of TARGET_IEEE_FP in
i386.md.
Index: i386.md
===================================================================
*** i386.md (revision 116361)
--- i386.md (working copy)
***************
*** 15118,15125 ****
(define_insn "sqrtxf2"
[(set (match_operand:XF 0 "register_operand" "=f")
(sqrt:XF (match_operand:XF 1 "register_operand" "0")))]
! "TARGET_USE_FANCY_MATH_387
! && (TARGET_IEEE_FP || flag_unsafe_math_optimizations) "
"fsqrt"
[(set_attr "type" "fpspc")
(set_attr "mode" "XF")
--- 15118,15124 ----
(define_insn "sqrtxf2"
[(set (match_operand:XF 0 "register_operand" "=f")
(sqrt:XF (match_operand:XF 1 "register_operand" "0")))]
! "TARGET_USE_FANCY_MATH_387"
"fsqrt"
[(set_attr "type" "fpspc")
(set_attr "mode" "XF")
This misuse of TARGET_IEEE_FP dates back to revision 5572 (i.e. the dawn
of time), and is at odds with the stated role of -mno-ieee-fp to control
floating point comparisons.
Could you retest your patch with those changes? Thanks in advance,
Roger
--