]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR debug/59323 (Int. comp. error: in add_AT_specification, at dwarf2out.c:4026)
authorRichard Biener <rguenther@suse.de>
Thu, 28 Nov 2013 12:09:10 +0000 (12:09 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 28 Nov 2013 12:09:10 +0000 (12:09 +0000)
2013-11-28  Richard Biener  <rguenther@suse.de>

PR lto/59323
* lto-streamer-out.c (tree_is_indexable): TYPE_DECLs and
CONST_DECLs in function context are not indexable.

* gcc.dg/lto/pr59323_0.c: New testcase.

From-SVN: r205481

gcc/ChangeLog
gcc/lto-streamer-out.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/lto/pr59323_0.c [new file with mode: 0644]

index 7438fe04f25be0261fce643cd3ca6b0626d68844..49aad278f56246d4aa5a82468599b43c81613665 100644 (file)
@@ -1,3 +1,9 @@
+2013-11-28  Richard Biener  <rguenther@suse.de>
+
+       PR lto/59323
+       * lto-streamer-out.c (tree_is_indexable): TYPE_DECLs and
+       CONST_DECLs in function context are not indexable.
+
 2013-11-28  Chung-Ju Wu  <jasonwucj@gmail.com>
 
        * config/nds32/nds32.c (nds32_rtx_costs): Adjust MULT cost if it is
index 94dc13172a5ddb98aaa8e26040547b7fa6d0b54b..b4b92c72628e584991be1df5fec04e3d21d75705 100644 (file)
@@ -135,8 +135,10 @@ tree_is_indexable (tree t)
      definition.  */
   if (TREE_CODE (t) == PARM_DECL || TREE_CODE (t) == RESULT_DECL)
     return variably_modified_type_p (TREE_TYPE (DECL_CONTEXT (t)), NULL_TREE);
-  else if (TREE_CODE (t) == VAR_DECL && decl_function_context (t)
-          && !TREE_STATIC (t))
+  else if (((TREE_CODE (t) == VAR_DECL && !TREE_STATIC (t))
+           || TREE_CODE (t) == TYPE_DECL
+           || TREE_CODE (t) == CONST_DECL)
+          && decl_function_context (t))
     return false;
   else if (TREE_CODE (t) == DEBUG_EXPR_DECL)
     return false;
index 4cb559c63f9a117a66bbeaf0592306831c87db98..c4f749e721254dd25c307f94bc615f1ac167e3c9 100644 (file)
@@ -1,3 +1,8 @@
+2013-11-28  Richard Biener  <rguenther@suse.de>
+
+       PR lto/59323
+       * gcc.dg/lto/pr59323_0.c: New testcase.
+
 2013-11-28  Jakub Jelinek  <jakub@redhat.com>
 
        PR middle-end/57393
diff --git a/gcc/testsuite/gcc.dg/lto/pr59323_0.c b/gcc/testsuite/gcc.dg/lto/pr59323_0.c
new file mode 100644 (file)
index 0000000..b591058
--- /dev/null
@@ -0,0 +1,37 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options { { -O2 -g -flto } } } */
+/* { dg-extra-ld-options { -r -nostdlib } } */
+
+extern void bar(void);
+
+int main(int argc, char **argv)
+{
+  int i;
+
+  if (argc == 1) {
+    enum { X };
+
+    bar();
+
+    {
+      enum { X };
+
+      asm goto ("" : : : : lab);
+lab:
+      ;
+    }
+  }
+
+  {
+    enum { X };
+
+    int foo(void)
+    {
+      return argv[0][0];
+    }
+
+    i = foo();
+  }
+
+  return i;
+}