X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fcmm%2FCmmOpt.hs;h=379d7a2996c2766b18b752956e7c289f80672296;hb=3e1c50a6f4aaf0317808d7826ba54b4b449844ae;hp=8a2dd751dbd6f2d45c7744135d6ad8c8215a1c8e;hpb=16a2f6a8a381af31c23b6a41a851951da9bc1803;p=ghc-hetmet.git diff --git a/compiler/cmm/CmmOpt.hs b/compiler/cmm/CmmOpt.hs index 8a2dd75..379d7a2 100644 --- a/compiler/cmm/CmmOpt.hs +++ b/compiler/cmm/CmmOpt.hs @@ -1,3 +1,10 @@ +{-# OPTIONS -w #-} +-- The above warning supression flag is a temporary kludge. +-- While working on this module you are encouraged to remove it and fix +-- any warnings in the module. See +-- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings +-- for details + ----------------------------------------------------------------------------- -- -- Cmm optimisation @@ -6,13 +13,6 @@ -- ----------------------------------------------------------------------------- -{-# OPTIONS -w #-} --- The above warning supression flag is a temporary kludge. --- While working on this module you are encouraged to remove it and fix --- any warnings in the module. See --- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings --- for details - module CmmOpt ( cmmMiniInline, cmmMachOpFold, @@ -341,7 +341,10 @@ cmmMachOpFold cmp [CmmMachOp conv [x], CmmLit (CmmInt i _)] = cmmMachOpFold narrow_cmp [x, CmmLit (CmmInt narrow_i rep)] where maybe_conversion (MO_U_Conv from _) = Just (from, narrowU) - maybe_conversion (MO_S_Conv from _) = Just (from, narrowS) + maybe_conversion (MO_S_Conv from _) + | not (isFloatingRep from) = Just (from, narrowS) + -- don't attempt to apply this optimisation when the source + -- is a float; see #1916 maybe_conversion _ = Nothing maybe_comparison (MO_U_Gt _) rep = Just (MO_U_Gt rep)