diff options
author | Jason Merrill <jason@redhat.com> | 2006-02-03 16:57:08 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2006-02-03 16:57:08 -0500 |
commit | 9b43c474f53803635b04c5b530f1ceddb13355f5 (patch) | |
tree | 53e25d711d1130e3fded2395bdbce1e6aef3db0a /gcc/gimplify.c | |
parent | 28e5f1f1151bf5ca1c77743234f08bb0e9d26174 (diff) | |
download | gcc-9b43c474f53803635b04c5b530f1ceddb13355f5.zip gcc-9b43c474f53803635b04c5b530f1ceddb13355f5.tar.gz gcc-9b43c474f53803635b04c5b530f1ceddb13355f5.tar.bz2 |
re PR c++/25979 (incorrect codegen for conditional [SVO issue])
PR c++/25979
* gimplify.c (gimplify_modify_expr_rhs): Disable *& optimization for now.
PR middle-end/25977
* gimplify.c (gimplify_modify_expr_rhs): It's not always safe to do RVO
on the return slot if it's an NRV.
From-SVN: r110565
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r-- | gcc/gimplify.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 8761609..f64b1cb 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -3190,6 +3190,7 @@ gimplify_modify_expr_rhs (tree *expr_p, tree *from_p, tree *to_p, tree *pre_p, while (ret != GS_UNHANDLED) switch (TREE_CODE (*from_p)) { +#if 0 case INDIRECT_REF: { /* If we have code like @@ -3211,6 +3212,7 @@ gimplify_modify_expr_rhs (tree *expr_p, tree *from_p, tree *to_p, tree *pre_p, ret = GS_UNHANDLED; break; } +#endif case TARGET_EXPR: { @@ -3272,8 +3274,9 @@ gimplify_modify_expr_rhs (tree *expr_p, tree *from_p, tree *to_p, tree *pre_p, bool use_target; if (TREE_CODE (*to_p) == RESULT_DECL + && DECL_NAME (*to_p) == NULL_TREE && needs_to_live_in_memory (*to_p)) - /* It's always OK to use the return slot directly. */ + /* It's OK to use the return slot directly unless it's an NRV. */ use_target = true; else if (!is_gimple_non_addressable (*to_p)) /* Don't use the original target if it's already addressable; |