This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

fix for LT comparison



This patch fixes comparisons like

0x00000000ffffffffLL > 0

which was being considered to be false, in a 32-bit-word ->
64-bit-word cross-environment.

Bootstrapped & tested OK on x86 linux native.  It's also been tested
on an older version of the tree (+ cygnus hacks) on AIX32 and AIX64,
which is where the problem appeared.

OK to commit?

-- 
- Geoffrey Keating <geoffk@cygnus.com>

===File ~/patches/cygnus/rs6000-simplifyLT.patch============
2000-07-08  Geoffrey Keating  <geoffk@cygnus.com>

	* simplify-rtx.c (simplify_relational_operation): Two signed
	values with equal high words are less/greater than each other if
	their low words are less/greater when considered as unsigned.

Index: simplify-rtx.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/simplify-rtx.c,v
retrieving revision 1.4
retrieving revision 1.4.8.1
diff -u -p -r1.4 -r1.4.8.1
--- simplify-rtx.c	2000/01/11 15:00:00	1.4
+++ simplify-rtx.c	2000/07/08 12:49:13	1.4.8.1
@@ -1689,8 +1689,8 @@ simplify_relational_operation (code, mod
 	}
 
       equal = (h0u == h1u && l0u == l1u);
-      op0lt = (h0s < h1s || (h0s == h1s && l0s < l1s));
-      op1lt = (h1s < h0s || (h1s == h0s && l1s < l0s));
+      op0lt = (h0s < h1s || (h0s == h1s && l0u < l1u));
+      op1lt = (h1s < h0s || (h1s == h0s && l1u < l0u));
       op0ltu = (h0u < h1u || (h0u == h1u && l0u < l1u));
       op1ltu = (h1u < h0u || (h1u == h0u && l1u < l0u));
     }
============================================================

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]