(pointer_int_sum): Use TYPE_PRECISION (sizetype) not
authorJim Wilson <wilson@gcc.gnu.org>
Wed, 24 Jan 1996 19:31:38 +0000 (11:31 -0800)
committerJim Wilson <wilson@gcc.gnu.org>
Wed, 24 Jan 1996 19:31:38 +0000 (11:31 -0800)
POINTER_SIZE to agree with expr.c.

From-SVN: r11088

gcc/c-typeck.c

index a602f7f8fdf21db964bbc8dbbb2d4c68398eb930..5144d34b6c6984f8f9cc03f38970878c00b09782 100644 (file)
@@ -2645,11 +2645,11 @@ pointer_int_sum (resultcode, ptrop, intop)
       intop = convert (int_type, TREE_OPERAND (intop, 0));
     }
 
-  /* Convert the integer argument to a type the same size as a pointer
+  /* Convert the integer argument to a type the same size as sizetype
      so the multiply won't overflow spuriously.  */
 
-  if (TYPE_PRECISION (TREE_TYPE (intop)) != POINTER_SIZE)
-    intop = convert (type_for_size (POINTER_SIZE, 0), intop);
+  if (TYPE_PRECISION (TREE_TYPE (intop)) != TYPE_PRECISION (sizetype))
+    intop = convert (type_for_size (TYPE_PRECISION (sizetype), 0), intop);
 
   /* Replace the integer argument with a suitable product by the object size.
      Do this multiplication as signed, then convert to the appropriate