[GHC] #13002: :set -O does not work in .ghci file

GHC ghc-devs at haskell.org
Thu Dec 28 00:23:00 UTC 2017


#13002: :set -O does not work in .ghci file
-------------------------------------+-------------------------------------
        Reporter:  George            |                Owner:  (none)
            Type:  bug               |               Status:  closed
        Priority:  normal            |            Milestone:  8.0.3
       Component:  GHCi              |              Version:  8.0.1
      Resolution:  worksforme        |             Keywords:
                                     |  RecompilationCheck
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Runtime           |  Unknown/Multiple
  performance bug                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by dfeuer):

 * status:  new => closed
 * resolution:   => worksforme
 * milestone:  8.4.1 => 8.0.3


Comment:

 I'm not at all convinced that this bug is valid at all. I suspect the
 timing difference you saw was some sort of insignificant artifact; perhaps
 the extra command line options are affecting GC timings. I tested with a
 version that includes an utterly bogus `RULES` pragma:

 {{{#!hs
 {-# OPTIONS_GHC -Wall #-}

 module T13002 where

 testFromTo :: Int -> Int
 testFromTo n = length ([0..(10^n)] :: [Int])
 {-# NOINLINE testFromTo #-}

 test :: Int -> Int
 test x = testFromTo x

 {-# RULES
 "bogus" forall x. testFromTo x = 12
  #-}
 }}}

 This produces semantically different `test` functions depending on whether
 optimizations are enabled or not, and the change occurs as expected when I
 add `-O` to the `.ghci` file. It works for me under 8.0, 8.2, and HEAD. So
 I'm going to close this for now; if you disagree, I suggest you add a more
 robust test case.

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


More information about the ghc-tickets mailing list