id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	os	architecture	failure	difficulty	testcase	blockedby	blocking	related
5731	Bad code for Double literals	rl	igloo	"Caught by the `vector` benchmark suite. Small program:

{{{
foo :: [Double] -> [Double]
foo = map f
  where
    f x = 1 / x
}}}

The current head generates this rather terrible code (with -O2):

{{{
foo3 :: GHC.Integer.Type.Integer
foo3 = __integer 1

foo2 :: GHC.Types.Double
foo2 =
  case GHC.Integer.Type.doubleFromInteger foo3
  of wild_afu { __DEFAULT ->
  GHC.Types.D# wild_afu
  }

foo1 :: GHC.Types.Double -> GHC.Types.Double
foo1 =
  \ (eta_B1 :: GHC.Types.Double) ->
    GHC.Float.divideDouble foo2 eta_B1

foo :: [GHC.Types.Double] -> [GHC.Types.Double]
foo = GHC.Base.map @ GHC.Types.Double @ GHC.Types.Double foo1
}}}

It does generate perfectly fine code for this, though:

{{{
bar :: [Double] -> [Double]
bar = map (\x -> 1/x)
}}}"	bug	closed	highest	7.4.1	Compiler	7.3	fixed			Unknown/Multiple	Unknown/Multiple	Runtime performance bug	Unknown				
