diff options
author | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-06 21:16:00 +0000 |
---|---|---|
committer | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-06 21:16:00 +0000 |
commit | 30904b2c6b5160a92e1d9abed48ac6dd7a42e94a (patch) | |
tree | f415142c581a669bd3c74758395dd97a88d662ee /gcc/stor-layout.c | |
parent | 3544e4483945fdcfd2b6ee8ff866a87241d20351 (diff) | |
download | gcc-30904b2c6b5160a92e1d9abed48ac6dd7a42e94a.tar.gz |
* stor-layout.c (set_sizetype): Use the full precision of their
machine mode for bitsize types.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145631 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/stor-layout.c')
-rw-r--r-- | gcc/stor-layout.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index e7036827a0c..c2d367f38a7 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -2046,15 +2046,18 @@ initialize_sizetypes (bool signed_p) void set_sizetype (tree type) { + tree t; int oprecision = TYPE_PRECISION (type); /* The *bitsizetype types use a precision that avoids overflows when calculating signed sizes / offsets in bits. However, when cross-compiling from a 32 bit to a 64 bit host, we are limited to 64 bit precision. */ - int precision = MIN (MIN (oprecision + BITS_PER_UNIT_LOG + 1, - MAX_FIXED_MODE_SIZE), - 2 * HOST_BITS_PER_WIDE_INT); - tree t; + int precision + = MIN (oprecision + BITS_PER_UNIT_LOG + 1, MAX_FIXED_MODE_SIZE); + precision + = GET_MODE_PRECISION (smallest_mode_for_size (precision, MODE_INT)); + if (precision > HOST_BITS_PER_WIDE_INT * 2) + precision = HOST_BITS_PER_WIDE_INT * 2; gcc_assert (TYPE_UNSIGNED (type) == TYPE_UNSIGNED (sizetype)); |