From e1b062ae95f10d7e3aa9610f524eefc24e25c96b Mon Sep 17 00:00:00 2001 From: hainque Date: Thu, 15 Dec 2005 13:09:41 +0000 Subject: [PATCH] * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@108575 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/stor-layout.c | 5 +++++ 2 files changed, 11 insertions(+) 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 + + * 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 PR target/24969 diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index 54ab5ac..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) -- 2.7.4