diff options
author | Jim Wilson <wilson@gcc.gnu.org> | 1996-01-24 11:31:38 -0800 |
---|---|---|
committer | Jim Wilson <wilson@gcc.gnu.org> | 1996-01-24 11:31:38 -0800 |
commit | b200d1aa65136d8ced8ca4b9c50d6754d4b685d4 (patch) | |
tree | 318caf00584aaf139016acdac2d80cb8c3f90879 /gcc | |
parent | 92acadfe28d63a3ecee7bc8ee87339667a59ed08 (diff) | |
download | gcc-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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/c-typeck.c | 6 |
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 |