delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/05/20/12:16:19

From: Andrew Crabtree <andrewc AT typhoon DOT rose DOT hp DOT com>
Message-Id: <199705201614.AA183124895@typhoon.rose.hp.com>
Subject: Re: -m486 alignment problem
To: eliz AT is DOT elta DOT co DOT il (Eli Zaretskii)
Date: Tue, 20 May 1997 9:14:55 PDT
Cc: djgpp AT delorie DOT com
In-Reply-To: <Pine.SUN.3.91.970520180101.22684G-100000@is>; from "Eli Zaretskii" at May 20, 97 6:04 pm

> 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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019