This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix PR68590
- From: Richard Biener <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 1 Dec 2015 09:53:22 +0100 (CET)
- Subject: [PATCH] Fix PR68590
- Authentication-results: sourceware.org; auth=none
The following avoids PR68590 by merging two match.pd patterns.
Bootstrapped and tested on x86_64-unknown-linux-gnu.
Richard.
2015-12-01 Richard Biener <rguenther@suse.de>
PR middle-end/68590
* match.pd: Merge (eq @0 @0) and (ge/le @0 @0) patterns.
Index: gcc/match.pd
===================================================================
--- gcc/match.pd (revision 231065)
+++ gcc/match.pd (working copy)
@@ -1828,15 +1828,14 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
/* Simplify comparison of something with itself. For IEEE
floating-point, we can only do some of these simplifications. */
-(simplify
- (eq @0 @0)
- (if (! FLOAT_TYPE_P (TREE_TYPE (@0))
- || ! HONOR_NANS (TYPE_MODE (TREE_TYPE (@0))))
- { constant_boolean_node (true, type); }))
-(for cmp (ge le)
+(for cmp (eq ge le)
(simplify
(cmp @0 @0)
- (eq @0 @0)))
+ (if (! FLOAT_TYPE_P (TREE_TYPE (@0))
+ || ! HONOR_NANS (TYPE_MODE (TREE_TYPE (@0))))
+ { constant_boolean_node (true, type); }
+ (if (cmp != EQ_EXPR)
+ (eq @0 @0)))))
(for cmp (ne gt lt)
(simplify
(cmp @0 @0)