#1627: {-# INLINE #-} doesn't
-------------------------+--------------------------------------------------
    Reporter:  guest     |        Owner:         
        Type:  bug       |       Status:  closed 
    Priority:  normal    |    Milestone:         
   Component:  Compiler  |      Version:  6.7    
    Severity:  normal    |   Resolution:  fixed  
    Keywords:            |   Difficulty:  Unknown
          Os:  MacOS X   |     Testcase:         
Architecture:  x86       |  
-------------------------+--------------------------------------------------
Changes (by simonpj):

  * resolution:  => fixed
  * status:  new => closed

Comment:

 Excellent point.  It's to do with type applications.  I've fixed the
 simplifier.  Now we get this:
 {{{
 M.$wa =
   \ (@ s_ar3)
     (ww_sDQ :: GHC.Prim.Int#)
     (ww1_sDU :: GHC.Prim.Int#)
     (ww2_sDW :: GHC.Prim.MutableArray# s_ar3 GHC.Base.Int)
     (w_sDY :: GHC.Prim.State# s_ar3) ->
     case GHC.Arr.$windex1 ww_sDQ ww1_sDU 1 of ww3_aAd { __DEFAULT ->
     case GHC.Prim.readArray# @ s_ar3 @ GHC.Base.Int ww2_sDW ww3_aAd w_sDY
     of wild_Xzr { (# new_s_Xzu, r_Xzw #) ->
     case GHC.Prim.readArray# @ s_ar3 @ GHC.Base.Int ww2_sDW ww3_aAd
 new_s_Xzu
     of wild1_XzF { (# new_s1_XzI, r1_XzK #) ->
     (# new_s1_XzI, GHC.Base.plusInt r_Xzw r1_XzK #)
     }
     }
     }

 M.a =
   __inline_me (\ (@ s_ar3)
                  (w_sDM :: GHC.Arr.STArray s_ar3 GHC.Base.Int
 GHC.Base.Int)
                  (w1_sDY :: GHC.Prim.State# s_ar3) ->
                  case w_sDM of w2_XDY { GHC.Arr.STArray ww_sDO ww1_sDS
 ww2_sDW ->
                  case ww_sDO of ww3_XE7 { GHC.Base.I# ww4_sDQ ->
                  case ww1_sDS of ww5_XEg { GHC.Base.I# ww6_sDU ->
                  M.$wa @ s_ar3 ww4_sDQ ww6_sDU ww2_sDW w1_sDY
                  }
                  }
                  })

 M.foo =
   \ (@ s_ar3) ->
     (M.a @ s_ar3)
     `cast` (GHC.Arr.STArray s_ar3 GHC.Base.Int GHC.Base.Int
             -> sym (s_ar3 GHC.ST.:CoST GHC.Base.Int)
             :: GHC.Arr.STArray s_ar3 GHC.Base.Int GHC.Base.Int
                -> GHC.ST.STRep s_ar3 GHC.Base.Int
                  ~
                GHC.Arr.STArray s_ar3 GHC.Base.Int GHC.Base.Int ->
 GHC.ST.ST s_ar3 GHC.Base.Int)
 }}}
 which is what you wanted.  I will push shortly.

 Simon

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1627>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to