This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix bug in implies_p
- From: Bernd Schmidt <bernds_cb1 at t-online dot de>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 13 Feb 2009 12:39:15 +0100
- Subject: Fix bug in implies_p
This fixes a bug I introduced a while ago in implies_p. It tries to
prove that (A GT 0) implies (A GTU a signed number), but doesn't check
that the two first operands match.
I don't have a failing testcase, I noticed this while I was debugging
some unrelated changes I was making to simplify_using_initial_values.
Bootstrapped & regression tested on i686-linux. Committed as obvious.
I'll also apply to the 4.3 branch after testing.
Bernd
--
This footer brought to you by insane German lawmakers.
Analog Devices GmbH Wilhelm-Wagenfeld-Str. 6 80807 Muenchen
Sitz der Gesellschaft Muenchen, Registergericht Muenchen HRB 40368
Geschaeftsfuehrer Thomas Wessel, William A. Martin, Margaret Seif
Index: ChangeLog
===================================================================
--- ChangeLog (revision 144151)
+++ ChangeLog (working copy)
@@ -1,3 +1,8 @@
+2008-02-13 Bernd Schmidt <bernd.schmidt@analog.com>
+
+ * loop-iv.c (implies_p): In the final case, test that operands 0
+ of the two comparisons match.
+
2009-02-13 Richard Guenther <rguenther@suse.de>
* configure.ac: Enable LFS.
Index: loop-iv.c
===================================================================
--- loop-iv.c (revision 144119)
+++ loop-iv.c (working copy)
@@ -1556,7 +1556,8 @@ implies_p (rtx a, rtx b)
&& ((GET_CODE (a) == GT && op1 == constm1_rtx)
|| INTVAL (op1) >= 0)
&& GET_CODE (b) == LTU
- && GET_CODE (opb1) == CONST_INT)
+ && GET_CODE (opb1) == CONST_INT
+ && rtx_equal_p (op0, opb0))
return INTVAL (opb1) < 0;
return false;