diff options
author | Richard Henderson <rth@redhat.com> | 2004-01-04 21:37:06 -0800 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2004-01-04 21:37:06 -0800 |
commit | 88401f735c0c4f52b1e597b45c15984f3bebbce1 (patch) | |
tree | 90273444b22f82fd59e99f31408bcc2791a35e19 /gcc/cp | |
parent | 2b6c260d73d6cb17d85c508a646b69240bcd1f28 (diff) | |
download | gcc-88401f735c0c4f52b1e597b45c15984f3bebbce1.zip gcc-88401f735c0c4f52b1e597b45c15984f3bebbce1.tar.gz gcc-88401f735c0c4f52b1e597b45c15984f3bebbce1.tar.bz2 |
call.c (build_over_call): Don't create a save_expr of an aggregate, but rather its address.
* call.c (build_over_call): Don't create a save_expr of an
aggregate, but rather its address.
From-SVN: r75414
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/call.c | 24 |
2 files changed, 20 insertions, 9 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index aac96ee..7ca4f9c 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2004-01-04 Richard Henderson <rth@redhat.com> + + * call.c (build_over_call): Don't create a save_expr of an + aggregate, but rather its address. + 2004-01-04 Mark Mitchell <mark@codesourcery.com> PR c++/13529 diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 46ebca5..26ca488 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -4667,18 +4667,24 @@ build_over_call (struct z_candidate *cand, int flags) { /* We must only copy the non-tail padding parts. Use CLASSTYPE_AS_BASE for the bitwise copy. */ - tree to_as_base, arg_as_base, base_ptr_type; + tree to_ptr, arg_ptr, to_as_base, arg_as_base, base_ptr_type; + tree save_to; + + to_ptr = save_expr (build_unary_op (ADDR_EXPR, to, 0)); + arg_ptr = build_unary_op (ADDR_EXPR, arg, 0); - to = save_expr (to); base_ptr_type = build_pointer_type (as_base); - to_as_base = build_indirect_ref - (build_nop (base_ptr_type, build_unary_op (ADDR_EXPR, to, 0)), 0); - arg_as_base = build_indirect_ref - (build_nop (base_ptr_type, build_unary_op (ADDR_EXPR, arg, 0)), 0); - + to_as_base = build_nop (base_ptr_type, to_ptr); + to_as_base = build_indirect_ref (to_as_base, 0); + arg_as_base = build_nop (base_ptr_type, arg_ptr); + arg_as_base = build_indirect_ref (arg_as_base, 0); + + save_to = build_indirect_ref (to_ptr, 0); + val = build (MODIFY_EXPR, as_base, to_as_base, arg_as_base); - val = build (COMPOUND_EXPR, type, convert_to_void (val, NULL), to); - TREE_USED (val) = 1; + val = convert_to_void (val, NULL); + val = build (COMPOUND_EXPR, type, val, save_to); + TREE_NO_UNUSED_WARNING (val) = 1; } return val; |