[commit: ghc] master: Avoid putting uniqs in specconstr rules; part of #4012 (ba38f99)

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/ba38f995d6312aa0cfe15873c8e5e9475e03f19c

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

commit ba38f995d6312aa0cfe15873c8e5e9475e03f19c
Author: Ian Lynagh <[email protected]>
Date:   Fri Nov 2 22:54:12 2012 +0000

    Avoid putting uniqs in specconstr rules; part of #4012
    
    There's no need to have the uniq in the rule, but its presence can
    cause spurious ABI changes.

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

 compiler/specialise/SpecConstr.lhs |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/compiler/specialise/SpecConstr.lhs b/compiler/specialise/SpecConstr.lhs
index 60c40e8..7a01ee2 100644
--- a/compiler/specialise/SpecConstr.lhs
+++ b/compiler/specialise/SpecConstr.lhs
@@ -1378,9 +1378,13 @@ spec_one env fn arg_bndrs body (call_pat@(qvars, pats), rule_number)
                                            (arg_bndrs `zip` pats)
               fn_name    = idName fn
               fn_loc     = nameSrcSpan fn_name
-              spec_occ   = mkSpecOcc (nameOccName fn_name)
-              dflags     = sc_dflags env
-              rule_name  = mkFastString ("SC:" ++ showSDoc dflags (ppr fn <> int rule_number))
+              fn_occ     = nameOccName fn_name
+              spec_occ   = mkSpecOcc fn_occ
+              -- We use fn_occ rather than fn in the rule_name string
+              -- as we don't want the uniq to end up in the rule, and
+              -- hence in the ABI, as that can cause spurious ABI
+              -- changes (#4012).
+              rule_name  = mkFastString ("SC:" ++ occNameString fn_occ ++ show rule_number)
               spec_name  = mkInternalName spec_uniq spec_occ fn_loc
 --      ; pprTrace "{spec_one" (ppr (sc_count env) <+> ppr fn <+> ppr pats <+> text "-->" <+> ppr spec_name) $
 --        return ()
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.