]> gcc.gnu.org Git - gcc.git/commitdiff
(build_index_type, build_index_2_type): Don't pass HOST_WIDE_INT to routine expecting...
authorRichard Stallman <rms@gnu.org>
Wed, 9 Sep 1992 07:00:48 +0000 (07:00 +0000)
committerRichard Stallman <rms@gnu.org>
Wed, 9 Sep 1992 07:00:48 +0000 (07:00 +0000)
(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

gcc/tree.c

index cc36562b0b5e320b7b124e1a5630660d63c80c6c..34de0d6da1ae9e94aaf4d2a030634dc873a74066 100644 (file)
@@ -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;
This page took 0.073096 seconds and 5 git commands to generate.