summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorJoachim Breitner <mail@joachim-breitner.de>2014-10-17 11:09:16 +0200
committerJoachim Breitner <mail@joachim-breitner.de>2014-10-17 15:37:17 +0200
commita477e8118137b7483d0a7680c1fd337a007a023b (patch)
tree96abb63aa5b33b1bba773c5f9e23826e02032cda /compiler
parentd7867810d5ffd08c77c30e928bb3dca21beae0b9 (diff)
downloadhaskell-a477e8118137b7483d0a7680c1fd337a007a023b.tar.gz
Avoid printing uniques in specialization rules
Akio found an avoidable cause of non-determinisim: The names of RULES generated by Specialise had uniques in them: "SPEC $cshowsPrec_a2QX @ [GHC.Types.Char]" [ALWAYS] forall ... By using showSDocForUser instead of showSDocDump when building the rule name, this is avoided: "SPEC $cshowsPrec @ [Char]" [ALWAYS] forall ... See #4012, comments 61ff.
Diffstat (limited to 'compiler')
-rw-r--r--compiler/specialise/Specialise.lhs6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/specialise/Specialise.lhs b/compiler/specialise/Specialise.lhs
index 09acd70e74..bc04e063ef 100644
--- a/compiler/specialise/Specialise.lhs
+++ b/compiler/specialise/Specialise.lhs
@@ -1196,8 +1196,12 @@ specCalls mb_mod env rules_for_me calls_for_me fn rhs
Just this_mod -- Specialising imoprted fn
-> ptext (sLit "SPEC/") <> ppr this_mod
- rule_name = mkFastString $ showSDocDump dflags $
+ rule_name = mkFastString $ showSDocForUser dflags neverQualify $
herald <+> ppr fn <+> hsep (map ppr_call_key_ty call_ts)
+ -- This name ends up in interface files, so use showSDocForUser,
+ -- otherwise uniques end up there, making builds
+ -- less deterministic (See #4012 comment:61 ff)
+
spec_env_rule = mkRule True {- Auto generated -} is_local
rule_name
inl_act -- Note [Auto-specialisation and RULES]