This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
powerpc-ibm-aix4.3.2.0: execution of gcc.c-torture/execute/struct-ret-1.c failled with SIGILL.
- From: "Thibaud Tortech" <tortech at nortelnetworks dot com>
- To: gcc at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org
- Date: Thu, 05 Dec 2002 15:03:24 +0100
- Subject: powerpc-ibm-aix4.3.2.0: execution of gcc.c-torture/execute/struct-ret-1.c failled with SIGILL.
- Organization: Nortel Networks
Hi all,
I'm trying to build a cross compiler (sparc-sun-solaris2.6 ->
powerpc-ibm-aix4.3.2). I'm using the gnu binutils 2.13.1 and gcc version
3.3 20021202 (experimental)
gcc was configured with:
/var/tmp/tortech/GNU/gcc-20021202/configure --prefix=/var/tmp/aix
--target=powerpc-ibm-aix4.3.2 --disable-shared --enable-threads
--enable-checking --with-gnu-ld --with-gnu-as
--with-as=/var/tmp/aix/bin/powerpc-ibm-aix4.3.2-as
--with-ld=/var/tmp/aix/bin/powerpc-ibm-aix4.3.2-ld --enable-languages=c
--with-headers=../aix-include --with-libs=../aix-lib --disable-nls
--disable-multilib
If I execute the following command:
make check-gcc RUNTESTFLAGS="-all execute.exp=struct-ret-1*"
I've got the corresponding gcc.sum file:
Test Run By tortech on Thu Dec 5 11:16:53 2002
Target is powerpc-ibm-aix4.3.2
Host is sparc-sun-solaris2.6
=== gcc tests ===
Schedule of variations:
aix
Running target aix
Running
/var/tmp/tortech/GNU/gcc-20021202/gcc/testsuite/gcc.c-torture/execute/execute.exp
...
PASS: gcc.c-torture/execute/struct-ret-1.c compilation, -O0
FAIL: gcc.c-torture/execute/struct-ret-1.c execution, -O0
PASS: gcc.c-torture/execute/struct-ret-1.c compilation, -O1
FAIL: gcc.c-torture/execute/struct-ret-1.c execution, -O1
PASS: gcc.c-torture/execute/struct-ret-1.c compilation, -O2
FAIL: gcc.c-torture/execute/struct-ret-1.c execution, -O2
PASS: gcc.c-torture/execute/struct-ret-1.c compilation, -O3
-fomit-frame-pointer
PASS: gcc.c-torture/execute/struct-ret-1.c execution, -O3
-fomit-frame-pointer
PASS: gcc.c-torture/execute/struct-ret-1.c compilation, -O3 -g
PASS: gcc.c-torture/execute/struct-ret-1.c execution, -O3 -g
PASS: gcc.c-torture/execute/struct-ret-1.c compilation, -Os
FAIL: gcc.c-torture/execute/struct-ret-1.c execution, -Os
=== gcc Summary ===
# of expected passes 8
# of unexpected failures 4
/var/tmp/tortech/GNU/aix-gcc-ss/gcc/xgcc version 3.3 20021202
(experimental)
Every time the execution test failed, the program was terminated with
the SIGILL signal.
But, if I add the -g flag in the compilation line, the program execution
is OK in all cases.
I found that the incriminating line is:
line #52: Xr = (*fp) (B1, c2, d3, B2); (fp points to function f)
If I do a "powerpc-ibm-aix4.3.2-objdump -D -l" on the object file
generated by using -O0 and -g, I've got the following result for fp and
f:
0000000000000428 <fp>:
428: 00 00 04 30 .long 0x430
42c: 00 00 02 c0 .long 0x2c0
0000000000000430 <f>:
430: 00 00 00 00 .long 0x0
434: 00 00 03 00 .long 0x300
438: 00 00 00 00 .long 0x0
The same command on the object file generated with -O0 only, gives the
following result:
0000000000000408 <fp>:
408: 00 00 04 32 .long 0x432
40c: 00 00 02 c0 .long 0x2c0
0000000000000432 <f>:
...
43a: 03 00 00 00 .long 0x3000000
...
It seems that the address stored in fp is wrong in that case (alignement
problem?)
The attached assembler file was generated with -O0 and without -g.
Thank you,
Thibaud Tortech.
.file "/var/tmp/tortech/GNU/gcc-20021202/gcc/testsuite/gcc.c-torture/execute/struct-ret-1.c"
.toc
.csect .text[PR]
.globl c1
.csect .data[RW],3
c1:
.byte 97
.globl c2
c2:
.byte 127
.globl c3
c3:
.byte -128
.globl c4
c4:
.byte -1
.globl c5
c5:
.byte -1
.globl d1
.align 3
d1:
.long 1069128089
.long -1717986918
.globl d2
.align 3
d2:
.long 1070176665
.long -1717986918
.globl d3
.align 3
d3:
.long 1070805811
.long 858993459
.globl d4
.align 3
d4:
.long 1071225241
.long -1717986918
.globl d5
.align 3
d5:
.long 1071644672
.long 0
.globl d6
.align 3
d6:
.long 1071854387
.long 858993459
.globl d7
.align 3
d7:
.long 1072064102
.long 1717986918
.globl d8
.align 3
d8:
.long 1072273817
.long -1717986918
.globl d9
.align 3
d9:
.long 1072483532
.long -858993459
.globl B1
.align 3
B1:
.long 1069128089
.long -1717986918
.long 1
.long 2
.long 3
.space 4
.globl B2
.align 3
B2:
.long 1070176665
.long -1717986918
.long 5
.long 4
.long 3
.space 4
.globl X1
X1:
.byte "abcdefghijklmnopqrstuvwxyzABCDEF"
.byte 0
.byte 71
.globl X2
X2:
.byte "123"
.byte 0
.space 29
.byte 57
.globl X3
X3:
.byte "return-return-return"
.byte 0
.space 12
.byte 82
.csect _structret1.rw_c[RW],3
xr.0:
.byte "return val"
.byte 0
.space 22
.byte 82
.csect _structret1.rw_c[RO],3
.align 2
LC..1:
.byte "X f(B,char,double,B):({%g,{%d,%d,%d}},'%c',%g,{%g,{%d,%d,%d}})"
.byte 0
.toc
LC..0:
.tc xr.0[TC],xr.0
LC..2:
.tc out[TC],out
LC..3:
.tc LC..1[TC],LC..1
.csect .text[PR]
.align 2
.globl f
.globl .f
.csect f[DS]
f:
.long .f, TOC[tc0], 0
.csect .text[PR]
.f:
.extern __mulh
.extern __mull
.extern __divss
.extern __divus
.extern __quoss
.extern __quous
mflr 0
stw 29,-12(1)
stw 31,-4(1)
stw 0,8(1)
stwu 1,-160(1)
mr 31,1
mr 29,3
stw 4,188(31)
stw 5,192(31)
stw 6,196(31)
stw 7,200(31)
stw 8,204(31)
stw 9,208(31)
mr 0,10
stfd 1,88(31)
stb 0,212(31)
lwz 0,LC..0(2)
addi 9,31,96
li 11,34
mr 3,9
mr 4,0
mr 5,11
bl .memcpy
nop
lbz 0,212(31)
stb 0,129(31)
lbz 0,212(31)
rlwinm 11,0,0,0xff
lfd 0,88(31)
stfd 0,56(1)
lfd 0,224(31)
stfd 0,64(1)
lwz 0,232(31)
stw 0,72(1)
lwz 0,236(31)
stw 0,76(1)
lwz 0,240(31)
stw 0,80(1)
lwz 3,LC..2(2)
lwz 4,LC..3(2)
lwz 9,188(31)
lwz 10,192(31)
lfd 0,188(31)
mr 5,9
mr 6,10
fmr 1,0
lwz 7,196(31)
lwz 8,200(31)
lwz 9,204(31)
mr 10,11
lfd 0,56(1)
fmr 2,0
lfd 0,64(1)
fmr 3,0
bl .sprintf
nop
mr 0,29
addi 9,31,96
li 11,34
mr 3,0
mr 4,9
mr 5,11
bl .memcpy
nop
mr 3,29
lwz 1,0(1)
lwz 0,8(1)
mtlr 0
lwz 29,-12(1)
lwz 31,-4(1)
blr
LT..f:
.long 0
.byte 0,0,32,97,128,3,1,3
.long 805306368
.long LT..f-.f
.short 1
.byte "f"
.byte 31
.align 2
.globl fp
.csect .data[RW],3
.align 2
fp:
.long f
.toc
LC..4:
.tc B1[TC],B1
LC..5:
.tc c2[TC],c2
LC..6:
.tc d3[TC],d3
LC..7:
.tc B2[TC],B2
.set LC..8,LC..2
LC..9:
.tc fp[TC],fp
.csect .text[PR]
.align 2
.globl main
.globl .main
.csect main[DS]
main:
.long .main, TOC[tc0], 0
.csect .text[PR]
.main:
mflr 0
stw 28,-16(1)
stw 29,-12(1)
stw 31,-4(1)
stw 0,8(1)
stwu 1,-264(1)
mr 31,1
lwz 11,LC..4(2)
lwz 9,LC..5(2)
lbz 0,0(9)
rlwinm 29,0,0,0xff
lwz 28,LC..6(2)
lwz 9,LC..7(2)
lwz 0,0(9)
lwz 10,4(9)
lwz 8,8(9)
lwz 7,12(9)
stw 0,64(1)
stw 10,68(1)
stw 8,72(1)
stw 7,76(1)
lwz 0,16(9)
lwz 9,20(9)
stw 0,80(1)
stw 9,84(1)
addi 3,31,88
lwz 4,0(11)
lwz 5,4(11)
lwz 6,8(11)
lwz 7,12(11)
lwz 8,16(11)
lwz 9,20(11)
mr 10,29
lfd 1,0(28)
bl .f
addi 0,31,136
mr 3,0
lwz 4,LC..8(2)
bl .strcpy
nop
li 0,0
stb 0,121(31)
li 0,0
stb 0,88(31)
lwz 6,LC..9(2)
lwz 10,LC..4(2)
lwz 9,LC..5(2)
lbz 0,0(9)
rlwinm 29,0,0,0xff
lwz 28,LC..6(2)
lwz 9,LC..7(2)
lwz 0,0(9)
lwz 11,4(9)
lwz 8,8(9)
lwz 7,12(9)
stw 0,64(1)
stw 11,68(1)
stw 8,72(1)
stw 7,76(1)
lwz 0,16(9)
lwz 9,20(9)
stw 0,80(1)
stw 9,84(1)
lwz 11,0(6)
addi 3,31,88
lwz 4,0(10)
lwz 5,4(10)
lwz 6,8(10)
lwz 7,12(10)
lwz 8,16(10)
lwz 9,20(10)
mr 10,29
lfd 1,0(28)
lwz 0,0(11)
mtctr 0
stw 2,20(1)
lwz 2,4(11)
lwz 11,8(11)
bctrl
lwz 2,20(1)
addi 0,31,136
mr 3,0
lwz 4,LC..8(2)
bl .strcmp
nop
mr 0,3
cmpwi 0,0,0
beq 0,L..3
bl .abort
nop
L..3:
li 3,0
bl .exit
nop
LT..main:
.long 0
.byte 0,0,32,97,128,4,0,1
.long LT..main-.main
.short 4
.byte "main"
.byte 31
.align 2
.comm out,100,3
_section_.text:
.csect .data[RW],3
.long _section_.text