mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-02-07 02:09:40 +08:00
stor-layout.c (layout_type): Do not allow alignment of array elements to be greater than their size.
* stor-layout.c (layout_type): Do not allow alignment of array elements to be greater than their size. From-SVN: r105095
This commit is contained in:
parent
79a1aca797
commit
002a9071e6
@ -1,3 +1,8 @@
|
||||
2005-10-07 Steve Ellcey <sje@cup.hp.com>
|
||||
|
||||
* stor-layout.c (layout_type): Do not allow alignment of array
|
||||
elements to be greater than their size.
|
||||
|
||||
2005-10-07 Steve Ellcey <sje@cup.hp.com>
|
||||
|
||||
* config.host (hppa*-*-hpux*): Change out_host_hook_obj and
|
||||
|
@ -1817,6 +1817,12 @@ layout_type (tree type)
|
||||
TYPE_MODE (type) = BLKmode;
|
||||
}
|
||||
}
|
||||
if (TYPE_SIZE_UNIT (element)
|
||||
&& TREE_CODE (TYPE_SIZE_UNIT (element)) == INTEGER_CST
|
||||
&& !integer_zerop (TYPE_SIZE_UNIT (element))
|
||||
&& compare_tree_int (TYPE_SIZE_UNIT (element),
|
||||
TYPE_ALIGN_UNIT (element)) < 0)
|
||||
error ("alignment of array elements is greater than element size");
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user