[project @ 2005-03-07 16:46:08 by simonpj]
authorsimonpj <unknown>
Mon, 7 Mar 2005 16:46:24 +0000 (16:46 +0000)
committersimonpj <unknown>
Mon, 7 Mar 2005 16:46:24 +0000 (16:46 +0000)
commit36d22a1cb608e8572776ab6d402fd0c1a9287dc5
tree3241986e4d279213a1692c7e9e1d3519cbe0ddb3
parent30d8d38329e64d61a62aa9a7fd7878a123204a0e
[project @ 2005-03-07 16:46:08 by simonpj]
-----------------------------------------
       Fix a long-standing indirection-zapping bug
-----------------------------------------

Merge to STABLE

Up to now we zap indirections as part of the occurence analyser.
But this is bogus.  The indirection zapper does the following:

x_local = <expression>
...bindings...
x_exported = x_local

where x_exported is exported, and x_local is not, then we
replace it with this:

x_exported = <expression>
x_local = x_exported
...bindings...

But this is plain wrong if x_exported has a RULE that mentions
something (f, say) in ...bindings.., because 'f' will then die.

After hacking a few solutions, I've eventually simply made the indirection
zapping into a separate pass (which is cleaner anyway), which wraps the
entire program back into a single Rec if the bad thing can happen.

On the way I've made indirection-zapping work in Recs too, which wasn't the
case before.

* Move the zapper from OccurAnal into SimplCore
* Tidy up the printing of pragmas (PprCore and friends)
* Add a new function Rules.addRules
* Merge rules in the indirection zapper (previously one set was discarded)
ghc/compiler/basicTypes/BasicTypes.lhs
ghc/compiler/basicTypes/IdInfo.lhs
ghc/compiler/basicTypes/MkId.lhs
ghc/compiler/coreSyn/PprCore.lhs
ghc/compiler/main/CodeOutput.lhs
ghc/compiler/simplCore/OccurAnal.lhs
ghc/compiler/simplCore/SimplCore.lhs
ghc/compiler/specialise/Rules.lhs