------- Comment #11 from danglin at gcc dot gnu dot org  2007-11-01 03:05 
-------
Mark,

This is major progress.  All the priority tests pass and there are no
regressions on hppa2.0w-hp-hpux11.11 and hppa-unknown-linux-gnu.

However, I don't think the patch is quite right.  For example, in the
gcc.dg/initpri1.c test, two identical routines for "c1" are emitted:

        .EXPORT c1,ENTRY,PRIV_LEV=3
c1:
        .PROC
        .CALLINFO FRAME=64,CALLS,SAVE_RP
        .ENTRY
        stw %r2,-20(%r30)
        addil LR'i-$global$,%r27
        ldo 64(%r30),%r30
        ldw RR'i-$global$(%r1),%r19
        ldo 1(%r19),%r28
        comib,<> 0,%r19,L$0036
        stw %r28,RR'i-$global$(%r1)
        ldw -84(%r30),%r2
        bv %r0(%r2)
        ldo -64(%r30),%r30
L$0036:
        .CALL
        bl abort,%r2
        nop
        nop
        .EXIT
        .PROCEND

and

        .EXPORT _GLOBAL__I_500_0_c1,ENTRY,PRIV_LEV=3
_GLOBAL__I_500_0_c1:
        .PROC
        .CALLINFO FRAME=64,CALLS,SAVE_RP
        .ENTRY
        stw %r2,-20(%r30)
        addil LR'i-$global$,%r27
        ldo 64(%r30),%r30
        ldw RR'i-$global$(%r1),%r19
        ldo 1(%r19),%r28
        comib,<> 0,%r19,L$0040
        stw %r28,RR'i-$global$(%r1)
        ldw -84(%r30),%r2
        bv %r0(%r2)
        ldo -64(%r30),%r30
L$0040:
        .CALL
        bl abort,%r2
        nop
        nop
        .EXIT
        .PROCEND

In the test, only _GLOBAL__I_500_0_c1 is actually called.  I believe
_GLOBAL__I_500_0_c1 should call c1, or more optimally be an alias for
c1.  For example, this handles the case where there is static data
private to c1, and c1 is called more than once.

I'm not particularly concerned about using aliases although I think
it is doable with GNU as.

Dave 


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33579

Reply via email to