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]

Re: Structure Return Testcase



  In message <20010315125014.B22466@redhat.com>you write:
  > 
  > Incidentally, there is an outstanding patch from Loren James Rittle
  > 
  >   http://gcc.gnu.org/ml/gcc-patches/2001-03/msg00272.html
  > 
  > to use memmove for this instance.  He keys the use of memmove on
  > seeing a RESULT_DECL, but it seems much cleaner to generate something
  > other than a MODIFY_EXPR with the proper semantics.
Do we think it makes more sense to use memmove or to do the copy through
a temporary?

Also note Loren's patch pessimizes basic structure copies, which probably
is bad.

One of the things I was playing with was actually detecting when we had
a potential overlap between the return value and the args and use that to
trigger a direct copy vs copy through a temporary.  But I haven't been
happy with how my experiments have worked out yet.

There's a reasonably good place to get control in calls.c and select the
type of copy you want (direct or through temporary).  The only trick is
the "can the lhs overlap an argument to the function" problem.

jeff


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