From 7faa2dfdd72760ae0d0309eb92c61b3d64539ed9 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 1 Oct 2014 22:51:34 +0200 Subject: [PATCH] re PR debug/63342 (ICE in loc_list_from_tree, at dwarf2out.c:14698) PR debug/63342 * dwarf2out.c (loc_list_from_tree): Handle MEM_REF with non-zero offset, TARGET_MEM_REF and SSA_NAME. * gcc.dg/pr63342.c: New test. From-SVN: r215782 --- gcc/ChangeLog | 4 ++++ gcc/dwarf2out.c | 11 +++++++++-- gcc/testsuite/ChangeLog | 3 +++ gcc/testsuite/gcc.dg/pr63342.c | 26 ++++++++++++++++++++++++++ 4 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/pr63342.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b87279f3c0f..6a59825c064 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ 2014-10-01 Jakub Jelinek + PR debug/63342 + * dwarf2out.c (loc_list_from_tree): Handle MEM_REF with non-zero + offset, TARGET_MEM_REF and SSA_NAME. + * config/i386/i386.c (expand_vec_perm_palignr): Handle 256-bit vectors for TARGET_AVX2. diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index b5fcfa43099..a64038c41a3 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -14416,15 +14416,21 @@ loc_list_from_tree (tree loc, int want_address) break; case MEM_REF: - /* ??? FIXME. */ if (!integer_zerop (TREE_OPERAND (loc, 1))) - return 0; + { + have_address = 1; + goto do_plus; + } /* Fallthru. */ case INDIRECT_REF: list_ret = loc_list_from_tree (TREE_OPERAND (loc, 0), 0); have_address = 1; break; + case TARGET_MEM_REF: + case SSA_NAME: + return NULL; + case COMPOUND_EXPR: return loc_list_from_tree (TREE_OPERAND (loc, 1), want_address); @@ -14587,6 +14593,7 @@ loc_list_from_tree (tree loc, int want_address) case POINTER_PLUS_EXPR: case PLUS_EXPR: + do_plus: if (tree_fits_shwi_p (TREE_OPERAND (loc, 1))) { list_ret = loc_list_from_tree (TREE_OPERAND (loc, 0), 0); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8f02f56b730..9936e6192ec 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2014-10-01 Jakub Jelinek + PR debug/63342 + * gcc.dg/pr63342.c: New test. + PR c++/63306 * g++.dg/ipa/pr63306.C: New test. diff --git a/gcc/testsuite/gcc.dg/pr63342.c b/gcc/testsuite/gcc.dg/pr63342.c new file mode 100644 index 00000000000..499d508c13f --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr63342.c @@ -0,0 +1,26 @@ +/* PR debug/63342 */ +/* { dg-do compile } */ +/* { dg-options "-g -O2" } */ +/* { dg-additional-options "-fpic" { target fpic } } */ + +static __thread double u[9], v[9]; + +void +foo (double **p, double **q) +{ + *p = u; + *q = v; +} + +double +bar (double x) +{ + int i; + double s = 0.0; + for (i = 0; i < 9; i++) + { + double a = x + v[i]; + s += u[i] * a * a; + } + return s; +} -- 2.30.2