From: Hollis Blanchard Subject: Re: [patch] pagetable cleanups Date: Thu, 14 Apr 2005 14:20:04 -0500 Message-ID: <1113506404.16993.33.camel@localhost.localdomain> References: <20050412185856.GA5832@bytesex> <20050414150150.GA28071@bytesex> <200504141548.12400.maw48@cl.cam.ac.uk> <1113503253.16993.13.camel@localhost.localdomain> <1113505660.29794.13.camel@localhost> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-K0BD+jy29FGl0FIlunt9" Return-path: In-Reply-To: <1113505660.29794.13.camel@localhost> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Anthony Liguori Cc: Michael A Fetterman , Mark Williamson , xen-devel@lists.xensource.com, Gerd Knorr List-Id: xen-devel@lists.xenproject.org --=-K0BD+jy29FGl0FIlunt9 Content-Type: text/plain Content-Transfer-Encoding: 7bit On Thu, 2005-04-14 at 14:07 -0500, Anthony Liguori wrote: > On Thu, 2005-04-14 at 13:27, Hollis Blanchard wrote: > > So no memcpys at all; the caller fills in the values directly into the > > callee's struct. > > Unless you're dealing with struct assignments. You basically get a > memcpy() when you assign structs. I have attached my testcase. Compile with -c and disassemble the object file. It is certainly possible that the callee could create a temporary struct on its stack and memcpy into the address provided by the ABI. However, even at -O0 the address of the struct is popped off the stack and used directly when assigning to structure fields. I'm using gcc 3.3.5. -- Hollis Blanchard IBM Linux Technology Center --=-K0BD+jy29FGl0FIlunt9 Content-Disposition: attachment; filename=ctest.c Content-Type: text/x-csrc; name=ctest.c; charset=utf-8 Content-Transfer-Encoding: 7bit struct foo { int i; }; extern int e; struct foo bar(void) { struct foo ret; ret.i = e + 0x5a; return ret; } int main(void) { struct foo f; f = bar(); return f.i; } --=-K0BD+jy29FGl0FIlunt9 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=-K0BD+jy29FGl0FIlunt9--