[GHC] #9157: cmm common block not eliminated

GHC ghc-devs at haskell.org
Sat May 31 14:26:34 UTC 2014


#9157: cmm common block not eliminated
------------------------------------+-------------------------------------
       Reporter:  wojteknar         |             Owner:
           Type:  bug               |            Status:  new
       Priority:  normal            |         Milestone:
      Component:  Compiler          |           Version:  7.8.2
       Keywords:                    |  Operating System:  Unknown/Multiple
   Architecture:  Unknown/Multiple  |   Type of failure:  Other
     Difficulty:  Unknown           |         Test Case:
     Blocked By:                    |          Blocking:
Related Tickets:                    |
------------------------------------+-------------------------------------
 For the toTuple# function (in the attached file) GHC generates a cmm
 switch statement, with all the alternatives, unsurprisingly, the same.
 Yet, cmm common block elimination does not kick in.

 In this particular example, the whole case statement could be annihilated,
 because all alternatives lead to the same code.

 BTW, this is how they match in France.
 {{{
 #!ocaml
 type alt = A of int | B of int | C of int | D of int
 let g x = match x with A v | B v  | C v | D v -> v
 }}}

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


More information about the ghc-tickets mailing list