OSDN Git Service

* dwarf2out.c (native_encode_initializer): Subtract min_index for
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 31 Aug 2008 11:21:28 +0000 (11:21 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 31 Aug 2008 11:21:28 +0000 (11:21 +0000)
non-range array index.  Handle VIEW_CONVERT_EXPR and NON_LVALUE_EXPR.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139825 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/dwarf2out.c

index 39836ec..f78b208 100644 (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.
index 567fc7a..6a8d34c 100644 (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;
     }