[GHC] #10560: -f and -O options interact in non-obvious, order dependent ways

GHC ghc-devs at haskell.org
Mon Jun 22 12:42:38 UTC 2015


#10560: -f and -O options interact in non-obvious, order dependent ways
-------------------------------------+-------------------------------------
        Reporter:  bgamari           |                   Owner:
            Type:  bug               |                  Status:  new
        Priority:  normal            |               Milestone:
       Component:  Compiler          |                 Version:  7.10.1
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  Incorrect         |  Unknown/Multiple
  warning at compile-time            |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:                    |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by bgamari):

 George, it would be great if you could have a quick look at D1009 and
 confirm that the proposed language it addresses your concerns (suggestions
 for improvement would also be appreciated).

 Sven, I think we agree that the left-to-right parsing is standard and
 expected. The problem here is the fact that there is no sign to the user
 that `-f` and `-O` should interact. This spooky action at a distance has
 the very real potential to trip up users and has already masked the
 effectiveness of a workaround to a known bug. However, I can also see that
 it's not always possible to ensure that `-O` is placed first in the
 command line and making users endure a warning in this case is
 unfortunate. However, I think this is outweighed by the danger of a user
 not knowing which optimizations the compiler is actually performing.
 Trusting that they we see and remember a note in the documentation does
 not seem like a strong enough measure here.

 If the warning really is a problem we could issue it only if the last flag
 to set a given option was `-O`. This would allow the user to silence the
 warning by adding an additional `-f`, reaffirming the value set by `-O`.

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


More information about the ghc-tickets mailing list