This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/17471] New: glibc-2.3.3 build failled with gcc-3.4.[012] for parisc-linux
- From: "soete dot joel at tiscali dot be" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Sep 2004 23:00:08 -0000
- Subject: [Bug c/17471] New: glibc-2.3.3 build failled with gcc-3.4.[012] for parisc-linux
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Hello ggc/c,
It takes me a wile to understand why
CPP='/usr/bin/gcc-3.4 -E -x c-header'
/Develop/parisc-linux/build/glibc/elf/ld.so.1 --library-path
/Develop/parisc-linux/build/glibc:/Develop/parisc-linux/build/glibc/math:/Develop/parisc-linux/build/glibc/elf:/Develop/parisc-linux/build/glibc/dlfcn:/Develop/parisc-linux/build/glibc/nss:/Develop/parisc-linux/build/glibc/nis:/Develop/parisc-linux/build/glibc/rt:/Develop/parisc-linux/build/glibc/resolv:/Develop/parisc-linux/build/glibc/crypt:/Develop/parisc-linux/build/glibc/linuxthreads
/Develop/parisc-linux/build/glibc/sunrpc/rpcgen -Y ../scripts -c
rpcsvc/bootparam_prot.x -o
/Develop/parisc-linux/build/glibc/sunrpc/xbootparam_prot.T
make[2]: *** [/Develop/parisc-linux/build/glibc/sunrpc/xbootparam_prot.stmp]
Segmentation fault
since gcc-3.4.0 (duno about gcc-3.5 yet :( )
Everything wrong hapened in sysdeps/generic/dl-fptr.c at :
ElfW(Addr)
_dl_make_fptr (struct link_map *map, const ElfW(Sym) *sym,
ElfW(Addr) ip)
{
ElfW(Addr) *ftab = map->l_mach.fptr_table;
const ElfW(Sym) *symtab;
Elf_Symndx symidx;
struct local *l;
if (__builtin_expect (ftab == NULL, 0))
ftab = make_fptr_table (map);
ftab here is not correctly assign?
As the same code compile and works fine with gcc-3.3 I compare code and value
behaviour (thanks ddd :) )
gcc-3.3 | gcc-3.4
======= | =======
ldw 1fc(,r26),r7 | ldw 1fc(,r26),r6
ftab == r7 == 0x0 | ftab == r6 == 0x0
|
copy r26,r8 |
cmpib,= 0,r7,0x412631a0 <_dl_make_fptr+252> | cmpib,= 0,r6,0x412858f4
<_dl_make_fptr+548> <====[3]'call' make_fptr_table()
r7 == 0x40001000 | r6 == 0x0
|
copy r25,r3 | copy r25,r3
ldw 30(,r8),r20 | ldw 1f8(,r26),ret1
ldw 1f8(,r8),r22 | ldw 30(,r10),r21
ldw 4(,r20),r21 | ldw 4(,r21),r20
|
r3 == 0x4026d1c4 (== sym) | r3 == 0x40037cdc (== sym);
r21 == 0x40265164 (== symtab) | r20 == 0x4003009c (==
symtab)
sub r3,r21,r21 | sub r3,r20,r20 <====[1]
r21 == 0x8060 | r20 == 0x7c40
|
extrw,s r21,27,28,r21 | extrw,s r20,27,28,r7
[r21 >>= 4] | [r7 = r20 >> 4]
r21 == 0x806 | r7 == 0x7c4
|
r22 == 0x813 | ret1 (aka r29) == 0x7d1
(r22 == map->l_mach.fptr_table_len) | (ret1 ==
map->l_mach.fptr_table_len)
cmpb,<<= r22,r21,0x41263184 <_dl_make_fptr+224> | cmpb,>>=,n r7,ret1,0x412859d0
<_dl_make_fptr+768>
depw,z r21,29,30,r9 |
add,l r9,r7,r21 |
ldw 0(,r21),r20 | ldw,s r7(,r6),ret0 <====[4]
cmpib,<> 0,r20,0x41263150 <_dl_make_fptr+172> | cmpib,<> 0,ret0,0x4104aa38
<_dl_make_fptr+248>
[...]
ldw 2c(,r26),r21 | ldw 30(,r26),r20 <====
make_fptr_table()
ldw 30(,r26),r20 | ldw 4(,r20),r21
addil 0,r19,%r1 | addil 0,r19,%r1
copy r19,r4 | copy r1,r22
ldw 4(,r20),r22 | ldw 2c(,r26),r20
ldw 4(,r21),r26 | ldw 4(,r20),r26
ldi 3,r24 | sub r26,r21,r26
ldi 12,r23 | ldw 44(,r10),r20
ldw 44(,r8),r21 | ldw 4(,r20),r25
sub r26,r22,r26 | b,l 0x41287d60 <$$divU>,r31
ldw 654(,r1),r1 | copy r19,r4
ldw 4(,r21),r25 | ldi -1,r20
ldw 4(,r1),r20 | stw r20,-34(,sp)
ldi -1,r21 | ldi 0,r26
b,l 0x41265570 <$$divU>,r31 | ldw 638(,r22),r20
sub r0,r20,r22 | ldw 4(,r20),r25
stw r21,-34(,sp) | depw,z ret1,29,30,r5
ldi 0,r26 | ldi 3,r24
depw,z ret1,29,30,r5 | sub r0,r25,r20
stw r0,-38(,sp) | copy ret1,r6
copy ret1,r6 | stw r0,-38(,sp)
(ret1 == 0x813) |
|
add,l r5,r20,r20 | add,l r5,r25,r25
add,l r20,r21,r20 | ldi 12,r23
and r20,r22,r20 | ldo -1(r25),r25
b,l 0x412641bc <__mmap>,rp | b,l 0x412869a8 <__mmap>,rp
copy r20,r25 | and r25,r20,r25
copy r4,r19 | copy r4,r19
cmpib,= -1,ret0,0x4126323c <_dl_make_fptr+408> | cmpib,= -1,ret0,0x412859e0
<_dl_make_fptr+784>
(ret0 == 0x40001000) | (ret0 == 0x40001000)
|
copy ret0,r26 | copy ret0,r26
ldw 1fc(,r8),r20 | ldw 1fc(,r10),r20
cmpib,<>,n 0,r20,0x4126322c <_dl_make_fptr+392> | cmpib,<>,n 0,r20,0x412859a0
<_dl_make_fptr+720>
|
| copy r6,ret1 (ret1 ==
0x815)
|
stw ret0,1fc(,r8) (a) | stw r6,1f8(,r10) (d)
stw r6,1f8(,r8) (b) | ldw 1fc(,r10),r6 (e)
<==== ????
b,l 0x412630e0 <_dl_make_fptr+60>,r0 | b,l 0x4128572c
<_dl_make_fptr+92>,r0
ldw 1fc(,r8),r7 (c) | stw ret0,1fc(,r10) (f)
<==== make_fptr_table()'s return
the wrong stuff occurs here in (e) when register r6 is loaded by the wrong
value. (btw comparing gcc-3.3 and 3.4 the insn (a), (b), (c) and (d), (e), (f)
seems the same but in different order ?)
As glibc required optimization it's difficult to say if it's a pb of
optimization or what else :(
I didn't reach to produce a small test case, I will so send precompile code with
cmdl to compile it.
Thanks in advance for your attention and help,
Joel
--
Summary: glibc-2.3.3 build failled with gcc-3.4.[012] for parisc-
linux
Product: gcc
Version: 3.4.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: soete dot joel at tiscali dot be
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: binutils-2.15; gcc-3.4.[012]
GCC host triplet: hppa
GCC target triplet: hppa
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17471