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
This commit is contained in:
Eric Botcazou 2009-04-06 21:16:00 +00:00 committed by Eric Botcazou
parent 0c011bc3b3
commit fe0a25ec79
2 changed files with 12 additions and 4 deletions

View File

@ -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> 2009-04-06 H.J. Lu <hongjiu.lu@intel.com>
* config/i386/i386.md: Revert 2 accidental checkins. * config/i386/i386.md: Revert 2 accidental checkins.

View File

@ -2046,15 +2046,18 @@ initialize_sizetypes (bool signed_p)
void void
set_sizetype (tree type) set_sizetype (tree type)
{ {
tree t;
int oprecision = TYPE_PRECISION (type); int oprecision = TYPE_PRECISION (type);
/* The *bitsizetype types use a precision that avoids overflows when /* The *bitsizetype types use a precision that avoids overflows when
calculating signed sizes / offsets in bits. However, 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 cross-compiling from a 32 bit to a 64 bit host, we are limited to 64 bit
precision. */ precision. */
int precision = MIN (MIN (oprecision + BITS_PER_UNIT_LOG + 1, int precision
MAX_FIXED_MODE_SIZE), = MIN (oprecision + BITS_PER_UNIT_LOG + 1, MAX_FIXED_MODE_SIZE);
2 * HOST_BITS_PER_WIDE_INT); precision
tree t; = 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)); gcc_assert (TYPE_UNSIGNED (type) == TYPE_UNSIGNED (sizetype));