stg_ap_v_ret porting crash: solved?

Simon Marlow simonmar at microsoft.com
Fri Sep 12 11:59:05 EDT 2003


 
> With the wrapper everything was fine here on the host side.
> 
> I then had to do the I_ -> int stg_exit thing as committed to CVS for
> IA64, and also change machine/{pal,fpu}.h to asm/{pal,fpu}.h in
> ghc/rts/Adjuster.c and ghc/rts/Signals.c. (I'd already applied the
> MBLOCK hack from x86-64). The compile then failed with
> 
> gcc -O -Wall -DCOMPILING_STDLIB  -I../../../ghc/includes 
> -I../../../ghc/rts -I../include    -c writeError.c -o writeError.o
> In file included from ../../../ghc/includes/Stg.h:189,
>                  from ../../../ghc/includes/Rts.h:20,
>                  from writeError.c:19:
> ../../../ghc/includes/TailCalls.h:86: warning: call-clobbered 
> register used for global register variable
> writeError.c: In function `writeErrString__':
> writeError.c:47: error: unable to find a register to spill in 
> class `R27_REG'
> writeError.c:47: error: this is the insn:
> (call_insn 31 30 34 1 0x2000079b970 (parallel [
>             (call (mem:DI (reg/v/f:DI 9 $9 [69]) [0 S8 A64])
>                 (const_int 0 [0x0]))
>             (use (reg:DI 29 $29))
>             (clobber (reg:DI 26 $26))
>         ]) 197 {*call_osf_1_er} (insn_list 30 (nil))
>     (expr_list:REG_DEAD (reg:DI 27 $27)
>         (expr_list:REG_DEAD (reg:DI 16 $16)
>             (expr_list:REG_DEAD (reg/v/f:DI 9 $9 [69])
>                 (expr_list:REG_UNUSED (reg:DI 26 $26)
>                     (nil)))))
>     (expr_list (use (reg:DI 16 $16))
>         (nil)))
> writeError.c:47: confused by earlier errors, bailing out
> make[2]: *** [writeError.o] Error 1
> make[1]: *** [all] Error 1
> make: *** [all] Error 1
> make: Leaving directory `/home/igloo/ghc6-doc/ghc-6.0.1/libraries'

Hmm, Alpha should probably not be declaring that global register
variable in TailCalls.h when compiling ordinary C files.  Try
surrounding the declaration with #ifdef IN_STG_CODE.

> Now I have
> 
> ../../ghc/compiler/ghc-inplace -H16m -O -O2 -static    -c 
> Apply.hc -o Apply.o
> ghc-asm: unknown prologue mangling? alpha-unknown-linux
> Prologue junk?:         .globl stg_ap_0_ret
>         .ent stg_ap_0_ret
> stg_ap_0_ret:
>         .eflag 48
>         .frame $30,16,$26,0
>         .mask 0x4000000,-16
>         ldgp $29,0($27)
> $stg_ap_0_ret..ng:
>         lda $30,-16($30)
>         stq $26,0($30)
>         .prologue 1

Looks like you need some mangler support now...

Cheers,
	Simon



More information about the Glasgow-haskell-users mailing list