From 28957eabb4c25ee7f4f6cd9daa9afdf6f9164739 Mon Sep 17 00:00:00 2001
From: Richard Guenther <rguenther@suse.de>
Date: Mon, 24 Sep 2012 15:02:53 +0000
Subject: [PATCH] =?UTF-8?q?re=20PR=20lto/54632=20(not=20supported=20in=20L?=
 =?UTF-8?q?TO=20streams=20:=20tree=20code=20'=EF=BF=BDF=20=EF=BF=BD?=
 =?UTF-8?q?=EF=BF=BDD=EF=BF=BD=EF=BF=BD=20`)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

2012-09-24  Richard Guenther  <rguenther@suse.de>

	PR middle-end/54632
	* tree-ssa-live.c (clear_unused_block_pointer_1): Do not
	handle DECL_DEBUG_EXPR_IS_FROM here...
	(clear_unused_block_pointer): ... but here when walking all
	local decls.

From-SVN: r191669
---
 gcc/ChangeLog       |  8 ++++++++
 gcc/tree-ssa-live.c | 15 ++++++++++-----
 2 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 484df3673ad3..f44e5b5e5c09 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2012-09-24  Richard Guenther  <rguenther@suse.de>
+
+	PR middle-end/54632
+	* tree-ssa-live.c (clear_unused_block_pointer_1): Do not
+	handle DECL_DEBUG_EXPR_IS_FROM here...
+	(clear_unused_block_pointer): ... but here when walking all
+	local decls.
+
 2012-09-24  Richard Guenther  <rguenther@suse.de>
 
 	PR tree-optimization/54684
diff --git a/gcc/tree-ssa-live.c b/gcc/tree-ssa-live.c
index af09806a2cf7..68361454b451 100644
--- a/gcc/tree-ssa-live.c
+++ b/gcc/tree-ssa-live.c
@@ -620,11 +620,6 @@ clear_unused_block_pointer_1 (tree *tp, int *, void *)
   if (EXPR_P (*tp) && TREE_BLOCK (*tp)
       && !TREE_USED (TREE_BLOCK (*tp)))
     TREE_SET_BLOCK (*tp, NULL);
-  if (TREE_CODE (*tp) == VAR_DECL && DECL_DEBUG_EXPR_IS_FROM (*tp))
-    {
-      tree debug_expr = DECL_DEBUG_EXPR (*tp);
-      walk_tree (&debug_expr, clear_unused_block_pointer_1, NULL, NULL);
-    }
   return NULL_TREE;
 }
 
@@ -636,6 +631,16 @@ clear_unused_block_pointer ()
 {
   basic_block bb;
   gimple_stmt_iterator gsi;
+  tree t;
+  unsigned i;
+
+  FOR_EACH_LOCAL_DECL (cfun, i, t)
+    if (TREE_CODE (t) == VAR_DECL && DECL_DEBUG_EXPR_IS_FROM (t))
+      {
+	tree debug_expr = DECL_DEBUG_EXPR (t);
+	walk_tree (&debug_expr, clear_unused_block_pointer_1, NULL, NULL);
+      }
+
   FOR_EACH_BB (bb)
     for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
       {
-- 
GitLab