Commit 9fc8dacc by Jakub Jelinek Committed by Jakub Jelinek

re PR debug/44367 (-O0 -g wrong DW_AT_location on c++ class retval)

	PR debug/44367
	* semantics.c (finalize_nrv): Don't copy DECL_ARTIFICIAL, DECL_IGNORED_P,
	DECL_SOURCE_LOCATION and DECL_ABSTRACT_ORIGIN from var to result.
	Set DECL_VALUE_EXPR on var.

From-SVN: r160187
parent add86e09
...@@ -10,6 +10,11 @@ ...@@ -10,6 +10,11 @@
DECL_SOURCE_LOCATION and DECL_ABSTRACT_ORIGIN from var to result. DECL_SOURCE_LOCATION and DECL_ABSTRACT_ORIGIN from var to result.
Set DECL_VALUE_EXPR on var. Set DECL_VALUE_EXPR on var.
PR debug/44367
* semantics.c (finalize_nrv): Don't copy DECL_ARTIFICIAL, DECL_IGNORED_P,
DECL_SOURCE_LOCATION and DECL_ABSTRACT_ORIGIN from var to result.
Set DECL_VALUE_EXPR on var.
2010-06-02 Jason Merrill <jason@redhat.com> 2010-06-02 Jason Merrill <jason@redhat.com>
* error.c (dump_type): Improve typedef handling. * error.c (dump_type): Improve typedef handling.
......
...@@ -822,22 +822,26 @@ ocp_convert (tree type, tree expr, int convtype, int flags) ...@@ -822,22 +822,26 @@ ocp_convert (tree type, tree expr, int convtype, int flags)
tree tree
convert_to_void (tree expr, const char *implicit, tsubst_flags_t complain) convert_to_void (tree expr, const char *implicit, tsubst_flags_t complain)
{ {
tree exprv;
if (expr == error_mark_node if (expr == error_mark_node
|| TREE_TYPE (expr) == error_mark_node) || TREE_TYPE (expr) == error_mark_node)
return error_mark_node; return error_mark_node;
exprv = expr; if (implicit == NULL)
while (TREE_CODE (exprv) == COMPOUND_EXPR) mark_exp_read (expr);
exprv = TREE_OPERAND (exprv, 1); else
if (DECL_P (exprv) || handled_component_p (exprv)) {
/* Expr is not being 'used' here, otherwise we whould have tree exprv = expr;
called mark_{rl}value_use use here, which would have in turn
called mark_exp_read. Rather, we call mark_exp_read directly while (TREE_CODE (exprv) == COMPOUND_EXPR)
to avoid some warnings when exprv = TREE_OPERAND (exprv, 1);
-Wunused-but-set-{variable,parameter} is in effect. */ if (DECL_P (exprv) || handled_component_p (exprv))
mark_exp_read (exprv); /* Expr is not being 'used' here, otherwise we whould have
called mark_{rl}value_use use here, which would have in turn
called mark_exp_read. Rather, we call mark_exp_read directly
to avoid some warnings when
-Wunused-but-set-{variable,parameter} is in effect. */
mark_exp_read (exprv);
}
if (!TREE_TYPE (expr)) if (!TREE_TYPE (expr))
return expr; return expr;
......
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