[Ilugc] Structure copy behaviour

  • From: m.sujith@xxxxxxxxx (Sujith Manoharan)
  • Date: Thu May 24 10:53:15 2007

Hi,

Say I have a structure :

typedef struct {
        ...
        ...
        ...
} tmp;

And I do this :

tmp a[256];
tmp t;

a[0] = t;

Now, for this structure copy how does gcc decide that :

1) It should generate a call to memcpy
2) Generate instructions to manually do the copy.

What is the threshold for the structure's size that changes gcc's
behaviour ?
And is there any gcc parameter to change this threshold value ?

regards,
Sujith.

Other related posts: