Fix bug relating to the return values of prim ops
authorMichael D. Adams <t-madams@microsoft.com>
Tue, 26 Jun 2007 19:23:52 +0000 (19:23 +0000)
committerMichael D. Adams <t-madams@microsoft.com>
Tue, 26 Jun 2007 19:23:52 +0000 (19:23 +0000)
The return values were getting put in a LocalReg
but that LocalReg needed to be stored into the enclosing
expression's return register (e.g. R1).

compiler/codeGen/CgExpr.lhs

index e58fda7..7452de0 100644 (file)
@@ -162,7 +162,7 @@ cgExpr x@(StgOpApp op@(StgPrimOp primop) args res_ty)
   | ReturnsPrim rep <- result_info
        = do cgPrimOp [dataReturnConvPrim (primRepToCgRep rep)] 
                        primop args emptyVarSet
-            performReturn emitReturnInstr
+            performPrimReturn (primRepToCgRep rep) (CmmReg (CmmLocal res))
 
   | ReturnsAlg tycon <- result_info, isUnboxedTupleTyCon tycon
        = do (reps, regs, _hints) <- newUnboxedTupleRegs res_ty