Skip to content
  • Simon Peyton Jones's avatar
    [project @ 2004-01-08 11:53:29 by simonpj] · d29520cb
    Simon Peyton Jones authored
    ---------------------------------------
    	Fix a long-standing CSE bug with unboxed tuples
    	  ---------------------------------------
    
    		Merge to stable
    
    Consider
            case f x of
    	  (# a,b #) -> if a>0
    		       then f x -- CSE opportunity
    		       else (# b,a #)
    
     GHC 6.2's CSE pass wrongly optimised this to:
    
    	case f x of t
    	  (# a,b #) -> if a>0 then
    			  t	-- WRONG
    			else (# b,a #)
    
    (Wrong because we aren't allowed to mention a case binder for
    an unboxed-tuple case.)
    
    This commit fixes the problem.
    d29520cb