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,13 +822,16 @@ ocp_convert (tree type, tree expr, int convtype, int flags) ...@@ -822,13 +822,16 @@ 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)
mark_exp_read (expr);
else
{
tree exprv = expr;
while (TREE_CODE (exprv) == COMPOUND_EXPR) while (TREE_CODE (exprv) == COMPOUND_EXPR)
exprv = TREE_OPERAND (exprv, 1); exprv = TREE_OPERAND (exprv, 1);
if (DECL_P (exprv) || handled_component_p (exprv)) if (DECL_P (exprv) || handled_component_p (exprv))
...@@ -838,6 +841,7 @@ convert_to_void (tree expr, const char *implicit, tsubst_flags_t complain) ...@@ -838,6 +841,7 @@ convert_to_void (tree expr, const char *implicit, tsubst_flags_t complain)
to avoid some warnings when to avoid some warnings when
-Wunused-but-set-{variable,parameter} is in effect. */ -Wunused-but-set-{variable,parameter} is in effect. */
mark_exp_read (exprv); 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