re PR debug/44115 (gcc.dg/guality/sra-1.c failure)

2010-09-10  Richard Guenther  <rguenther@suse.de>

	PR debug/44115
	* tree.c (free_lang_data_in_decl): Do not clear DECL_DEBUG_EXPR.
	* lto-streamer-out.c (lto_output_ts_decl_common_tree_pointers):
	Output DECL_DEBUG_EXPR.
	* lto-streamer-in.c (lto_input_ts_decl_common_tree_pointers):
	Input DECL_DEBUG_EXPR.

From-SVN: r164179
This commit is contained in:
Richard Guenther 2010-09-10 14:22:22 +00:00 committed by Richard Biener
parent 2dd3121f9e
commit e836611d71
4 changed files with 19 additions and 6 deletions

View File

@ -1,3 +1,12 @@
2010-09-10 Richard Guenther <rguenther@suse.de>
PR debug/44115
* tree.c (free_lang_data_in_decl): Do not clear DECL_DEBUG_EXPR.
* lto-streamer-out.c (lto_output_ts_decl_common_tree_pointers):
Output DECL_DEBUG_EXPR.
* lto-streamer-in.c (lto_input_ts_decl_common_tree_pointers):
Input DECL_DEBUG_EXPR.
2010-09-10 Richard Guenther <rguenther@suse.de>
* tree.c (type_hash_eq): For ARRAY_TYPEs also compare

View File

@ -1932,6 +1932,13 @@ lto_input_ts_decl_common_tree_pointers (struct lto_input_block *ib,
|| TREE_CODE (expr) == PARM_DECL)
&& DECL_HAS_VALUE_EXPR_P (expr))
SET_DECL_VALUE_EXPR (expr, lto_input_tree (ib, data_in));
if (TREE_CODE (expr) == VAR_DECL)
{
tree dexpr = lto_input_tree (ib, data_in);
if (dexpr)
SET_DECL_DEBUG_EXPR (expr, dexpr);
}
}

View File

@ -861,6 +861,9 @@ lto_output_ts_decl_common_tree_pointers (struct output_block *ob, tree expr,
|| TREE_CODE (expr) == PARM_DECL)
&& DECL_HAS_VALUE_EXPR_P (expr))
lto_output_tree_or_ref (ob, DECL_VALUE_EXPR (expr), ref_p);
if (TREE_CODE (expr) == VAR_DECL)
lto_output_tree_or_ref (ob, DECL_DEBUG_EXPR (expr), ref_p);
}

View File

@ -4540,12 +4540,6 @@ free_lang_data_in_decl (tree decl)
}
else if (TREE_CODE (decl) == VAR_DECL)
{
tree expr = DECL_DEBUG_EXPR (decl);
if (expr
&& TREE_CODE (expr) == VAR_DECL
&& !TREE_STATIC (expr) && !DECL_EXTERNAL (expr))
SET_DECL_DEBUG_EXPR (decl, NULL_TREE);
if (DECL_EXTERNAL (decl)
&& (!TREE_STATIC (decl) || !TREE_READONLY (decl)))
DECL_INITIAL (decl) = NULL_TREE;