[GHC] #13170: Core Lint error on git HEAD

GHC ghc-devs at haskell.org
Tue Jan 24 03:44:56 UTC 2017


#13170: Core Lint error on git HEAD
-------------------------------------+-------------------------------------
        Reporter:  dobenour          |                Owner:  rwbarton
            Type:  bug               |               Status:  new
        Priority:  highest           |            Milestone:
       Component:  Compiler          |              Version:  8.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
                                     |  simplCore/should_compile/T13170
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D3008
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Ben Gamari <ben@…>):

 In [changeset:"abaa6815e6435ed29ad121b5e59fc017a1d3e836/ghc"
 abaa6815/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="abaa6815e6435ed29ad121b5e59fc017a1d3e836"
 Re-sort case alternatives after scrutinee constant folding (#13170)

 Commit d3b546b1a605 added a "scrutinee constant folding" pass
 that rewrites a case expression whose scrutinee is an expression like
 x +# 3#. But case expressions are supposed to have their alternatives in
 sorted order, so when the scrutinee is (for example) negateInt# x#, we
 need to re-sort the alternatives after mapping their values.

 This showed up as a core lint failure when compiling System.Process.Posix:

     isSigIntQuit n = sig == sigINT || sig == sigQUIT
         where sig = fromIntegral (-n)

 Data.List.sortBy is supposed to be linear-time on sorted or reverse-sorted
 input, so it is probably not worth doing anything more clever than this.

 Test Plan: Added a new test T13170 for the above case.

 Reviewers: austin, hsyl20, simonpj, bgamari

 Reviewed By: hsyl20, simonpj, bgamari

 Subscribers: thomie

 Differential Revision: https://phabricator.haskell.org/D3008

 GHC Trac Issues: #13170
 }}}

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


More information about the ghc-tickets mailing list