* c-common.c (shorten_compare): Use force_fit_type directly.
authorNathan Sidwell <nathan@gcc.gnu.org>
Sat, 14 Aug 2004 17:54:36 +0000 (17:54 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Sat, 14 Aug 2004 17:54:36 +0000 (17:54 +0000)
From-SVN: r86004

gcc/ChangeLog
gcc/c-common.c

index 476935786697e0077d3c852acbe016ff39e3f196..6465583cfa3067169a635c9615f7e5b2ce14a760 100644 (file)
@@ -1,3 +1,7 @@
+2004-08-14  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * c-common.c (shorten_compare): Use force_fit_type directly.
+
 2004-08-14  Gerald Pfeifer  <gerald@pfeifer.com>
            Dimitri Papadopoulos-Orfanos  <papadopo@shfj.cea.fr>
            Dave Korn  <dk@artimi.com>
        * config/i386/xmmintrin.h: Include <mm_malloc.h>.
 
 2004-08-03  H.J. Lu  <hongjiu.lu@intel.com>
-           Tanguy Fautrà <tfautre@pandora.be>
+           Tanguy FautrÃ\83  <tfautre@pandora.be>
 
        * config/i386/pmm_malloc.h: New file.
 
index 09373dd05d8af91b011ca82403ccfc78882ac4a7..1416871cdac1be598dfe8f16657e2460fb66bc21 100644 (file)
@@ -1997,10 +1997,14 @@ shorten_compare (tree *op0_ptr, tree *op1_ptr, tree *restype_ptr,
 
       if (TREE_TYPE (primop1) != *restype_ptr)
        {
-         tree tmp = convert (*restype_ptr, primop1);
-         TREE_OVERFLOW (tmp) = TREE_OVERFLOW (primop1);
-         TREE_CONSTANT_OVERFLOW (tmp) = TREE_CONSTANT_OVERFLOW (primop1);
-         primop1 = tmp;
+         /* Convert primop1 to target type, but do not introduce
+            additional overflow.  We know primop1 is an int_cst.  */
+         tree tmp = build_int_2 (TREE_INT_CST_LOW (primop1),
+                                 TREE_INT_CST_HIGH (primop1));
+
+         TREE_TYPE (tmp) = *restype_ptr;
+         primop1 = force_fit_type (tmp, 0, TREE_OVERFLOW (primop1),
+                                   TREE_CONSTANT_OVERFLOW (primop1));
        }
       if (type != *restype_ptr)
        {