[GHC] #4012: Compilation results are not deterministic
GHC
ghc-devs at haskell.org
Fri Dec 4 14:06:11 UTC 2015
#4012: Compilation results are not deterministic
-------------------------------------+-------------------------------------
Reporter: kili | Owner: niteria
Type: bug | Status: patch
Priority: high | Milestone: 8.0.1
Component: Compiler | Version: 6.12.2
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: Other | Test Case:
Blocked By: | Blocking:
Related Tickets: #10424 | Differential Rev(s): Phab:D910,
| Phab:D1073, Phab:D1133, Phab:D1192,
| Phab:D1268, Phab:D1360, Phab:D1373,
| Phab:D1396, Phab:D1457, Phab:D1468,
Wiki Page: | Phab:D1487, Phab:D1504, Phab:D1508
-------------------------------------+-------------------------------------
Comment (by Bartosz Nitka <bnitka@…>):
In [changeset:"5b2b7e338c822c34f86e8bd3ff442a979711d1fe/ghc"
5b2b7e33/ghc]:
{{{
#!CommitTicketReference repository="ghc"
revision="5b2b7e338c822c34f86e8bd3ff442a979711d1fe"
Make callToPats deterministic in SpecConstr
This fixes a non-determinism bug where where depending on the
order of uniques allocated, the specialized workers would have different
order of arguments.
Compare:
```
$s$wgo_s1CN :: Int# -> Int -> Int#
[LclId, Arity=2, Str=DmdType <L,U><L,U>]
$s$wgo_s1CN =
\ (sc_s1CI :: Int#) (sc_s1CJ :: Int) ->
case tagToEnum# @ Bool (<=# sc_s1CI 0#) of _ [Occ=Dead] {
False ->
$wgo_s1BU (Just @ Int (I# (-# sc_s1CI 1#))) (Just @ Int
sc_s1CJ);
True -> 0#
}
```
vs
```
$s$wgo_s18mTj :: Int -> Int# -> Int#
[LclId, Arity=2, Str=DmdType <L,U><L,U>]
$s$wgo_s18mTj =
\ (sc_s18mTn :: Int) (sc_s18mTo :: Int#) ->
case tagToEnum# @ Bool (<=# sc_s18mTo 0#) of _ [Occ=Dead] {
False ->
$wgo_s18mUc
(Just @ Int (I# (-# sc_s18mTo 1#))) (Just @ Int sc_s18mTn);
True -> 0#
}
```
Test Plan:
I've added a new testcase
./validate
Reviewers: simonmar, simonpj, austin, goldfire, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1508
GHC Trac Issues: #4012
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/4012#comment:138>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list