From: Bertram Felgenhauer Date: Thu, 22 Nov 2007 09:55:13 +0000 (+0000) Subject: FIX #1916: don't try to convert float constants to int in CMM optimizer X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=30665bdd7b657dd9ca77c20b2e1f224cc3f4d4e3 FIX #1916: don't try to convert float constants to int in CMM optimizer --- diff --git a/compiler/cmm/CmmOpt.hs b/compiler/cmm/CmmOpt.hs index 320f0a5..7c88add 100644 --- a/compiler/cmm/CmmOpt.hs +++ b/compiler/cmm/CmmOpt.hs @@ -341,7 +341,8 @@ 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) maybe_conversion _ = Nothing maybe_comparison (MO_U_Gt _) rep = Just (MO_U_Gt rep)