expmed.c (make_tree): Sign extend even if TREE_UNSIGNED...
authorDavid S. Miller <davem@pierdol.cobaltmicro.com>
Sat, 22 Aug 1998 03:17:56 +0000 (03:17 +0000)
committerDavid S. Miller <davem@gcc.gnu.org>
Sat, 22 Aug 1998 03:17:56 +0000 (20:17 -0700)
* expmed.c (make_tree) [CONST_INT]: Sign extend even if
TREE_UNSIGNED, when bitsize of type's mode is larger than
HOST_BITS_PER_WIDE_INT.

From-SVN: r21904

gcc/ChangeLog
gcc/expmed.c

index 319d3145150a44cd27821ae89ab4b6c63d9b8393..ba4a8d3347781161f1f3cfd0fd4262c6b41a6ab2 100644 (file)
@@ -3,6 +3,10 @@ Fri Aug 21 23:07:46 1998  David S. Miller  <davem@pierdol.cobaltmicro.com>
        * config/sparc/sparc.md (TFmode splits): Handle destination
        registers being referenced in the address correctly.
 
+       * expmed.c (make_tree) [CONST_INT]: Sign extend even if
+       TREE_UNSIGNED, when bitsize of type's mode is larger than
+       HOST_BITS_PER_WIDE_INT.
+
 Fri Aug 21 19:31:31 1998  Alexandre Petit-Bianco <apbianco@cygnus.com>
 
        * tree.def (LABELED_BLOCK_EXPR, EXIT_BLOCK_EXPR): New tree nodes.
index 2f656c281f1f543eb124d0025be204509a3d96e2..c6efd6257d700b5730a138382aad8940d93b4cdd 100644 (file)
@@ -3767,7 +3767,9 @@ make_tree (type, x)
     {
     case CONST_INT:
       t = build_int_2 (INTVAL (x),
-                      TREE_UNSIGNED (type) || INTVAL (x) >= 0 ? 0 : -1);
+                      (TREE_UNSIGNED (type)
+                       && (GET_MODE_BITSIZE (TYPE_MODE (type)) < HOST_BITS_PER_WIDE_INT))
+                      || INTVAL (x) >= 0 ? 0 : -1);
       TREE_TYPE (t) = type;
       return t;