aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1992-09-09 07:00:48 +0000
committerRichard Stallman <rms@gnu.org>1992-09-09 07:00:48 +0000
commitbc99efc9d63a3111181fa2e08c5810a4436f66d5 (patch)
treee6975b0d0832b78f0d58990d7f4d2774a5ea9851
parentd434a42c5be6bce27fb525dedc2dd5b5f6a3e17f (diff)
downloadgcc-bc99efc9d63a3111181fa2e08c5810a4436f66d5.zip
gcc-bc99efc9d63a3111181fa2e08c5810a4436f66d5.tar.gz
gcc-bc99efc9d63a3111181fa2e08c5810a4436f66d5.tar.bz2
(build_index_type, build_index_2_type): Don't pass HOST_WIDE_INT to routine expecting an int.
(build_index_type, build_index_2_type): Don't pass HOST_WIDE_INT to routine expecting an int. Don't pass negative value even if hash code is INT_MIN. From-SVN: r2087
-rw-r--r--gcc/tree.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index cc36562..34de0d6 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -2663,8 +2663,8 @@ build_index_type (maxval)
TYPE_ALIGN (itype) = TYPE_ALIGN (sizetype);
if (TREE_CODE (maxval) == INTEGER_CST)
{
- HOST_WIDE_INT maxint = TREE_INT_CST_LOW (maxval);
- return type_hash_canon (maxint > 0 ? maxint : - maxint, itype);
+ int maxint = (int) TREE_INT_CST_LOW (maxval);
+ return type_hash_canon (maxint < 0 ? ~maxint : maxint, itype);
}
else
return itype;
@@ -2689,8 +2689,8 @@ build_index_2_type (lowval,highval)
{
HOST_WIDE_INT highint = TREE_INT_CST_LOW (highval);
HOST_WIDE_INT lowint = TREE_INT_CST_LOW (lowval);
- HOST_WIDE_INT maxint = highint - lowint;
- return type_hash_canon (maxint > 0 ? maxint : - maxint, itype);
+ int maxint = (int) (highint - lowint);
+ return type_hash_canon (maxint < 0 ? ~maxint : maxint, itype);
}
else
return itype;