aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1996-01-24 11:31:38 -0800
committerJim Wilson <wilson@gcc.gnu.org>1996-01-24 11:31:38 -0800
commitb200d1aa65136d8ced8ca4b9c50d6754d4b685d4 (patch)
tree318caf00584aaf139016acdac2d80cb8c3f90879
parent92acadfe28d63a3ecee7bc8ee87339667a59ed08 (diff)
downloadgcc-b200d1aa65136d8ced8ca4b9c50d6754d4b685d4.zip
gcc-b200d1aa65136d8ced8ca4b9c50d6754d4b685d4.tar.gz
gcc-b200d1aa65136d8ced8ca4b9c50d6754d4b685d4.tar.bz2
(pointer_int_sum): Use TYPE_PRECISION (sizetype) not
POINTER_SIZE to agree with expr.c. From-SVN: r11088
-rw-r--r--gcc/c-typeck.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index a602f7f..5144d34 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -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