[GHC] #14779: Compiling with -g fails -lint-core checks

GHC ghc-devs at haskell.org
Mon Mar 5 17:13:15 UTC 2018


#14779: Compiling with -g fails -lint-core checks
-------------------------------------+-------------------------------------
        Reporter:  niteria           |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.4.2
       Component:  Compiler          |              Version:  8.3
  (Debugging)                        |
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  crash or panic                     |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #14122, #14123,   |  Differential Rev(s):  phab:D4423
  #8472, #14406                      |
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by niteria):

 > I don't get it. You've added a case to tryForCSE that looks a the
 original expression expr, not the stripped one expr''. How does that
 differ from the existing code where the test is in cse_bind?

 Sorry, perhaps I was imprecise. I pointed to code before the change, the
 code after the change is:

 {{{
 tryForCSE :: Bool -> CSEnv -> InExpr -> OutExpr
 tryForCSE toplevel env expr
   | toplevel && exprIsMbTickedLitString expr = expr
       -- See Note [Take care with literal strings]
   | Just e <- lookupCSEnv env expr'' = mkTicks ticks e
   | otherwise
 }}}

 Where `exprIsMbTickedLitString` looks through allowed ticks. I'm not
 married to the name by the way, I have a hard time coming up with a better
 one.

 For completeness:
 {{{
 exprIsMbTickedLitString :: CoreExpr -> Bool
 exprIsMbTickedLitString = isJust . exprIsMbTickedLitString_maybe

 exprIsMbTickedLitString_maybe :: CoreExpr -> Maybe CoreExpr
 exprIsMbTickedLitString_maybe e@(Lit (MachStr _)) = Just e
 exprIsMbTickedLitString_maybe (Tick t e)
   | tickishPlace t == PlaceCostCentre = Nothing
   | otherwise = exprIsMbTickedLitString_maybe e
 exprIsMbTickedLitString_maybe _ = Nothing
 }}}

 I should be able to put up a complete phab patch soon and discussing the
 details should be easier.

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


More information about the ghc-tickets mailing list