
#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: -------------------------------------+------------------------------------- Description changed by bgamari: Old description:
The `-O[012]` and `-f*` flags are both implemented by manipulating a set of flags in `DynFlags`. These manipulations occur in the order that the flags occur in the command line. This leads to some rather surprising behavior.
For instance, if the user wants to compile with optimization but specifically wants to disable specialisation, they might enter `-fno- specialise -O1`. This, however, would not do what the user expects as `-O1` implies `-fspecialise`, overriding the first flag.
This is surprising and poorly documented behavior at best.
New description: The `-O[012]` and `-f*` flags are both implemented by manipulating a set of flags in `DynFlags`. These manipulations occur in the order that the flags occur in the command line. This leads to some rather surprising behavior. For instance, if the user wants to compile with optimization but specifically wants to disable specialisation, they might enter `-fno- specialise -O1`. This, however, would not do what the user expects as `-O1` implies `-fspecialise`, overriding the first flag. This is surprising and poorly documented behavior at best. See the later comments of #10491 which lead to this ticket. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10560#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler