dwarf2out.c (native_encode_initializer): Subtract min_index for non-range array index.

* dwarf2out.c (native_encode_initializer): Subtract min_index for
	non-range array index.  Handle VIEW_CONVERT_EXPR and NON_LVALUE_EXPR.

From-SVN: r139825
This commit is contained in:
Jakub Jelinek 2008-08-31 13:21:28 +02:00 committed by Jakub Jelinek
parent 1f494b6d9f
commit 08ab58b30f
2 changed files with 9 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2008-08-31 Jakub Jelinek <jakub@redhat.com>
* dwarf2out.c (native_encode_initializer): Subtract min_index for
non-range array index. Handle VIEW_CONVERT_EXPR and NON_LVALUE_EXPR.
2008-08-31 Jan Hubicka <jh@suse.cz>
* sparc.h (BRANCH_COST): Fix macro definition.

View File

@ -11846,7 +11846,7 @@ native_encode_initializer (tree init, unsigned char *array, int size)
pos = (tree_low_cst (TREE_OPERAND (index, 0), 0) - min_index)
* fieldsize;
else if (index)
pos = tree_low_cst (index, 0) * fieldsize;
pos = (tree_low_cst (index, 0) - min_index) * fieldsize;
if (val)
{
@ -11916,6 +11916,9 @@ native_encode_initializer (tree init, unsigned char *array, int size)
return true;
}
return false;
case VIEW_CONVERT_EXPR:
case NON_LVALUE_EXPR:
return native_encode_initializer (TREE_OPERAND (init, 0), array, size);
default:
return native_encode_expr (init, array, size) == size;
}