[GHC] #9853: Stateful transformation causes non-termination in Hoopl analysis.

GHC ghc-devs at haskell.org
Tue Dec 2 03:51:08 UTC 2014


#9853: Stateful transformation causes non-termination in Hoopl analysis.
-------------------------------------+-------------------------------------
       Reporter:  AndreasVoellmy     |                   Owner:
           Type:  bug                |                  Status:  new
       Priority:  normal             |               Milestone:
      Component:  libraries/hoopl    |                 Version:  7.8.3
       Keywords:                     |        Operating System:
   Architecture:  Unknown/Multiple   |  Unknown/Multiple
     Difficulty:  Unknown            |         Type of failure:  Incorrect
     Blocked By:                     |  result at runtime
Related Tickets:                     |               Test Case:
                                     |                Blocking:
                                     |  Differential Revisions:
-------------------------------------+-------------------------------------
 It seems that Hoopl's analyses may apply rewrites to nodes multiple times
 without invoking the `restart` function between applications. This causes
 havoc for code transformations that have side-effects, for example a
 transformation that introduces a new variable to hold some intermediate
 result. In such an analysis, a transformation may introduce a new
 variable, which leads to a changed fact. Later the transformation may be
 run again, leading to a new fact, and so on (when there is a loop in the
 control flow.

 The attached example illustrates this problem. This example modifies the
 constant propagation pass provided in the testing directory of the hoopl
 library. The example added a new instruction called "Funny" that gets
 rewritten to an unconditional branch instruction and introduces a new
 variable. The main program P1 performs the analysis on a particular
 program that has a loop in the control flow graph and causes the hoopl
 analysis to run forever.

 Is this a bug in Hoopl? Ie. should analyses that have side-effects
 involving checkpointed state be supported? If not, could it be changed to
 support these analyses?

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


More information about the ghc-tickets mailing list