re PR debug/65771 (ICE (in loc_list_from_tree, at dwarf2out.c:14964) on arm-linux...
authorJakub Jelinek <jakub@redhat.com>
Fri, 17 Apr 2015 07:44:30 +0000 (09:44 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 17 Apr 2015 07:44:30 +0000 (09:44 +0200)
PR debug/65771
* dwarf2out.c (loc_list_from_tree): Return NULL
for DEBUG_EXPR_DECL.

* gcc.dg/debug/pr65771.c: New test.

From-SVN: r222166

gcc/ChangeLog
gcc/dwarf2out.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/debug/pr65771.c [new file with mode: 0644]

index eba141ddb5ea35263e2334b389b8dd78b29cf1ca..d572d495935192aa04d8c587afa91b87170853fd 100644 (file)
@@ -1,3 +1,9 @@
+2015-04-17  Jakub Jelinek  <jakub@redhat.com>
+
+       PR debug/65771
+       * dwarf2out.c (loc_list_from_tree): Return NULL
+       for DEBUG_EXPR_DECL.
+
 2015-04-17  Christian Bruel  <christian.bruel@st.com>
 
        * ipa-inline.c (can_inline_edge_p): Allow inlining of functions with
index 6c8e51fcab42447dddd0f587b1db67e1cd345cc4..b34a3ed3d05103fee98ee630d7d04fced4627542 100644 (file)
@@ -14642,6 +14642,7 @@ loc_list_from_tree (tree loc, int want_address,
 
     case TARGET_MEM_REF:
     case SSA_NAME:
+    case DEBUG_EXPR_DECL:
       return NULL;
 
     case COMPOUND_EXPR:
index adb1192cb18be4577b10f0ac3b764c308697bda5..2bf85769dc6663527131389ff5defe91d9e53362 100644 (file)
@@ -1,3 +1,8 @@
+2015-04-17  Jakub Jelinek  <jakub@redhat.com>
+
+       PR debug/65771
+       * gcc.dg/debug/pr65771.c: New test.
+
 2015-04-16  H.J. Lu  <hongjiu.lu@intel.com>
 
        * gcc.target/i386/mpx/alloca-1-lbv.c (mpx_test): Replace
diff --git a/gcc/testsuite/gcc.dg/debug/pr65771.c b/gcc/testsuite/gcc.dg/debug/pr65771.c
new file mode 100644 (file)
index 0000000..2629901
--- /dev/null
@@ -0,0 +1,15 @@
+/* PR debug/65771 */
+/* { dg-do link } */
+/* { dg-require-effective-target tls } */
+
+struct S { int s; int t; };
+__thread struct S a[10];
+int b;
+
+int
+main ()
+{
+  int c = a[b].t;
+  (void) c;
+  return 0;
+}