]> gcc.gnu.org Git - gcc.git/commitdiff
re PR debug/25562 (cannot debug VLA local)
authorJakub Jelinek <jakub@redhat.com>
Wed, 4 Jan 2006 08:05:29 +0000 (09:05 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 4 Jan 2006 08:05:29 +0000 (09:05 +0100)
PR debug/25562
* function.c (instantiate_expr): New function.
(instantiate_decls_1, instantiate_decls): If DECL_HAS_VALUE_EXPR_P,
walk its DECL_VALUE_EXPR with instantiate_expr.

* dwarf2out.c (loc_descriptor_from_tree_1): Don't add
DW_OP_deref{,_size} if address isn't going to be added.

From-SVN: r109315

gcc/ChangeLog
gcc/dwarf2out.c
gcc/function.c

index 252537f605a4adc83b3ecd1e9fdddcd4e7b9c40a..c4f8b626fe21ff959f7c6098de02276e29d1e05e 100644 (file)
@@ -1,3 +1,13 @@
+2006-01-04  Jakub Jelinek  <jakub@redhat.com>
+
+       PR debug/25562
+       * function.c (instantiate_expr): New function.
+       (instantiate_decls_1, instantiate_decls): If DECL_HAS_VALUE_EXPR_P,
+       walk its DECL_VALUE_EXPR with instantiate_expr.
+
+       * dwarf2out.c (loc_descriptor_from_tree_1): Don't add
+       DW_OP_deref{,_size} if address isn't going to be added.
+
 2006-01-04  Ben Elliston  <bje@au.ibm.com>
 
        * config/fp-bit.h: Use top-of-file comment from libgcc2.c.
index 868333d46e0f9a47c2cc2aafee30706a948fe5ad..572bfc9a5bee7e9187e052fc38485f9193f09dac 100644 (file)
@@ -9420,7 +9420,7 @@ loc_descriptor_from_tree_1 (tree loc, int want_address)
     return 0;
 
   /* If we've got an address and don't want one, dereference.  */
-  if (!want_address && have_address)
+  if (!want_address && have_address && ret)
     {
       HOST_WIDE_INT size = int_size_in_bytes (TREE_TYPE (loc));
 
index 0ece698f859fc5c1309c1cedeb752abd215b7fb3..f5da84c8241288fde9672f36934e84af504d49fe 100644 (file)
@@ -1590,6 +1590,22 @@ instantiate_decl (rtx x)
   for_each_rtx (&XEXP (x, 0), instantiate_virtual_regs_in_rtx, NULL);
 }
 
+/* Helper for instantiate_decls called via walk_tree: Process all decls
+   in the given DECL_VALUE_EXPR.  */
+
+static tree
+instantiate_expr (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
+{
+  tree t = *tp;
+  if (! EXPR_P (t))
+    {
+      *walk_subtrees = 0;
+      if (DECL_P (t) && DECL_RTL_SET_P (t))
+       instantiate_decl (DECL_RTL (t));
+    }
+  return NULL;
+}
+
 /* Subroutine of instantiate_decls: Process all decls in the given
    BLOCK node and all its subblocks.  */
 
@@ -1599,8 +1615,15 @@ instantiate_decls_1 (tree let)
   tree t;
 
   for (t = BLOCK_VARS (let); t; t = TREE_CHAIN (t))
-    if (DECL_RTL_SET_P (t))
-      instantiate_decl (DECL_RTL (t));
+    {
+      if (DECL_RTL_SET_P (t))
+       instantiate_decl (DECL_RTL (t));
+      if (TREE_CODE (t) == VAR_DECL && DECL_HAS_VALUE_EXPR_P (t))
+       {
+         tree v = DECL_VALUE_EXPR (t);
+         walk_tree (&v, instantiate_expr, NULL, NULL);
+       }
+    }
 
   /* Process all subblocks.  */
   for (t = BLOCK_SUBBLOCKS (let); t; t = TREE_CHAIN (t))
@@ -1620,6 +1643,11 @@ instantiate_decls (tree fndecl)
     {
       instantiate_decl (DECL_RTL (decl));
       instantiate_decl (DECL_INCOMING_RTL (decl));
+      if (DECL_HAS_VALUE_EXPR_P (decl))
+       {
+         tree v = DECL_VALUE_EXPR (decl);
+         walk_tree (&v, instantiate_expr, NULL, NULL);
+       }
     }
 
   /* Now process all variables defined in the function or its subblocks.  */
This page took 0.072079 seconds and 5 git commands to generate.