This is the mail archive of the 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]


      At first one of you have replied that int variable's declared will
take 4 byte alignment. Then in the "System V ABI documentation for
intel 386 " , it is given that aggregates like structures etc..take
the alignment of most strictly aligned component..When I declare 2
int and one file pointer they took totally 12 bytes then a structure
has declared in its declaration 3 int & 2 char variables are there
int i,j;        //8 bytes
FILE *fp;       //4 bytes
  struct node
    {int a;
     int b;
     char c;
     int d;
     char e;
  accordig to the ABI documentation (by considering tail & internal
padding) it should take 20 bytes. And it is assigned at offset -48 (int
a) to offset -32 (char e). In between 16 bytes has been skipped.Why is
this happening? if I remove one var (for ex: int b) it will start from
-32 to -20? why this alignment to multiple of 16?

   here target is pentium 3.

  Is RTL representation  dependent on GCC version? In linux 9 gcc version
was 3.2.2 and in linux 7 GCC version was 2.96 and both system is using
same target  pentium 3. and there is slight variation in the RTL file
generated. is it due to change in gcc version or anything else?

                                                  Thanking you,
                                                             SRUTHY C.N.

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