Mail Archives: djgpp/1997/05/20/12:16:19
> As far as I remember, gcc and gas indeed disagree on this. DJ reported
> this when v2 was in beta, but I don't think it was fixed.
I tried compiling the following code bit with gcc and pgcc to see what
alignment they would use (they are different). Since old versions of
gas used power of 2 aligning, and new versions use byte aligning
(so I've been told), it looks
like the problem was in the compiler. Of course, I may have my logic
reversed here somewhere, but it sounded good when I wrote it.
test.c
int junk = 1;
char more_junk = 2;
double db = 4.56;
int still_more_junk = 4;
regular gcc gives me this
.globl _junk
.data
.align 2
_junk:
.long 1
.globl _more_junk
_more_junk:
.byte 2
.globl _db
.align 2
_db:
.long 0xa3d70a3d,0x40123d70
.globl _still_more_junk
.align 2
_still_more_junk:
.long 4
pgcc this
.globl _junk
.data
.align 4
_junk:
.long 1
.globl _more_junk
_more_junk:
.byte 2
.globl _db
.align 8
_db:
.long 0xa3d70a3d,0x40123d70
.globl _still_more_junk
.align 4
_still_more_junk:
.long 4
- Raw text -