re PR middle-end/28796 (__builtin_nan() and __builtin_unordered() inconsistent)
authorRichard Guenther <rguenther@suse.de>
Sat, 21 Oct 2006 10:13:13 +0000 (10:13 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Sat, 21 Oct 2006 10:13:13 +0000 (10:13 +0000)
2006-10-21  Richard Guenther  <rguenther@suse.de>

PR middle-end/28796
* simplify-rtx.c (simplify_const_relational_operation):
Do not constant-fold ORDERED and UNORDERED for
flag_unsafe_math_optimizations but only we do not need to
honor NaNs for the given mode.

From-SVN: r117928

gcc/ChangeLog
gcc/simplify-rtx.c

index 9719982f39694eed6233053cb47ad3cee446a7bb..09185e1420eb4aea862dab9d9dc8fcb65ed3169f 100644 (file)
@@ -1,3 +1,11 @@
+2006-10-21  Richard Guenther  <rguenther@suse.de>
+
+       PR middle-end/28796
+       * simplify-rtx.c (simplify_const_relational_operation):
+       Do not constant-fold ORDERED and UNORDERED for
+       flag_unsafe_math_optimizations but only we do not need to
+       honor NaNs for the given mode.
+
 2006-10-21  Richard Guenther  <rguenther@suse.de>
 
        PR target/29512
index 3b12b20e682343713694bcf11fba554aa3df7834..fee07f9b5b8d720eb90bfa666e524e79cf6a717c 100644 (file)
@@ -3747,10 +3747,10 @@ simplify_const_relational_operation (enum rtx_code code,
     return simplify_const_relational_operation (signed_condition (code),
                                                mode, tem, const0_rtx);
 
-  if (flag_unsafe_math_optimizations && code == ORDERED)
+  if (! HONOR_NANS (mode) && code == ORDERED)
     return const_true_rtx;
 
-  if (flag_unsafe_math_optimizations && code == UNORDERED)
+  if (! HONOR_NANS (mode) && code == UNORDERED)
     return const0_rtx;
 
   /* For modes without NaNs, if the two operands are equal, we know the