OSDN Git Service

2013-03-08 Richard Biener <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 8 Mar 2013 13:46:18 +0000 (13:46 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 8 Mar 2013 13:46:18 +0000 (13:46 +0000)
PR tree-optimization/56570
* tree-cfg.c (verify_expr_location_1): Verify locations for
DECL_DEBUG_EXPR.
* tree-sra.c (create_access_replacement): Strip locations
from DECL_DEBUG_EXPRs.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@196546 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/tree-cfg.c
gcc/tree-sra.c

index 4002376..6fb40c9 100644 (file)
@@ -1,5 +1,13 @@
 2013-03-08  Richard Biener  <rguenther@suse.de>
 
+       PR tree-optimization/56570
+       * tree-cfg.c (verify_expr_location_1): Verify locations for
+       DECL_DEBUG_EXPR.
+       * tree-sra.c (create_access_replacement): Strip locations
+       from DECL_DEBUG_EXPRs.
+
+2013-03-08  Richard Biener  <rguenther@suse.de>
+
        * tree-inline.c (expand_call_inline): Do not associate
        a BLOCK with the location in BLOCK_SOURCE_LOCATION.
        * tree-cfg.c (verify_location): Verify BLOCK_SOURCE_LOCATION.
index 7be44e4..5466e8b 100644 (file)
@@ -4523,6 +4523,15 @@ verify_expr_location_1 (tree *tp, int *walk_subtrees, void *data)
 {
   struct pointer_set_t *blocks = (struct pointer_set_t *) data;
 
+  if (TREE_CODE (*tp) == VAR_DECL
+      && DECL_DEBUG_EXPR_IS_FROM (*tp))
+    {
+      tree t = DECL_DEBUG_EXPR (*tp);
+      tree addr = walk_tree (&t, verify_expr_location_1, blocks, NULL);
+      if (addr)
+       return addr;
+    }
+
   if (!EXPR_P (*tp))
     {
       *walk_subtrees = false;
index 67212c2..35dcd43 100644 (file)
@@ -1917,7 +1917,7 @@ create_access_replacement (struct access *access)
       && !DECL_ARTIFICIAL (access->base))
     {
       char *pretty_name = make_fancy_name (access->expr);
-      tree debug_expr = unshare_expr (access->expr), d;
+      tree debug_expr = unshare_expr_without_location (access->expr), d;
       bool fail = false;
 
       DECL_NAME (repl) = get_identifier (pretty_name);