diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2009-04-06 21:16:00 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2009-04-06 21:16:00 +0000 |
commit | fe0a25ec79f35eb3ae2ecf31e4fd2ba91a6294fa (patch) | |
tree | f415142c581a669bd3c74758395dd97a88d662ee | |
parent | 0c011bc3b382df7cdb9e444ebba4db0ba01495e1 (diff) | |
download | gcc-fe0a25ec79f35eb3ae2ecf31e4fd2ba91a6294fa.zip gcc-fe0a25ec79f35eb3ae2ecf31e4fd2ba91a6294fa.tar.gz gcc-fe0a25ec79f35eb3ae2ecf31e4fd2ba91a6294fa.tar.bz2 |
stor-layout.c (set_sizetype): Use the full precision of their machine mode for bitsize types.
* stor-layout.c (set_sizetype): Use the full precision of their
machine mode for bitsize types.
From-SVN: r145631
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/stor-layout.c | 11 |
2 files changed, 12 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8ac9e95..493b7ec 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2009-04-06 Eric Botcazou <ebotcazou@adacore.com> + + * stor-layout.c (set_sizetype): Use the full precision of their + machine mode for bitsize types. + 2009-04-06 H.J. Lu <hongjiu.lu@intel.com> * config/i386/i386.md: Revert 2 accidental checkins. diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index e703682..c2d367f 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)); |