#2224: -fhpc inteferes/prevents rewrite rules from firing
------------------------------+---------------------------------------------
    Reporter:  dons           |        Owner:  [EMAIL PROTECTED]
        Type:  bug            |       Status:  new            
    Priority:  normal         |    Milestone:                 
   Component:  Code Coverage  |      Version:  6.8.2          
    Severity:  normal         |   Resolution:                 
    Keywords:  rules, hpc     |     Testcase:                 
Architecture:  Unknown        |           Os:  Unknown        
------------------------------+---------------------------------------------
Comment (by AndyGill):

 I'm not sure what to do here. To match code that contains ticks, and
 rewrite them requires either
  * removing ticks - generally a bad idea!
  * recreating the ticks, which is hard/impossible to do in some cases.

 I suppose we could have an option to ignore ticks in rules, but this leads
 to false positives.


 Also consider:
 {{{
   {-# RULES
     "pack/packAddress" forall s . pack (unpackCString# s) = B.packAddress
 s
    #-}
 }}}

 pack and unpackCString are strict, so we have tick equivalence!


 {{{

     tick<1>pack(tick<2>unpackCString# (tick<3> s))
 }}}

 is the same as
 {{{
    tick<1,2,3>pack(unpackCString# s)
 }}}
 The tick lifting has given us the original match.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2224#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to