aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2008-08-31 13:21:28 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2008-08-31 13:21:28 +0200
commit08ab58b30f4ae0b42751ce52ac444691e6da2606 (patch)
treec2489bec4a2f1f8360eec4e59d2d06a5ec47f79c /gcc
parent1f494b6d9fa97eeb0bbd812ad8e7036ec4591cb1 (diff)
downloadgcc-08ab58b30f4ae0b42751ce52ac444691e6da2606.zip
gcc-08ab58b30f4ae0b42751ce52ac444691e6da2606.tar.gz
gcc-08ab58b30f4ae0b42751ce52ac444691e6da2606.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/dwarf2out.c5
2 files changed, 9 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 39836ec..f78b208 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 567fc7a..6a8d34c 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -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;
}