patch applied (ghc): Allow C argument regs to be used as global regs (R1, R2, etc.)

Simon Marlow simonmar at microsoft.com
Tue Feb 28 10:38:34 EST 2006


Tue Feb 28 07:29:42 PST 2006  Simon Marlow <simonmar at microsoft.com>
  * Allow C argument regs to be used as global regs (R1, R2, etc.)
  
  The problem here was that we generated C calls with expressions
  involving R1 etc. as parameters.  When some of the R registers are
  also C argument registers, both GCC and the native code generator
  generate incorrect code.  The hacky workaround is to assign
  problematic arguments to temporaries first; fortunately this works
  with both GCC and the NCG, but we have to be careful not to undo this
  with later optimisations (see changes to CmmOpt).

    M ./ghc/compiler/cmm/CmmOpt.hs -1 +11
    M ./ghc/compiler/cmm/CmmParse.y -2 +3
    M ./ghc/compiler/cmm/CmmUtils.hs -1 +9
    M ./ghc/compiler/codeGen/CgForeignCall.hs -32 +61
    M ./ghc/compiler/codeGen/CgPrimOp.hs -12 +17


More information about the Cvs-ghc mailing list