------- Comment #1 from dave at hiauly1 dot hia dot nrc dot ca 2006-02-05
20:11 -------
Subject: Re: ICE: Segmentation fault (program cc1) compiling _muldi3.o in
stage1
> What |Removed |Added
> ----------------------------------------------------------------------------
> Keywords| |wrong-code
The problem is with indirect calls. For reasons that I don't understand,
the HP linker replaces the code sequence generated by GCC
.CALL ARGW0=GR
b,l $$dyncall,%r2
copy %r2,%r31
with
0x008d705c <htab_create_alloc+92>: be,l 27d68(sr4,r0),%sr0,%r31
0x008d7060 <htab_create_alloc+96>: copy rp,r31
r2 and rp are the same. The "b,l" is a 22-bit pc-relative branch.
It can only use r2 as the link register. The linker has gone and
substituted the "be,l" branch which uses r31 as the link. As a
result, r2 isn't set by the call and the code returns a second time
to the return point of the previous call.
If I was certain that the linker was always going to do the substitution,
the the "copy" could be adjusted. However, the linker can only do the
substitution when the offset is a 17-bit offset. When I wrote, the code
to use the 22-bit branch, I am fairly certain that I checked that the
linker didn't do the "be,l" substitution when a "b,l" was used.
I guess this optimization has to be removed on hpux.
Dave
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26109