* varasm.c (array_size_for_constructor): Handle STRING_CSTs also.
From-SVN: r45785
This commit is contained in:
parent
1b47b7aebb
commit
b6fc711089
@ -1,3 +1,7 @@
|
||||
2001-09-24 DJ Delorie <dj@redhat.com>
|
||||
|
||||
* varasm.c (array_size_for_constructor): Handle STRING_CSTs also.
|
||||
|
||||
2001-09-24 Ulrich Weigand <uweigand@de.ibm.com>:
|
||||
|
||||
* flow.c (delete_dead_jumptables): Delete jumptable if the only
|
||||
|
@ -4585,6 +4585,13 @@ array_size_for_constructor (val)
|
||||
{
|
||||
tree max_index, i;
|
||||
|
||||
if (TREE_CODE (val) == STRING_CST)
|
||||
{
|
||||
HOST_WIDE_INT len = TREE_STRING_LENGTH(val);
|
||||
HOST_WIDE_INT esz = int_size_in_bytes (TREE_TYPE (TREE_TYPE (val)));
|
||||
HOST_WIDE_INT tsz = len * esz;
|
||||
return tsz;
|
||||
}
|
||||
max_index = NULL_TREE;
|
||||
for (i = CONSTRUCTOR_ELTS (val); i ; i = TREE_CHAIN (i))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user