This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]