]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix mn10200-elf libio build failure, and minor performance regression.
authorJim Wilson <wilson@cygnus.com>
Sat, 30 Oct 1999 00:18:23 +0000 (00:18 +0000)
committerJim Wilson <wilson@gcc.gnu.org>
Sat, 30 Oct 1999 00:18:23 +0000 (17:18 -0700)
* stor-layout.c (layout_type): When compute TYPE_SIZE_UNIT from
TYPE_SIZE, convert type of result to sizetype.

From-SVN: r30270

gcc/ChangeLog
gcc/stor-layout.c

index 37642fcfab5e4d1687dc72dfca00b1599ee6417b..756d6c33195020ddc20ebacca8a60ad4209e8907 100644 (file)
@@ -1,3 +1,8 @@
+Fri Oct 29 17:00:42 1999  Jim Wilson  <wilson@cygnus.com>
+
+       * stor-layout.c (layout_type): When compute TYPE_SIZE_UNIT from
+       TYPE_SIZE, convert type of result to sizetype.
+
 Fri Oct 29 14:34:17 1999  Richard Henderson  <rth@cygnus.com>
 
        * flow.c (count_or_remove_death_notes): Equate NULL with the
index f8a1e1dde63a5e9e94b221550124674c2731b2ec..3663293f56dd687bb7b75fcaf4bbf81818d51e4b 100644 (file)
@@ -1106,8 +1106,12 @@ layout_type (type)
      of the type above, find it by division.  */
   if (TYPE_SIZE_UNIT (type) == 0 && TYPE_SIZE (type) != 0)
     {
-      TYPE_SIZE_UNIT (type) = size_binop (FLOOR_DIV_EXPR, TYPE_SIZE (type),
-                                         size_int (BITS_PER_UNIT));
+      /* TYPE_SIZE (type) is computed in bitsizetype.  After the division, the
+        result will fit in sizetype.  We will get more efficient code using
+        sizetype, so we force a conversion.  */
+      tree unit_size = size_binop (FLOOR_DIV_EXPR, TYPE_SIZE (type),
+                                  size_int (BITS_PER_UNIT));
+      TYPE_SIZE_UNIT (type) = convert (sizetype, unit_size);
     }
 
   /* Once again evaluate only once, either now or as soon as safe.  */