This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
no padding at all
- To: crossgcc at cygnus dot com
- Subject: no padding at all
- From: "Christian Groessler" <cpg at aladdin dot de>
- Date: Thu, 14 Jan 1999 22:47:37 +0100
- cc: egcs at cygnus dot com
Hello,
I've build a crosscompiler for alpha-linuxelf, hosted on i486-pc-linux.
I understand that running a compiler for a 64bit target on a 32bit host
may (will?) give suboptimal optimization. But now I've encountered a
problem, I think it's a bug(tm):
This file
/*--------*/
char *labels[] = {
"beef",
"babe",
"cafe",
"zap!"
};
/*--------*/
compiles to the following, when compiled on the alpha:
(with an older egcs version, parameters: gcc -O2 -S stralign.c -o
stralign.s)
---------
.file 1 "stralign.c"
.version "01.01"
.set noat
gcc2_compiled.:
__gnu_compiled_c:
.globl labels
.data
.align 3
.type labels,@object
labels:
.quad $LC0
.quad $LC1
.quad $LC2
.quad $LC3
.section .rodata
.align 3
$LC3:
.ascii "zap!\0"
.align 3
$LC2:
.ascii "cafe\0"
.align 3
$LC1:
.ascii "babe\0"
.align 3
$LC0:
.ascii "beef\0"
.size labels,32
.ident "GCC: (GNU) egcs-2.90.29 980515 (egcs-1.0.3 release)"
---------
Please note the "align 3" btw. the strings.
Now, compiled on the intel host for target alpha:
---------
.file 1 "stralign.c"
.set noat
.set noreorder
.globl labels
.data
.align 3
.type labels,@object
labels:
.quad $LC0
.quad $LC1
.quad $LC2
.quad $LC3
.section .rodata
$LC3:
.ascii "zap!\0"
$LC2:
.ascii "cafe\0"
$LC1:
.ascii "babe\0"
$LC0:
.ascii "beef\0"
.size labels,32
.ident "GCC: (GNU) egcs-2.91.60 19981201 (egcs-1.1.1 release)"
---------
So there is no alignment at all!
Am I to expect such behaviour, or went something wrong when
I configured/built the crosscompiler?
thanks for your help
chris