[Ilugc] Structure copy behaviour

  • From: r.ramprasad@xxxxxxxxx (ramprasad)
  • Date: Fri May 25 15:13:53 2007

On 5/25/07, Sujith Manoharan <m.sujith@xxxxxxxxx> wrote:

On Thu, 2007-05-24 at 20:21 +0530, Vaidhy wrote:
Took me a bit to find out.. but here is the reason:

gcc replaces calls to structure copy and pass by value copies with a call to
a library call (memset and memcpy). That is the reason for you getting
different assembly code for char[64] and char[68]. It is not a compile time
option you can change. However, according to what I read, the code is in
asm-i386.h in function struct_cpy. The following post might help you better
:)

http://groups.google.co.in/group/fa.linux.kernel/browse_thread/thread/78b3bcaa2ba884f0/f08a4653d7eb5908?lnk=st&q=gcc+memcpy+64+bytes&rnum=5&hl=en#



Thanks a lot for that link.
And my problem is fixed now :)


Out of curiosity, was it your intention to change gcc's behaviour in
the struct copy case
If so what files did you change and did it involve recompiling gcc ?

regards,
Sujith

_______________________________________________
To unsubscribe, email ilugc-request@xxxxxxxxxxxxx with
"unsubscribe <password> <address>"
in the subject or body of the message.
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc



-- 
Ramprasad 
R.http://www.geocities.com/ram_cse83http://www.livejournal.com/~ramprasad

Other related posts: