This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/23372] [4.0/4.1 Regression] Temporary aggregate copy not elided when passing parameters by value
- From: "rguenth at tat dot physik dot uni-tuebingen dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Aug 2005 18:11:24 -0000
- Subject: [Bug c++/23372] [4.0/4.1 Regression] Temporary aggregate copy not elided when passing parameters by value
- References: <20050813080257.23372.guillaume.melquiond@ens-lyon.fr>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de 2005-08-13 18:11 -------
With the copy ctor we end up with
void g(A*) (a)
{
struct A D.1603;
<bb 0>:
__comp_ctor (&D.1603, a);
f (&D.1603);
return;
}
which confuses me a bit, because here the prototype of f looks like
effectively
void f(A*);
do we use ABI information here, but not in the other case? The C++
frontend in this case presents us with
{
<<cleanup_point <<< Unknown tree: expr_stmt
f (&TARGET_EXPR <D.1603, <<< Unknown tree: aggr_init_expr
__comp_ctor
0B, (struct A &) (struct A *) NON_LVALUE_EXPR <a>
D.1603 >>>
>) >>>
>>;
}
where in the case w/o the copy ctor we have
<<cleanup_point <<< Unknown tree: expr_stmt
f (TARGET_EXPR <D.1608, *(struct A &) (struct A *) NON_LVALUE_EXPR <a>>) >>>
>>;
is there some different wording about by-value parameter passing
with or without explicit copy ctor in the C++ standard?! I.e., why
isn't the above
<<cleanup_point <<< Unknown tree: expr_stmt
f (&TARGET_EXPR <D.1608, *(struct A &) (struct A *) NON_LVALUE_EXPR <a>>) >>>
>>;
?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23372