aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-sra.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2012-10-26 21:19:25 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2012-10-26 21:19:25 +0200
commit9430b7bad813a444e6a7e35d6b5f92d2b99f40cf (patch)
tree007004e6f0b36e0efb8b580543d475b492da6928 /gcc/tree-sra.c
parentc88538b7436c2e46f308b9b3410f04572078c2ae (diff)
downloadgcc-9430b7bad813a444e6a7e35d6b5f92d2b99f40cf.zip
gcc-9430b7bad813a444e6a7e35d6b5f92d2b99f40cf.tar.gz
gcc-9430b7bad813a444e6a7e35d6b5f92d2b99f40cf.tar.bz2
re PR debug/54970 (Missing DW_OP_GNU_implicit_pointer in debuginfo)
PR debug/54970 * cfgexpand.c (expand_debug_expr): Expand &MEM_REF[&var, n] as DEBUG_IMPLICIT_PTR + n if &var expands to DEBUG_IMPLICIT_PTR. * tree-sra.c (create_access_replacement): Allow also MEM_REFs with ADDR_EXPR first operand in DECL_DEBUG_EXPR expressions. * var-tracking.c (track_expr_p): Handle MEM_REFs in DECL_DEBUG_EXPR expressions. * dwarf2out.c (add_var_loc_to_decl): Likewise. PR debug/54971 * gcc.dg/guality/pr54970.c: New test. From-SVN: r192860
Diffstat (limited to 'gcc/tree-sra.c')
-rw-r--r--gcc/tree-sra.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index 65b5ef5..bf1a0f2 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -1,7 +1,7 @@
/* Scalar Replacement of Aggregates (SRA) converts some structure
references into scalar references, exposing them to the scalar
optimizers.
- Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
Contributed by Martin Jambor <mjambor@suse.cz>
This file is part of GCC.
@@ -1941,7 +1941,8 @@ create_access_replacement (struct access *access)
and that get_ref_base_and_extent works properly on the
expression. It cannot handle accesses at a non-constant offset
though, so just give up in those cases. */
- for (d = debug_expr; !fail && handled_component_p (d);
+ for (d = debug_expr;
+ !fail && (handled_component_p (d) || TREE_CODE (d) == MEM_REF);
d = TREE_OPERAND (d, 0))
switch (TREE_CODE (d))
{
@@ -1959,6 +1960,12 @@ create_access_replacement (struct access *access)
&& TREE_CODE (TREE_OPERAND (d, 2)) != INTEGER_CST)
fail = true;
break;
+ case MEM_REF:
+ if (TREE_CODE (TREE_OPERAND (d, 0)) != ADDR_EXPR)
+ fail = true;
+ else
+ d = TREE_OPERAND (d, 0);
+ break;
default:
break;
}