summaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2012-10-26 19:19:25 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2012-10-26 19:19:25 +0000
commit8afb7c4b8a5f9f158e32723a7cf0ed0f514ecea7 (patch)
tree007004e6f0b36e0efb8b580543d475b492da6928 /gcc/dwarf2out.c
parent49ef567352f7f2a333589c6a4b906e3d8fc6950a (diff)
downloadgcc-8afb7c4b8a5f9f158e32723a7cf0ed0f514ecea7.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@192860 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 6442edd85f9..24c75065656 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -4622,7 +4622,10 @@ add_var_loc_to_decl (tree decl, rtx loc_note, const char *label)
if (DECL_DEBUG_EXPR_IS_FROM (decl))
{
tree realdecl = DECL_DEBUG_EXPR (decl);
- if (realdecl && handled_component_p (realdecl))
+ if (realdecl
+ && (handled_component_p (realdecl)
+ || (TREE_CODE (realdecl) == MEM_REF
+ && TREE_CODE (TREE_OPERAND (realdecl, 0)) == ADDR_EXPR)))
{
HOST_WIDE_INT maxsize;
tree innerdecl;