[GHC] #15867: STG scope error

GHC ghc-devs at haskell.org
Thu Nov 8 12:24:54 UTC 2018


#15867: STG scope error
-------------------------------------+-------------------------------------
        Reporter:  csabahruska       |                Owner:  sgraf
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.7
      Resolution:                    |             Keywords:  CodeGen
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by sgraf):

 The `Void# is redefined` errors are related to shadowing. As you pointed
 out, that's a little too strict.

 The other errors, due to duplicated occs, are more concerning. This
 happens after unarisation. This is the offending STG before unarise:

 {{{
 case
     GHC.Integer.Type.quotRemInteger n_sf5G d_sf5H
 of
 qr_sf5I [Occ=Once]
 { (#,#) ipv_sf5J [Occ=Once] ipv1_sf5K ->
       let-no-escape {
         $j3_sf5L [Occ=Once*!T[1], Dmd=<C(S),1*C1(U(U,U))>]
           :: GHC.Prim.Int#
               -> (# GHC.Integer.Type.Integer, GHC.Integer.Type.Integer #)
         [LclId[JoinId(1)], Arity=1, Str=<S,U>, Unf=OtherCon []] =
             sat-only [d_sf5H qr_sf5I ipv_sf5J ipv1_sf5K] \r [wild_sf5M] ->
 ...
 }}}

 Unarise splits the occurrence of `qr_sf5I` into its constituents
 `ipv_sf5J` and `ipv1_sf5K` without looking for duplicates:

 {{{

 case quotRemInteger n_sf5G d_sf5H of qr_sf5I [Occ=Once] {
   (#,#) ipv_sf5J [Occ=Once] ipv1_sf5K ->
       let-no-escape {
         $j3_sf5L [Occ=Once*!T[1], Dmd=<C(S),1*C1(U(U,U))>]
           :: Int# -> (# Integer, Integer #)
         [LclId[JoinId(1)], Arity=1, Str=<S,U>, Unf=OtherCon []] =
             sat-only [d_sf5H
                       ipv_sf5J
                       ipv1_sf5K
                       ipv_sf5J
                       ipv1_sf5K] \r [wild_sf5M] ...
 }}}

 Let's see where...

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15867#comment:7>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list