X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=compiler%2Fcmm%2FCmmCallConv.hs;h=e7d0acc811d5f3fe77603498ce5f61c320f021ce;hb=927df6486bc0dcb598b82702ca40c8fad0d9b25f;hp=3fb347f7d23f75302d936205b7f67da36fe57bb5;hpb=c6206fd81612e51e257a650390646421c7c1d1cb;p=ghc-hetmet.git diff --git a/compiler/cmm/CmmCallConv.hs b/compiler/cmm/CmmCallConv.hs index 3fb347f..e7d0acc 100644 --- a/compiler/cmm/CmmCallConv.hs +++ b/compiler/cmm/CmmCallConv.hs @@ -8,9 +8,10 @@ module CmmCallConv ( #include "HsVersions.h" -import Cmm +import CmmExpr import SMRep -import ZipCfgCmmRep (Convention(..)) +import Cmm (Convention(..)) +import PprCmm () import Constants import qualified Data.List as L @@ -46,7 +47,8 @@ assignArgumentsPos conv arg_ty reps = assignments (_, NativeDirectCall) -> getRegsWithoutNode ([_], NativeReturn) -> allRegs (_, NativeReturn) -> getRegsWithNode - (_, GC) -> getRegsWithNode + -- GC calling convention *must* put values in registers + (_, GC) -> allRegs (_, PrimOpCall) -> allRegs ([_], PrimOpReturn) -> allRegs (_, PrimOpReturn) -> getRegsWithNode @@ -60,6 +62,7 @@ assignArgumentsPos conv arg_ty reps = assignments (reg_assts, stk_args) = assign_regs [] reps regs stk_args' = case conv of NativeReturn -> part PrimOpReturn -> part + GC | length stk_args /= 0 -> panic "Failed to allocate registers for GC call" _ -> stk_args where part = uncurry (++) (L.partition (not . isGcPtrType . arg_ty) stk_args)