]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR lto/56570 (ICE when streaming a TREE_BLOCK)
authorRichard Biener <rguenther@suse.de>
Fri, 8 Mar 2013 13:46:18 +0000 (13:46 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 8 Mar 2013 13:46:18 +0000 (13:46 +0000)
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.

From-SVN: r196546

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

index 4002376f8f9f991c62d2600c345fb9edfbfcd101..6fb40c94840fb568d4bf93fd1e0866f54d7884cd 100644 (file)
@@ -1,3 +1,11 @@
+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
index 7be44e42e4b1aef1f99268532d66ab5cfd1948ab..5466e8b43a1f15797ab3f56ee0244a17ede4cace 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 67212c204c46b3cf81520e2c97d38177ed24d5df..35dcd43271233680bc39738bfb70ee0a2019ab0b 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);