]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
stor-layout.c (set_sizetype): Use the full precision of their machine mode for bitsiz...
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 6 Apr 2009 21:16:00 +0000 (21:16 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Mon, 6 Apr 2009 21:16:00 +0000 (21:16 +0000)
* stor-layout.c (set_sizetype): Use the full precision of their
machine mode for bitsize types.

From-SVN: r145631

gcc/ChangeLog
gcc/stor-layout.c

index 8ac9e95eb5775ffbcaa2581eac92c3b29db5b264..493b7ec3e90d9b59068872816636ea826db4ebdb 100644 (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>
 
        * config/i386/i386.md: Revert 2 accidental checkins.
index e7036827a0cf7ffa97085afb6ba0c7fde87cef12..c2d367f38a7aac8a87263fce482b92e4c03c3590 100644 (file)
@@ -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));