Skip to content
  • Herbert Valerio Riedel's avatar
    Workaround failed constant-folding for zeroBits · 0d66095d
    Herbert Valerio Riedel authored
    
    
    For some reason GHC fails to constant fold `zeroBits :: Int` and
    `zeroBits :: Integer`; `ghc -show-iface` shows
    
      $fBitsInt_$czeroBits :: GHC.Types.Int
         {- Strictness: m,
            Unfolding: (GHC.Types.I# (GHC.Prim.andI# 1 (GHC.Prim.notI# 1))) -}
    
    Otoh, constant-folding works as expected, reducing `zeroBits` to 0 constant
    for the other integer-types (= {Word,Int}{8,16,32,64}` and `Word`). So this
    quickfix is actually just treating the symptom rather than the cause.
    
    Signed-off-by: Herbert Valerio Riedel's avatarHerbert Valerio Riedel <hvr@gnu.org>
    0d66095d