This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
fold_builtin_memcpy cannot optimize <retval>?
- From: Richard Guenther <rguenth at tat dot physik dot uni-tuebingen dot de>
- To: gcc at gcc dot gnu dot org
- Date: Fri, 21 Jan 2005 11:38:37 +0100 (CET)
- Subject: fold_builtin_memcpy cannot optimize <retval>?
The simple testcase
struct Foo {};
Foo bar(const Foo& a)
{
Foo res;
res = a;
return res;
}
leaves us with
Foo bar(const Foo&) (a)
{
struct Foo res;
# BLOCK 0
# PRED: ENTRY [100.0%] (fallthru,exec)
__builtin_memcpy (&<retval>, a_1, 0);
return <retval>;
# SUCC: EXIT [100.0%]
}
in the optimized tree-dump and obviously ugly asm code.
What's going on here?
Richard.
--
Richard Guenther <richard dot guenther at uni-tuebingen dot de>
WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/