[commit: ghc] master: Add a rule for (plusAddr# x 0) == x; fixes #7284 (b093521)

Ian Lynagh <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/b09352165101afb1d5f502350664dfc7a5bba10c

>---------------------------------------------------------------

commit b09352165101afb1d5f502350664dfc7a5bba10c
Author: Ian Lynagh <[email protected]>
Date:   Sun Oct 21 14:48:29 2012 +0100

    Add a rule for (plusAddr# x 0) == x; fixes #7284

>---------------------------------------------------------------

 compiler/prelude/PrelRules.lhs |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/compiler/prelude/PrelRules.lhs b/compiler/prelude/PrelRules.lhs
index baa50f8..dcfb530 100644
--- a/compiler/prelude/PrelRules.lhs
+++ b/compiler/prelude/PrelRules.lhs
@@ -241,6 +241,8 @@ primOpRules nm WordLtOp   = mkRelOpRule nm (<)  [ boundsCmp Lt ]
 primOpRules nm WordEqOp   = mkRelOpRule nm (==) [ litEq True ]
 primOpRules nm WordNeOp   = mkRelOpRule nm (/=) [ litEq False ]
 
+primOpRules nm AddrAddOp  = mkPrimOpRule nm 2 [ rightIdentityDynFlags zeroi ]
+
 primOpRules nm SeqOp      = mkPrimOpRule nm 4 [ seqRule ]
 primOpRules nm SparkOp    = mkPrimOpRule nm 4 [ sparkRule ]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.