Commit b6fc7110 by DJ Delorie Committed by DJ Delorie

* varasm.c (array_size_for_constructor): Handle STRING_CSTs also.

From-SVN: r45785
parent 1b47b7ae
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))
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment