aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorOlivier Hainque <hainque@adacore.com>2005-12-15 13:09:41 +0000
committerOlivier Hainque <hainque@gcc.gnu.org>2005-12-15 13:09:41 +0000
commitb606b65c4498e78791f0d4eb2d09847b43a7fd55 (patch)
tree4956b58cc74e48cadbe7195d684ca9abc38cd870 /gcc
parent9286af9721c6482504a91ee42f2139322878df73 (diff)
downloadgcc-b606b65c4498e78791f0d4eb2d09847b43a7fd55.zip
gcc-b606b65c4498e78791f0d4eb2d09847b43a7fd55.tar.gz
gcc-b606b65c4498e78791f0d4eb2d09847b43a7fd55.tar.bz2
stor-layout.c (layout_type): Don't complain about a too small an array element type size compared to its...
* 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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/stor-layout.c5
2 files changed, 11 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 288eafe..46d848d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index 54ab5ac1..b4e9ad1 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -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)