aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1995-08-31 19:03:23 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1995-08-31 19:03:23 -0400
commit969c851727df5eef4698ece7ffb51483aac1c385 (patch)
tree9f0dbb7e107a5299129bf63d4aca296ff1785347 /gcc
parent28a19afce3adc9b0ad44346c8de63577e0e670f2 (diff)
downloadgcc-969c851727df5eef4698ece7ffb51483aac1c385.zip
gcc-969c851727df5eef4698ece7ffb51483aac1c385.tar.gz
gcc-969c851727df5eef4698ece7ffb51483aac1c385.tar.bz2
(canon_hash, CONST_DOUBLE): Hash integer and real differently.
From-SVN: r10303
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cse.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/gcc/cse.c b/gcc/cse.c
index 0b715c8..cba56fe 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -1897,11 +1897,15 @@ canon_hash (x, mode)
/* This is like the general case, except that it only counts
the integers representing the constant. */
hash += (unsigned) code + (unsigned) GET_MODE (x);
- for (i = 2; i < GET_RTX_LENGTH (CONST_DOUBLE); i++)
- {
- unsigned tem = XINT (x, i);
- hash += tem;
- }
+ if (GET_MODE (x) != VOIDmode)
+ for (i = 2; i < GET_RTX_LENGTH (CONST_DOUBLE); i++)
+ {
+ unsigned tem = XINT (x, i);
+ hash += tem;
+ }
+ else
+ hash += ((unsigned) CONST_DOUBLE_LOW (x)
+ + (unsigned) CONST_DOUBLE_HIGH (x));
return hash;
/* Assume there is only one rtx object for any given label. */