PPC64 Compiler bug !!
linas at austin.ibm.com
linas at austin.ibm.com
Fri Jun 13 03:41:19 EST 2003
My apologies in advance for the hallucinatory message to follow.
I have several PPC64 compilers that seem to have a bug in them.
Source code:
void spin_lock(int *lock);
long
linas_lock(int dev)
{
long flags =0;
spin_lock(&dev);
return flags;
}
Compiler flags: /opt/cross/bin/powerpc64-linux-gcc -c -Wa,-al linas.i
Assembly Listing:
GAS LISTING /tmp/ccOqxB1c.s page 1
1 .file "linas.i"
2 .section ".text"
3 .align 2
4 .globl linas_lock
5 .section ".opd","aw"
6 .align 3
7 linas_lock:
8 0000 00000000 .quad .linas_lock,.TOC. at tocbase,0
8 00000000
8 00000000
8 00000000
8 00000000
9 .previous
10 .size linas_lock,24
11 .type .linas_lock, at function
12 .globl .linas_lock
13 .linas_lock:
14 0000 7C0802A6 mflr 0
15 0004 FBE1FFF8 std 31,-8(1)
16 0008 F8010010 std 0,16(1)
17 000c F821FF71 stdu 1,-144(1)
18 0010 7C3F0B78 mr 31,1
19 0014 7C601B78 mr 0,3
20 0018 901F00C0 stw 0,192(31)
21 001c 38000000 li 0,0
22 0020 F81F0070 std 0,112(31)
23 0024 387F00C0 addi 3,31,192
24 0028 48000001 bl .spin_lock
25 002c 60000000 nop
26 0030 C81F0070 lfd 0,112(31)
27 0034 D81F0078 stfd 0,120(31)
28 0038 E81F0078 ld 0,120(31)
29 003c 7C030378 mr 3,0
30 0040 E8210000 ld 1,0(1)
31 0044 E8010010 ld 0,16(1)
32 0048 7C0803A6 mtlr 0
33 004c EBE1FFF8 ld 31,-8(1)
34 0050 4E800020 blr
35 .LTlinas_lock:
36 0054 00000000 .long 0
37 0058 00000001 .byte 0,0,0,1,128,1,0,1
37 80010001
38 .size .linas_lock,.-.linas_lock
39 .ident "GCC: (GNU) 3.2"
See line 26, 27 above: lfd, stfd !!!?? The first 6-bits of 0xc8, 0xd8 are
primary opcodes 50 and 54, load and store floating point double.
Surely when I wake up, it will be clear that this was a dream ??
--linas
** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/
More information about the Linuxppc64-dev
mailing list