diff options
-rw-r--r-- | ghc/compiler/codeGen/CgInfoTbls.hs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ghc/compiler/codeGen/CgInfoTbls.hs b/ghc/compiler/codeGen/CgInfoTbls.hs index 7692e7d71b..981b4b0c69 100644 --- a/ghc/compiler/codeGen/CgInfoTbls.hs +++ b/ghc/compiler/codeGen/CgInfoTbls.hs @@ -44,7 +44,8 @@ import CgCallConv ( isBigLiveness, mkLivenessCLit, buildContLiveness, CtrlReturnConvention(..) ) import CgUtils ( mkStringCLit, packHalfWordsCLit, mkWordCLit, cmmOffsetB, cmmOffsetExprW, cmmLabelOffW, cmmOffsetW, - emitDataLits, emitRODataLits, emitSwitch, cmmNegate ) + emitDataLits, emitRODataLits, emitSwitch, cmmNegate, + newTemp ) import CgMonad import CmmUtils ( mkIntCLit, zeroCLit ) @@ -348,7 +349,11 @@ emitVectoredReturnInstr :: CmmExpr -- *Zero-indexed* constructor tag -> Code emitVectoredReturnInstr zero_indexed_tag = do { info_amode <- getSequelAmode - ; let target = retVec info_amode zero_indexed_tag + -- HACK! assign info_amode to a temp, because retVec + -- uses it twice and the NCG doesn't have any CSE yet. + ; x <- newTemp wordRep + ; stmtC (CmmAssign x info_amode) + ; let target = retVec (CmmReg x) zero_indexed_tag ; stmtC (CmmJump target []) } |