[GHC] #14626: No need to enter a scrutinised value

GHC ghc-devs at haskell.org
Thu Jan 11 23:08:27 UTC 2018


#14626: No need to enter a scrutinised value
-------------------------------------+-------------------------------------
        Reporter:  heisenbug         |                Owner:  heisenbug
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.2.2
      Resolution:                    |             Keywords:  performance
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #13861            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by heisenbug):

 Replying to [comment:23 simonpj]:
 > > getSymtabName should somehow check the getTag# of the presumably
 strict fields and if any of them is 0, seq it?
 >
 > I don't think so.  Here's its code:
 > {{{
 > getSymtabName _ncu _dict symtab bh = do
 >     i :: Word32 <- get bh
 >     case i .&. 0xC0000000 of
 >       0x00000000 -> return $! symtab ! fromIntegral i
 >
 >       0x80000000 ->
 >         let
 >           tag = chr (fromIntegral ((i .&. 0x3FC00000) `shiftR` 22))
 >           ix  = fromIntegral i .&. 0x003FFFFF
 >           u   = mkUnique tag ix
 >         in
 >           return $! case lookupKnownKeyName u of
 >                       Nothing -> pprPanic "getSymtabName:unknown known-
 key unique"
 >                                           (ppr i $$ ppr (unpkUnique u))
 >                       Just n  -> n
 >
 >       _ -> pprPanic "getSymtabName:unknown name tag" (ppr i)
 > }}}
 > The only way it can return a `Name` is either as a result of
 `lookupKownKeyName` or as ar result of indexing `symtab`.  Both should
 return properly formed names.  Maybe somehow one of them isn't?  But which
 one?

 I bet it comes from the call to `getDictionary` in `BinIface.hs`.

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


More information about the ghc-tickets mailing list