Opened 7 years ago

Closed 7 years ago

#4918 closed bug (fixed)

Rule matcher failing to look through an imported inlining

Reported by: simonpj Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.0.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case: simplCore/should_compile/T4918
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

Pedro reported

module M1 where
  class MyEnum a where myEnum :: [a]
  instance MyEnum () where myEnum = [()]
 
module M2 where
  import M1

  f1 = map (\() -> 'p') [()]
  f2 = map (\() -> 'q') myEnum

The code for f1 was optimised (by rewrite rules) to

  f1 = ['p']

but the code for f2 wasn't.

Change History (2)

comment:1 Changed 7 years ago by simonpj

Status: newmerge
Test Case: simplCore/should_compile/T4918

Fixed by

Wed Jan 26 17:18:03 GMT 2011  simonpj@microsoft.com
  * Fix bug in roughTopNames
  
  roughTopNames was returning a name that in fact might be
  "looked though" by the rule matcher. Result: a rule
  that should match was being pre-emptively discarded.
  
  See Note [Care with roughTopName].
  
  Fixes a bug noticed by Pedro (Trac #4918).

    M ./compiler/specialise/Rules.lhs -3 +23

comment:2 Changed 7 years ago by igloo

Resolution: fixed
Status: mergeclosed

Merged

Note: See TracTickets for help on using tickets.