stor-layout.c (layout_type): Don't complain about a too small an array element type...
authorOlivier Hainque <hainque@adacore.com>
Thu, 15 Dec 2005 13:09:41 +0000 (13:09 +0000)
committerOlivier Hainque <hainque@gcc.gnu.org>
Thu, 15 Dec 2005 13:09:41 +0000 (13:09 +0000)
* stor-layout.c (layout_type): Don't complain about a too small
an array element type size compared to its alignment when the
size overflows.

From-SVN: r108575

gcc/ChangeLog
gcc/stor-layout.c

index 288eafef534b8e88727276759c31f770ec11edbe..46d848d11a5e1fe0cf3852a561fad5f0e46c84ac 100644 (file)
@@ -1,3 +1,9 @@
+2005-12-15  Olivier Hainque  <hainque@adacore.com>
+
+       * stor-layout.c (layout_type): Don't complain about a too small
+       an array element type size compared to its alignment when the
+       size overflows.
+
 2005-12-15  Jan Hubicka  <jh@suse.cz>
 
        PR target/24969
index 54ab5ac14a505cbb42a1d19b7dd025f3f24a0c65..b4e9ad1072f1f7b9d6b74a83220977f55e248e9f 100644 (file)
@@ -1816,8 +1816,13 @@ layout_type (tree type)
                TYPE_MODE (type) = BLKmode;
              }
          }
+       /* When the element size is constant, check that it is at least as
+          large as the element alignment.  */
        if (TYPE_SIZE_UNIT (element)
            && TREE_CODE (TYPE_SIZE_UNIT (element)) == INTEGER_CST
+           /* If TYPE_SIZE_UNIT overflowed, then it is certainly larger than
+              TYPE_ALIGN_UNIT.  */
+           && !TREE_CONSTANT_OVERFLOW (TYPE_SIZE_UNIT (element))
            && !integer_zerop (TYPE_SIZE_UNIT (element))
            && compare_tree_int (TYPE_SIZE_UNIT (element),
                                 TYPE_ALIGN_UNIT (element)) < 0)