[GHC] #14821: -O2 forces -optlo-O3 in a way that cannot be overridden at command line
#14821: -O2 forces -optlo-O3 in a way that cannot be overridden at command line -------------------------------------+------------------------------------- Reporter: joeyhess | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 (LLVM) | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- I would expect -O2 -optlo-O2 to pass -O2 to the llvm optimiser. However, it seems that -O2 implies -optlo-O3, overriding the command-line's -optlo-O2. The workaround seems to be to use -O1 -optlo-O2, but of course this misses some ghc optimizations. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14821> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#14821: -O2 forces -optlo-O3 in a way that cannot be overridden at command line -------------------------------------+------------------------------------- Reporter: joeyhess | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler (LLVM) | Version: 8.0.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4421 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => patch * differential: => Phab:D4421 Comment: I suspect that Phab:D4421 will resolve this although I haven't yet tested it. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14821#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#14821: -O2 forces -optlo-O3 in a way that cannot be overridden at command line -------------------------------------+------------------------------------- Reporter: joeyhess | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler (LLVM) | Version: 8.0.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4421 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"41db237e1290b650e52eb07323eca71de941e184/ghc" 41db237e/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="41db237e1290b650e52eb07323eca71de941e184" llvmGen: Pass -optlo flags last to opt LLVM, like GHC, processes flags in the order that they appear. Consequently, we need to ensure the user-provided flags appear last so they can override flags produced by GHC. See #14821. Test Plan: `ghc -O2 -optlo-O2 -v3 $FILE` and ensure that `opt` and `llc` are invoked with `-O2`. Subscribers: rwbarton, thomie, carter GHC Trac Issues: #14821 Differential Revision: https://phabricator.haskell.org/D4421 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14821#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#14821: -O2 forces -optlo-O3 in a way that cannot be overridden at command line -------------------------------------+------------------------------------- Reporter: joeyhess | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.6.1 Component: Compiler (LLVM) | Version: 8.0.2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4421 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed * milestone: => 8.6.1 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14821#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC