Calling convention bug and cleanup
[ghc-hetmet.git] / compiler / codeGen / CgTailCall.lhs
index e4f79a7..3732bab 100644 (file)
@@ -35,6 +35,7 @@ import Id
 import StgSyn
 import PrimOp
 import Outputable
+import StaticFlags
 
 import Control.Monad
 
@@ -183,7 +184,10 @@ performTailCall fun_info arg_amodes pending_assts
     untag_node = CmmAssign nodeReg (cmmUntag (CmmReg nodeReg))
     -- Test if closure is a constructor
     maybeSwitchOnCons enterClosure eob
-              | EndOfBlockInfo _ (CaseAlts lbl _ _) <- eob
+              | EndOfBlockInfo _ (CaseAlts lbl _ _) <- eob,
+                not opt_SccProfilingOn
+                -- we can't shortcut when profiling is on, because we have
+                -- to enter a closure to mark it as "used" for LDV profiling
               = do { is_constr <- newLabelC
                    -- Is the pointer tagged?
                    -- Yes, jump to switch statement
@@ -383,7 +387,7 @@ tailCallPrimOp op args
                -- except that *all* the arguments will be in registers.
                -- Hence the ASSERT( null leftovers )
          arg_amodes <- getArgAmodes args
-       ; let (arg_regs, leftovers) = assignPrimOpCallRegs arg_amodes
+       ; let (arg_regs, leftovers) = pprTrace "prim op" (ppr op) $ assignPrimOpCallRegs arg_amodes
              jump_to_primop = jumpToLbl (mkRtsPrimOpLabel op)
 
        ; ASSERT(null leftovers) -- no stack-resident args