x86 unreg breakage (was: Re: PPC porting: asm question)

Michael Weber michael.weber@post.rwth-aachen.de
Tue, 17 Apr 2001 13:03:59 +0200


On Tue, Apr 17, 2001 at 12:58:45 +0200, Michael Weber wrote:
> On Tue, Apr 17, 2001 at 11:12:35 +0200, Michael Weber wrote:
> > Hi!
> > 
> > I produced unreg .hc files from ghc-5.00 and started to bootstrap the
> > compiler on a PPC.  I got stuck at this point:
> [PPC errors]
> 
> so I decided to try out the unreg .hc files on x86 (where I generated
> them, just in a fresh tree).
> 
> Unfortunately, this didn't work out, too (see below).  I use SimonM's
> description to generate the .hc files.  In the .hc-build-tree, I
> tweaked some minor things to overcome the problems that were described
> by Pixel on -bugs@haskell.org (mainly related to hsc2hs).
> 
> 
> Cheers,
> Michael
> 

*ahem*, scratch until __HERE__ (pasted from the wrong location)
> ------------------------------------------------------------------------
> ==fptools== make boot - --no-print-directory -r;
>  in /home/michaelw/debian/build/ghc4-4.08.1/ghc/compiler
> ------------------------------------------------------------------------
__HERE__

the rest is the actual error msg.  Really! =)

------------------------------------------------------------------------
===fptools== Finished making `all' in cbits ...
PWD = /export/home/michaelw/ghc/fptools-unreg-test/ghc/lib/std
------------------------------------------------------------------------
> [...]
> gcc -x c PrelPrimopWrappers.hc -o PrelPrimopWrappers.raw_s -S -O
> -fno-defer-pop -fomit-frame-pointer  -D__GLASGOW_HASKELL__=411 -O
> -I/export/home/michaelw/ghc/fptools-unreg-test/ghc/includes
> -I/export/home/michaelw/ghc/fptools-unreg-test/ghc/lib/std/cbits
> -I/export/home/michaelw/ghc/fptools-unreg-test/hslibs/lang/cbits
> -I/export/home/michaelw/ghc/fptools-unreg-test/hslibs/posix/cbits
> -I/export/home/michaelw/ghc/fptools-unreg-test/hslibs/util/cbits
> -I/export/home/michaelw/ghc/fptools-unreg-test/hslibs/text/cbits
> -I/export/home/michaelw/ghc/fptools-unreg-test/hslibs/hssource/cbits
> -I.  `echo  | sed 's/^$/-DSTOLEN_X86_REGS=4/'`
> PrelPrimopWrappers.hc: In function
> `PrelPrimopWrappers_writeInt64Arrayzh_fast4':
> PrelPrimopWrappers.hc:4078: fixed or forbidden register 3 (bx) was
> spilled for class GENERAL_REGS.
> PrelPrimopWrappers.hc:4078: This may be due to a compiler bug or to
> impossible asm
> PrelPrimopWrappers.hc:4078: statements or clauses.
> PrelPrimopWrappers.hc:4078: This is the instruction:
> (insn 28 26 31 (set (mem/s:DI (plus:SI (plus:SI (mult:SI (reg:SI 25)
>                         (const_int 8 [0x8]))
>                     (reg:SI 26))
>                 (const_int 8 [0x8])) 0)
>         (reg/v:DI 24)) 79 {movdi+1} (insn_list 16 (insn_list 24
> 	(insn_list 26 (nil))))
>     (expr_list:REG_DEAD (reg/v:DI 24)
>         (expr_list:REG_DEAD (reg:SI 25)
>             (expr_list:REG_DEAD (reg:SI 26)
>                 (nil)))))
> make[1]: *** [PrelPrimopWrappers.raw_s] Error 1