This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Improve PR28796
- From: Richard Guenther <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 24 Aug 2006 15:23:02 +0200 (CEST)
- Subject: [PATCH] Improve PR28796
This patch makes sure that -funsafe-math-optimizations does not
enable optimizations suited only for -ffinite-math-only in the i386
backend (-mno-ieee-fp still has this effect).
The comment above the code snipped suggests that -ffast-math was meant
anyway.
Bootstrapped and tested on x86_64-unknown-linux-gnu.
Ok for mainline (and branches?)
Thanks,
Richard.
2006-08-24 Richard Guenther <rguenther@suse.de>
PR target/28796
* config/i386/i386.c (override_options): Do not set MASK_IEEE_FP
if only flag_unsafe_math_optimizations is specified. We have
flag_finite_math_only for that.
Index: gcc/config/i386/i386.c
===================================================================
--- gcc.orig/config/i386/i386.c
+++ gcc/config/i386/i386.c
@@ -1852,9 +1852,10 @@ override_options (void)
else if (TARGET_OMIT_LEAF_FRAME_POINTER)
flag_omit_frame_pointer = 1;
- /* 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;
/* If the architecture always has an FPU, turn off NO_FANCY_MATH_387,