aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1993-01-18 10:41:46 -0800
committerJim Wilson <wilson@gcc.gnu.org>1993-01-18 10:41:46 -0800
commit13756074430d7ace49756f247d185c0de92f6481 (patch)
treef3702b7b8d0be4b586d5d432239ed468b4c190b3
parent1f050b9b262115d78c865bad87644a056bb8539a (diff)
downloadgcc-13756074430d7ace49756f247d185c0de92f6481.zip
gcc-13756074430d7ace49756f247d185c0de92f6481.tar.gz
gcc-13756074430d7ace49756f247d185c0de92f6481.tar.bz2
(make_signed_type): Consistently use HOST_BITS_PER_WIDE_INT.
(make_signed_type): Consistently use HOST_BITS_PER_WIDE_INT. Correct minor formatting problems. (fixup_signed_type): Use HOST_BITS_PER_WIDE_INT and HOST_WIDE_INT like make_signed_type does. (fixup_unsigned_type): Correct minor formatting problem. From-SVN: r3263
-rw-r--r--gcc/stor-layout.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index 7ccbca8..c86fc00 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -924,14 +924,14 @@ make_signed_type (precision)
? 0 : (HOST_WIDE_INT) (-1) << (precision - 1)),
(((HOST_WIDE_INT) (-1)
<< (precision - HOST_BITS_PER_WIDE_INT - 1 > 0
- ? precision-HOST_BITS_PER_WIDE_INT - 1
+ ? precision - HOST_BITS_PER_WIDE_INT - 1
: 0))));
TYPE_MAX_VALUE (type)
- = build_int_2 ((precision - HOST_BITS_PER_WIDE_INT > 0
+ = build_int_2 ((precision - HOST_BITS_PER_WIDE_INT > 0
? -1 : ((HOST_WIDE_INT) 1 << (precision - 1)) - 1),
(precision - HOST_BITS_PER_WIDE_INT - 1 > 0
? (((HOST_WIDE_INT) 1
- << (precision - HOST_BITS_PER_INT - 1)))-1
+ << (precision - HOST_BITS_PER_WIDE_INT - 1))) - 1
: 0));
/* Give this type's extreme values this type as their type. */
@@ -977,7 +977,7 @@ make_unsigned_type (precision)
}
/* Set the extreme values of TYPE based on its precision in bits,
- the lay it out. Used when make_signed_type won't do
+ then lay it out. Used when make_signed_type won't do
because the tree code is not INTEGER_TYPE.
E.g. for Pascal, when the -fsigned-char option is given. */
@@ -988,14 +988,18 @@ fixup_signed_type (type)
register int precision = TYPE_PRECISION (type);
TYPE_MIN_VALUE (type)
- = build_int_2 ((precision-BITS_PER_WORD > 0 ? 0 : (-1)<<(precision-1)),
- (-1)<<(precision-BITS_PER_WORD-1 > 0
- ? precision-BITS_PER_WORD-1
- : 0));
+ = build_int_2 ((precision - HOST_BITS_PER_WIDE_INT > 0
+ ? 0 : (HOST_WIDE_INT) (-1) << (precision - 1)),
+ (((HOST_WIDE_INT) (-1)
+ << (precision - HOST_BITS_PER_WIDE_INT - 1 > 0
+ ? precision - HOST_BITS_PER_WIDE_INT - 1
+ : 0))));
TYPE_MAX_VALUE (type)
- = build_int_2 ((precision-BITS_PER_WORD > 0 ? -1 : (1<<(precision-1))-1),
- (precision-BITS_PER_WORD-1 > 0
- ? (1<<(precision-BITS_PER_WORD-1))-1
+ = build_int_2 ((precision - HOST_BITS_PER_WIDE_INT > 0
+ ? -1 : ((HOST_WIDE_INT) 1 << (precision - 1)) - 1),
+ (precision - HOST_BITS_PER_WIDE_INT - 1 > 0
+ ? (((HOST_WIDE_INT) 1
+ << (precision - HOST_BITS_PER_WIDE_INT - 1))) - 1
: 0));
TREE_TYPE (TYPE_MIN_VALUE (type)) = type;
@@ -1007,7 +1011,7 @@ fixup_signed_type (type)
}
/* Set the extreme values of TYPE based on its precision in bits,
- the lay it out. This is used both in `make_unsigned_type'
+ then lay it out. This is used both in `make_unsigned_type'
and for enumeral types. */
void
@@ -1019,7 +1023,7 @@ fixup_unsigned_type (type)
TYPE_MIN_VALUE (type) = build_int_2 (0, 0);
TYPE_MAX_VALUE (type)
= build_int_2 (precision - HOST_BITS_PER_WIDE_INT >= 0
- ? -1 : ((HOST_WIDE_INT) 1<< precision) - 1,
+ ? -1 : ((HOST_WIDE_INT) 1 << precision) - 1,
precision - HOST_BITS_PER_WIDE_INT > 0
? ((unsigned HOST_WIDE_INT) ~0
>> (HOST_BITS_PER_WIDE_INT