diff options
author | Jakub Jelinek <jakub@redhat.com> | 2010-06-02 21:55:33 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2010-06-02 21:55:33 +0200 |
commit | 9fc8daccc5fe380b2398a1a62b128d352d166478 (patch) | |
tree | f552cf1e3941f39f2a1330fd74162f8c490f636a /gcc/cp/cvt.c | |
parent | add86e09a5c4c09fbcf3088409a1eb60c47155db (diff) | |
download | gcc-9fc8daccc5fe380b2398a1a62b128d352d166478.zip gcc-9fc8daccc5fe380b2398a1a62b128d352d166478.tar.gz gcc-9fc8daccc5fe380b2398a1a62b128d352d166478.tar.bz2 |
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
Diffstat (limited to 'gcc/cp/cvt.c')
-rw-r--r-- | gcc/cp/cvt.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c index 646610a..71315b1 100644 --- a/gcc/cp/cvt.c +++ b/gcc/cp/cvt.c @@ -822,22 +822,26 @@ ocp_convert (tree type, tree expr, int convtype, int flags) tree convert_to_void (tree expr, const char *implicit, tsubst_flags_t complain) { - tree exprv; - if (expr == error_mark_node || TREE_TYPE (expr) == error_mark_node) return error_mark_node; - exprv = expr; - while (TREE_CODE (exprv) == COMPOUND_EXPR) - exprv = TREE_OPERAND (exprv, 1); - if (DECL_P (exprv) || handled_component_p (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 (implicit == NULL) + mark_exp_read (expr); + else + { + tree exprv = expr; + + while (TREE_CODE (exprv) == COMPOUND_EXPR) + exprv = TREE_OPERAND (exprv, 1); + if (DECL_P (exprv) || handled_component_p (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)) return expr; |