This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix PR66739
- From: Richard Biener <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 7 Jul 2015 09:41:41 +0200 (CEST)
- Subject: [PATCH] Fix PR66739
- Authentication-results: sourceware.org; auth=none
The following fixes PR66739 - with conditionals not applying
a single-use restriction usually causes some regressions.
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk.
Richard.
2015-07-07 Richard Biener <rguenther@suse.de>
PR middle-end/66739
* match.pd: Condition A - B ==/!= 0 -> A ==/!= B on single-use
A - B.
Index: gcc/match.pd
===================================================================
--- gcc/match.pd (revision 225453)
+++ gcc/match.pd (working copy)
@@ -1336,8 +1353,9 @@ (define_operator_list CBRT BUILT_IN_CBRT
attempts to synthetize ABS_EXPR. */
(for cmp (eq ne)
(simplify
- (cmp (minus @0 @1) integer_zerop)
- (cmp @0 @1)))
+ (cmp (minus@2 @0 @1) integer_zerop)
+ (if (single_use (@2))
+ (cmp @0 @1))))
/* Transform comparisons of the form X * C1 CMP 0 to X CMP 0 in the
signed arithmetic case. That form is created by the compiler