Commit f8cca67b by Jakub Jelinek Committed by Jakub Jelinek

re PR debug/50317 (missing DW_OP_GNU_implicit_pointer)

	PR debug/50317
	* tree-ssa.c (target_for_debug_bind): Also allow is_gimple_reg_type
	vars that aren't referenced.
	(tree-ssa-live.c (remove_unused_locals): Don't clear TREE_ADDRESSABLE
	of unreferenced local vars.
	* cfgexpand.c (expand_debug_expr): For DEBUG_IMPLICIT_PTR allow also
	TREE_ADDRESSABLE vars that satisfy target_for_debug_bind.

From-SVN: r181971
parent a8028a3e
2011-12-03 Jakub Jelinek <jakub@redhat.com>
PR debug/50317
* tree-ssa.c (target_for_debug_bind): Also allow is_gimple_reg_type
vars that aren't referenced.
(tree-ssa-live.c (remove_unused_locals): Don't clear TREE_ADDRESSABLE
of unreferenced local vars.
* cfgexpand.c (expand_debug_expr): For DEBUG_IMPLICIT_PTR allow also
TREE_ADDRESSABLE vars that satisfy target_for_debug_bind.
2011-12-03 Anatoly Sokolov <aesok@post.ru> 2011-12-03 Anatoly Sokolov <aesok@post.ru>
* config/arm/arm.h (LIBCALL_VALUE, FUNCTION_VALUE_REGNO_P): Remove. * config/arm/arm.h (LIBCALL_VALUE, FUNCTION_VALUE_REGNO_P): Remove.
...@@ -3325,7 +3325,8 @@ expand_debug_expr (tree exp) ...@@ -3325,7 +3325,8 @@ expand_debug_expr (tree exp)
if ((TREE_CODE (TREE_OPERAND (exp, 0)) == VAR_DECL if ((TREE_CODE (TREE_OPERAND (exp, 0)) == VAR_DECL
|| TREE_CODE (TREE_OPERAND (exp, 0)) == PARM_DECL || TREE_CODE (TREE_OPERAND (exp, 0)) == PARM_DECL
|| TREE_CODE (TREE_OPERAND (exp, 0)) == RESULT_DECL) || TREE_CODE (TREE_OPERAND (exp, 0)) == RESULT_DECL)
&& !TREE_ADDRESSABLE (TREE_OPERAND (exp, 0))) && (!TREE_ADDRESSABLE (TREE_OPERAND (exp, 0))
|| target_for_debug_bind (TREE_OPERAND (exp, 0))))
return gen_rtx_DEBUG_IMPLICIT_PTR (mode, TREE_OPERAND (exp, 0)); return gen_rtx_DEBUG_IMPLICIT_PTR (mode, TREE_OPERAND (exp, 0));
if (handled_component_p (TREE_OPERAND (exp, 0))) if (handled_component_p (TREE_OPERAND (exp, 0)))
...@@ -3337,7 +3338,8 @@ expand_debug_expr (tree exp) ...@@ -3337,7 +3338,8 @@ expand_debug_expr (tree exp)
if ((TREE_CODE (decl) == VAR_DECL if ((TREE_CODE (decl) == VAR_DECL
|| TREE_CODE (decl) == PARM_DECL || TREE_CODE (decl) == PARM_DECL
|| TREE_CODE (decl) == RESULT_DECL) || TREE_CODE (decl) == RESULT_DECL)
&& !TREE_ADDRESSABLE (decl) && (!TREE_ADDRESSABLE (decl)
|| target_for_debug_bind (decl))
&& (bitoffset % BITS_PER_UNIT) == 0 && (bitoffset % BITS_PER_UNIT) == 0
&& bitsize > 0 && bitsize > 0
&& bitsize == maxsize) && bitsize == maxsize)
......
...@@ -814,15 +814,7 @@ remove_unused_locals (void) ...@@ -814,15 +814,7 @@ remove_unused_locals (void)
bitmap_set_bit (global_unused_vars, DECL_UID (var)); bitmap_set_bit (global_unused_vars, DECL_UID (var));
} }
else else
{ continue;
/* For unreferenced local vars drop TREE_ADDRESSABLE
bit in case it is referenced from debug stmts. */
if (DECL_CONTEXT (var) == current_function_decl
&& TREE_ADDRESSABLE (var)
&& is_gimple_reg_type (TREE_TYPE (var)))
TREE_ADDRESSABLE (var) = 0;
continue;
}
} }
else if (TREE_CODE (var) == VAR_DECL else if (TREE_CODE (var) == VAR_DECL
&& DECL_HARD_REGISTER (var) && DECL_HARD_REGISTER (var)
......
...@@ -264,7 +264,12 @@ target_for_debug_bind (tree var) ...@@ -264,7 +264,12 @@ target_for_debug_bind (tree var)
return NULL_TREE; return NULL_TREE;
if (!is_gimple_reg (var)) if (!is_gimple_reg (var))
return NULL_TREE; {
if (is_gimple_reg_type (TREE_TYPE (var))
&& referenced_var_lookup (cfun, DECL_UID (var)) == NULL_TREE)
return var;
return NULL_TREE;
}
return var; return var;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment