From: Richard Stallman Date: Wed, 9 Sep 1992 07:00:48 +0000 (+0000) Subject: (build_index_type, build_index_2_type): Don't pass HOST_WIDE_INT to routine expecting... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bc99efc9d63a3111181fa2e08c5810a4436f66d5;p=gcc.git (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 --- diff --git a/gcc/tree.c b/gcc/tree.c index cc36562b0b5..34de0d6da1a 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;