[GHC] #10218: GHC creates incorrect code which throws <<loop>>

GHC ghc-devs at haskell.org
Fri Apr 3 16:17:22 UTC 2015


#10218: GHC creates incorrect code which throws <<loop>>
-------------------------------------+-------------------------------------
        Reporter:  yongqli           |                   Owner:
            Type:  bug               |                  Status:  new
        Priority:  normal            |               Milestone:
       Component:  Compiler          |                 Version:  7.10.1
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  None/Unknown      |  Unknown/Multiple
      Blocked By:                    |               Test Case:  yes
 Related Tickets:                    |                Blocking:
                                     |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by AlexET):

 Looking at the difference in usage demands it seems that there is a
 variable (specifically a dictionary for A) with demand `<L,1*U(A,1*U)>`.
 But it is used twice, specifically its first component (a Foldable
 dictionary) is also used.

 This demand was correct in the dump-stranal file but then later the first
 component is used (due to cse) in a later section. This means the usage
 demand is incorrect. In the working version it is used in both locations
 already during demand analysis and hence is given the correct usage
 information.

 I don't know if this is the cause or whether the demand analysis
 information is irrelevant after cse. But if the demand analysis is used
 after cse then cse should make sure sure it is correct.

 I have tried making a smaller example but I am finding it hard to get cse
 to fire (most examples are inlined first before cse can fire but cse wont
 fire if they are marked noinline).

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


More information about the ghc-tickets mailing list