ghc.git
3 years agoMinor refactoring
Simon Peyton Jones [Thu, 9 Jun 2016 13:44:00 +0000 (14:44 +0100)] 
Minor refactoring

Use tauifyExpType rather than something hand-rolled

3 years agoComments only
Simon Peyton Jones [Thu, 9 Jun 2016 13:42:26 +0000 (14:42 +0100)] 
Comments only

...about unarisation and unboxed tuples

3 years agoRefine imports slightly
Simon Peyton Jones [Wed, 1 Jun 2016 13:48:56 +0000 (14:48 +0100)] 
Refine imports slightly

3 years agoComments only
Simon Peyton Jones [Wed, 1 Jun 2016 13:48:36 +0000 (14:48 +0100)] 
Comments only

3 years agoFix #12099: Remove bogus flags
Sean Gillespie [Fri, 10 Jun 2016 10:53:37 +0000 (12:53 +0200)] 
Fix #12099: Remove bogus flags

Remove -fwarn- and -fno-warn- from flagsForCompletion

Testcase: Fix linter error on T12099

For Issue #12099

Reviewers: austin, thomie, bgamari

Reviewed By: austin, thomie, bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2281

GHC Trac Issues: #12099

3 years agoRemove Printer.c:prettyPrintClosure()
Ömer Sinan Ağacan [Fri, 10 Jun 2016 11:13:47 +0000 (07:13 -0400)] 
Remove Printer.c:prettyPrintClosure()

It turns out this function was unused and broken for a long time (fixed
with b0a7664). Removing it as it will probably get broken again in the
future and it's unused.

Reviewers: austin, erikd, simonmar, nomeata, bgamari

Reviewed By: nomeata, bgamari

Subscribers: Phyx, thomie, nomeata

Differential Revision: https://phabricator.haskell.org/D2322

3 years agoprettyPrintClosure(): Untag the closure before accessing fields
Ömer Sinan Ağacan [Fri, 10 Jun 2016 10:20:00 +0000 (06:20 -0400)] 
prettyPrintClosure(): Untag the closure before accessing fields

(This fixes segfaults)

3 years agoImprove the error messages for static forms.
Facundo Domínguez [Thu, 9 Jun 2016 15:37:42 +0000 (17:37 +0200)] 
Improve the error messages for static forms.

Now the message explains why closed variables are not closed when
encountered in the body of (static ...).

This required adding to the local environment the free variables of
the local bindings in scope. Thus we can analyze and explain why a
variable is not closed when encountered.

Test Plan: ./validate

Reviewers: austin, simonpj, bgamari

Reviewed By: bgamari

Subscribers: mboes, thomie

Differential Revision: https://phabricator.haskell.org/D2167

GHC Trac Issues: #12003

3 years agoFix Ticky histogram on Windows
Tamar Christina [Thu, 9 Jun 2016 15:49:20 +0000 (17:49 +0200)] 
Fix Ticky histogram on Windows

Summary:
The histogram types are defined in `Ticky.c` as `StgInt` values.

```
EXTERN StgInt RET_NEW_hst[TICKY_BIN_COUNT] INIT({0});
EXTERN StgInt RET_OLD_hst[TICKY_BIN_COUNT] INIT({0});
EXTERN StgInt RET_UNBOXED_TUP_hst[TICKY_BIN_COUNT] INIT({0});
```

which means they'll be `32-bits` on `x86` and `64-bits` on `x86_64`.

However the `bumpHistogram` in `StgCmmTicky` is incrementing them as if
they're a `cLong`. A long on Windows `x86_64` is `32-bit`.

As such when then value for the `_hst_1` is being set what it's actually doing
is setting the value of the high bits of the first entry.

This ends up giving us `0b‭100000000000000000000000000000000‬` or `4294967296`
as is displayed in the ticket on #8308.

Since `StgInt` is defined using the `WORD` size. Just use that directly in
`bumpHistogram`.

Also since `cLong` is no longer used after this commit it will also be dropped.

Test Plan: make TEST=T8308

Reviewers: mlen, jstolarek, bgamari, thomie, goldfire, simonmar, austin

Reviewed By: bgamari, thomie

Subscribers: #ghc_windows_task_force

Differential Revision: https://phabricator.haskell.org/D2318

GHC Trac Issues: #8308

3 years agoDocs: delete PatternGuards documentation
Thomas Miedema [Thu, 9 Jun 2016 11:51:09 +0000 (13:51 +0200)] 
Docs: delete PatternGuards documentation

Since `-XPatternGuards` is enabled by default, invert the logic and
mention `-XNoPatternGuards` first.

Also, since this is a Haskell 2010 feature, refer to the language report
instead of explaining it.

In general, I would like to follow the guideline of assuming the latest
language report as a given, and then only report GHC's deviations and
extensions relative to that report.

Reviewed by: bgamari

Differential Revision: https://phabricator.haskell.org/D2319

GHC Trac Issues: #12172

3 years agoRemove Ord AltCon
Bartosz Nitka [Thu, 9 Jun 2016 14:25:11 +0000 (07:25 -0700)] 
Remove Ord AltCon

It uses Ord DataCon which uses Ord Unique which is
nondeterministic

GHC Trac: #4012

3 years agoRemove Ord PatSyn
Bartosz Nitka [Thu, 9 Jun 2016 11:52:48 +0000 (04:52 -0700)] 
Remove Ord PatSyn

It's implemented in terms of Unique which is nondeterministic

GHC Trac: #4012

3 years agoRemove Ord Class
Bartosz Nitka [Thu, 9 Jun 2016 11:48:15 +0000 (04:48 -0700)] 
Remove Ord Class

It was implemented in terms of Unique which is nondeterministic

GHC Trac: #4012

3 years agoDocs: fix links to ghc-flags
Thomas Miedema [Thu, 9 Jun 2016 11:26:35 +0000 (13:26 +0200)] 
Docs: fix links to ghc-flags

3 years agoTestsuite: delete dead code [skip ci]
Thomas Miedema [Wed, 8 Jun 2016 13:38:40 +0000 (15:38 +0200)] 
Testsuite: delete dead code [skip ci]

3 years agoRemove Ord (CoAxiom br)
Bartosz Nitka [Thu, 9 Jun 2016 10:55:38 +0000 (03:55 -0700)] 
Remove Ord (CoAxiom br)

It was implemented in terms of Uniques, but fortunately it's unused
so we can remove it.

GHC Trac: #4012

3 years agoImplement Eq TyCon directly
Bartosz Nitka [Thu, 9 Jun 2016 10:49:00 +0000 (03:49 -0700)] 
Implement Eq TyCon directly

Eq TyCon is defined in terms of Ord TyCon, but we want to
remove Ord TyCon, because it's implemented in terms of unique
comparison, which is nondeterministic.

GHC Trac: #4012

3 years agoRemove special casing of Windows in generic files
Tamar Christina [Tue, 31 May 2016 18:12:55 +0000 (20:12 +0200)] 
Remove special casing of Windows in generic files

Summary:
Remove some Windows specific code from the .m4 files
and have configure figure it out.

Unfortunately touchy can't be removed since there
is no mingw build of coreutils. Only msys builds
which would give us a dependency on the msys runtime.

Reviewers: hvr, austin, thomie, bgamari

Reviewed By: thomie, bgamari

Subscribers: thomie, erikd, #ghc_windows_task_force

Differential Revision: https://phabricator.haskell.org/D2248

3 years agoFix #12076 by inlining trivial expressions in CorePrep.
Edward Z. Yang [Tue, 17 May 2016 04:05:24 +0000 (21:05 -0700)] 
Fix #12076 by inlining trivial expressions in CorePrep.

Summary:
This mostly follows the plan detailed by the discussion
Simon and I had, with one difference: instead of grabbing
the free variables of the trivial expressions to get the
embedded Ids, we just use getIdFromTrivialExpr_maybe to extract
out the Id.  If there is no Id, the expression cannot
refer to a function (as there are no literal functions)
and thus we do not need to saturate.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate

Reviewers: simonpj, austin, bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2309

GHC Trac Issues: #12076

3 years agoMinor performance note about IdInfo.
Edward Z. Yang [Mon, 6 Jun 2016 17:18:57 +0000 (10:18 -0700)] 
Minor performance note about IdInfo.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
3 years agoFix #12064 by making IfaceClass typechecking more lazy.
Edward Z. Yang [Sun, 15 May 2016 23:13:51 +0000 (16:13 -0700)] 
Fix #12064 by making IfaceClass typechecking more lazy.

Summary:
Comes with a test based off of prog006.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate

Reviewers: simonpj, austin, bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2221

GHC Trac Issues: #12064

3 years agoShow sources of cost centers in .prof
Ömer Sinan Ağacan [Wed, 8 Jun 2016 13:30:32 +0000 (09:30 -0400)] 
Show sources of cost centers in .prof

This fixes the problem with duplicate cost-centre names that was
reported a couple of times before. When a module implements a typeclass
multiple times for different types, methods of different implementations
get same cost-centre names and are reported like this:

    COST CENTRE MODULE            %time %alloc

    CAF         GHC.IO.Handle.FD    0.0   32.8
    CAF         GHC.Read            0.0    1.0
    CAF         GHC.IO.Encoding     0.0    1.8
    showsPrec   Main                0.0    1.2
    readPrec    Main                0.0   19.4
    readPrec    Main                0.0   20.5
    main        Main                0.0   20.2

                                            individual      inherited
    COST CENTRE  MODULE  no.     entries  %time %alloc   %time %alloc

    MAIN         MAIN     53          0    0.0    0.2     0.0  100.0
     CAF         Main    105          0    0.0    0.3     0.0   62.5
      readPrec   Main    109          1    0.0    0.6     0.0    0.6
      readPrec   Main    107          1    0.0    0.6     0.0    0.6
      main       Main    106          1    0.0   20.2     0.0   61.0
       ==        Main    114          1    0.0    0.0     0.0    0.0
       ==        Main    113          1    0.0    0.0     0.0    0.0
       showsPrec Main    112          2    0.0    1.2     0.0    1.2
       showsPrec Main    111          2    0.0    0.9     0.0    0.9
       readPrec  Main    110          0    0.0   18.8     0.0   18.8
       readPrec  Main    108          0    0.0   19.9     0.0   19.9

It's not possible to tell from the report which `==` took how long. This
patch adds one more column at the cost of making outputs wider. The
report now looks like this:

    COST CENTRE MODULE           SRC                       %time %alloc

    CAF         GHC.IO.Handle.FD <entire-module>             0.0   32.9
    CAF         GHC.IO.Encoding  <entire-module>             0.0    1.8
    CAF         GHC.Read         <entire-module>             0.0    1.0
    showsPrec   Main             Main_1.hs:7:19-22           0.0    1.2
    readPrec    Main             Main_1.hs:7:13-16           0.0   19.5
    readPrec    Main             Main_1.hs:4:13-16           0.0   20.5
    main        Main             Main_1.hs:(10,1)-(20,20)    0.0   20.2

                                                                       individual      inherited
    COST CENTRE  MODULE        SRC                      no. entries  %time %alloc   %time %alloc

    MAIN         MAIN          <built-in>                53      0    0.0    0.2     0.0  100.0
     CAF         Main          <entire-module>          105      0    0.0    0.3     0.0   62.5
      readPrec   Main          Main_1.hs:7:13-16        109      1    0.0    0.6     0.0    0.6
      readPrec   Main          Main_1.hs:4:13-16        107      1    0.0    0.6     0.0    0.6
      main       Main          Main_1.hs:(10,1)-(20,20) 106      1    0.0   20.2     0.0   61.0
       ==        Main          Main_1.hs:7:25-26        114      1    0.0    0.0     0.0    0.0
       ==        Main          Main_1.hs:4:25-26        113      1    0.0    0.0     0.0    0.0
       showsPrec Main          Main_1.hs:7:19-22        112      2    0.0    1.2     0.0    1.2
       showsPrec Main          Main_1.hs:4:19-22        111      2    0.0    0.9     0.0    0.9
       readPrec  Main          Main_1.hs:7:13-16        110      0    0.0   18.8     0.0   18.8
       readPrec  Main          Main_1.hs:4:13-16        108      0    0.0   19.9     0.0   19.9
     CAF         Text.Read.Lex <entire-module>          102      0    0.0    0.5     0.0    0.5

To fix failing test cases because of different orderings of cost centres
(e.g. optimized and non-optimized build printing in different order),
with this patch we also start sorting cost centres before printing. The
order depends on 1) entries (more entered cost centres come first) 2)
names (using strcmp() on cost centre names).

Reviewers: simonmar, austin, erikd, bgamari

Reviewed By: simonmar, bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2282

GHC Trac Issues: #11543, #8473, #7105

3 years agoLiteral: Remove unused hashLiteral function
Ömer Sinan Ağacan [Wed, 8 Jun 2016 12:16:53 +0000 (08:16 -0400)] 
Literal: Remove unused hashLiteral function

3 years agoReport term sizes with -v3 even when -ddump is enabled
Ömer Sinan Ağacan [Wed, 8 Jun 2016 11:02:29 +0000 (07:02 -0400)] 
Report term sizes with -v3 even when -ddump is enabled

This is the proper fix for the problem I tried solve with D2310
(committed as dd33245 and reverted in 44a3c18).

Reviewers: austin, goldfire, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2315

3 years agoRevert "Desugar: Display resulting program stats with -v2"
Ömer Sinan Ağacan [Wed, 8 Jun 2016 08:55:17 +0000 (04:55 -0400)] 
Revert "Desugar: Display resulting program stats with -v2"

This reverts commit dd33245922a9d363bdb8c34d00ed4d1574bc5285.

It seems like we already have `endPassIO` calls here, which should print
term sizes. For some reason they don't sometimes, and we need to
understand why instead of adding more prints.

3 years agoDesugar: Display resulting program stats with -v2
Ömer Sinan Ağacan [Wed, 8 Jun 2016 08:47:05 +0000 (04:47 -0400)] 
Desugar: Display resulting program stats with -v2

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2310

3 years agoAdd some determinism tests
Bartosz Nitka [Tue, 7 Jun 2016 20:04:22 +0000 (13:04 -0700)] 
Add some determinism tests

These are the tests that I accumulated fixing real issues.
Each test is a separate thing that was broken and they are
relatively small.

GHC Trac: #4012

3 years agoTestsuite Windows: mark T8308 expect_broken (#8308)
Thomas Miedema [Tue, 7 Jun 2016 19:13:34 +0000 (21:13 +0200)] 
Testsuite Windows: mark T8308 expect_broken (#8308)

3 years agoTestsuite driver: always quote opts.testdir
Thomas Miedema [Tue, 7 Jun 2016 13:59:15 +0000 (15:59 +0200)] 
Testsuite driver: always quote opts.testdir

This makes sure the testsuite keeps working when testdir contains
backward slashes.

Differential Revision: https://phabricator.haskell.org/D2314

3 years agoTypofix.
Edward Z. Yang [Tue, 7 Jun 2016 21:13:42 +0000 (14:13 -0700)] 
Typofix.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
3 years agoUse pprUFM in pprStgLVs
Bartosz Nitka [Tue, 7 Jun 2016 15:43:58 +0000 (08:43 -0700)] 
Use pprUFM in pprStgLVs

3 years agoKill varSetElems
Bartosz Nitka [Tue, 7 Jun 2016 14:47:42 +0000 (07:47 -0700)] 
Kill varSetElems

This eradicates varSetElems from the codebase. This function
used to introduce nondeterminism.
I've also documented benign nondeterminism in three places.

GHC Trac: #4012

3 years agoMake vectInfoParallelVars a DVarSet
Bartosz Nitka [Tue, 7 Jun 2016 14:19:30 +0000 (07:19 -0700)] 
Make vectInfoParallelVars a DVarSet

We dump it in the interface file, so we need to do it in a
deterministic order. I haven't seen any problems with this
during my testing, but that's probably because it's unused.

Test Plan: ./validate

Reviewers: simonmar, austin, bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2313

GHC Trac Issues: #4012

3 years agoDocument determinism in pprintClosureCommand
Bartosz Nitka [Tue, 7 Jun 2016 14:33:45 +0000 (07:33 -0700)] 
Document determinism in pprintClosureCommand

Like described in the comment, it's OK here.

GHC Trac: #4012

3 years agoUse DVarSet in Vectorise.Exp
Bartosz Nitka [Tue, 7 Jun 2016 13:28:51 +0000 (06:28 -0700)] 
Use DVarSet in Vectorise.Exp

I believe this part of code is a bit unused. That's
probably why it never became a problem in my testing.
I'm changing to deterministic sets here to be safer.

Test Plan: ./validate

Reviewers: simonmar, austin, bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2312

GHC Trac Issues: #4012

3 years agoKill varSetElems in checkValidInferredKinds
Bartosz Nitka [Tue, 7 Jun 2016 13:53:14 +0000 (06:53 -0700)] 
Kill varSetElems in checkValidInferredKinds

It's only used for producing an error message here

GHC Trac: #4012

3 years agoFix build by removing unused import
Bartosz Nitka [Tue, 7 Jun 2016 13:41:12 +0000 (06:41 -0700)] 
Fix build by removing unused import

3 years agoKill two instances of uniqSetToList
Bartosz Nitka [Tue, 7 Jun 2016 12:36:43 +0000 (05:36 -0700)] 
Kill two instances of uniqSetToList

There should be no performance impact of switching to the
deterministic set here.

GHC Trac: #4012

3 years agoCoreToStg: Remove hand-written Eq instances of HowBound and LetInfo
Ömer Sinan Ağacan [Tue, 7 Jun 2016 13:15:22 +0000 (09:15 -0400)] 
CoreToStg: Remove hand-written Eq instances of HowBound and LetInfo

3 years agoUse a deterministic map for imp_dep_mods
Bartosz Nitka [Tue, 7 Jun 2016 12:55:50 +0000 (05:55 -0700)] 
Use a deterministic map for imp_dep_mods

This lets us remove some normalization and makes it
less brittle for the future.

Test Plan: ./validate

Reviewers: ezyang, austin, bgamari, simonmar

Reviewed By: simonmar

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2311

GHC Trac Issues: #4012

3 years agoKill occSetElts
Bartosz Nitka [Tue, 7 Jun 2016 12:23:32 +0000 (05:23 -0700)] 
Kill occSetElts

It uses uniqSetToList which is nondeterministic.

GHC Trac: #4012

3 years agoMerge MatchFixity and HsMatchContext
Alan Zimmerman [Tue, 24 May 2016 22:09:34 +0000 (00:09 +0200)] 
Merge MatchFixity and HsMatchContext

Summary:
MatchFixity was introduced to facilitate use of API Annotations.

HsMatchContext does the same thing with more detail, but is chased
through all over the place to provide context when processing a Match.

Since we already have MatchFixity in the Match, it may as well provide
the full context.

updates submodule haddock

Test Plan: ./validate

Reviewers: austin, goldfire, bgamari

Subscribers: thomie, mpickering

Differential Revision: https://phabricator.haskell.org/D2271

GHC Trac Issues: #12105

(cherry picked from commit 306ecad591951521ac3f5888ca8be85bf749d271)

3 years agoMake UnitIdMap a deterministic map
Bartosz Nitka [Mon, 6 Jun 2016 15:54:17 +0000 (08:54 -0700)] 
Make UnitIdMap a deterministic map

This impacts at least the order in which version macros are
generated. It's pretty hard to track what kind of nondeterminism
is benign and this should have no performance impact as the number
of packages should be relatively small.

Test Plan: ./validate

Reviewers: simonmar, austin, bgamari, ezyang

Reviewed By: ezyang

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2308

GHC Trac Issues: #4012

3 years agoKill foldUniqSet
Bartosz Nitka [Mon, 6 Jun 2016 15:15:43 +0000 (08:15 -0700)] 
Kill foldUniqSet

I planned to just say that we don't care about this part.
Turns out I was able to document away the uses in the codegenerator.

Test Plan: ./validate

Reviewers: simonmar, austin, bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2307

GHC Trac Issues: #4012

3 years agoDocument putDictionary determinism
Bartosz Nitka [Mon, 6 Jun 2016 14:38:03 +0000 (07:38 -0700)] 
Document putDictionary determinism

Summary: Like explained in the comment it's OK here.

Test Plan: ./validate

Reviewers: simonmar, austin, bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2306

GHC Trac Issues: #4012

3 years agoKill nameSetElems
Bartosz Nitka [Mon, 6 Jun 2016 13:53:25 +0000 (06:53 -0700)] 
Kill nameSetElems

nameSetElems used `eltsUFM` which is nondeterministic.

Test Plan: ./validate

Reviewers: simonmar, austin, bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2305

GHC Trac Issues: #4012

3 years agoDesugar ApplicativeDo and RecDo deterministically
Bartosz Nitka [Mon, 6 Jun 2016 13:08:54 +0000 (06:08 -0700)] 
Desugar ApplicativeDo and RecDo deterministically

This fixes a problem described in
Note [Deterministic ApplicativeDo and RecursiveDo desugaring].

Test Plan: ./validate + new testcase

Reviewers: simonpj, bgamari, austin, simonmar

Reviewed By: simonmar

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2287

GHC Trac Issues: #4012

3 years agoAdd @since annotations to base instances
Seraphime Kirkovski [Mon, 6 Jun 2016 10:29:38 +0000 (12:29 +0200)] 
Add @since annotations to base instances

Add @since annotations to instances in `base`.

Test Plan:
 * ./validate  # some commets shouldn't break the build
 * review the annotations for absurdities.

Reviewers: ekmett, goldfire, RyanGlScott, austin, hvr, bgamari

Reviewed By: RyanGlScott, hvr, bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2277

GHC Trac Issues: #11767

3 years agoImplement deterministic CallInfoSet
Bartosz Nitka [Mon, 6 Jun 2016 11:36:21 +0000 (04:36 -0700)] 
Implement deterministic CallInfoSet

We need CallInfoSet to be deterministic because it determines the
order that the binds get generated.

Currently it's not deterministic because it's keyed on
`CallKey = [Maybe Type]` and `Ord CallKey` is implemented
with `cmpType` which is nondeterministic.

See Note [CallInfoSet determinism] for more details.

Test Plan: ./validate

Reviewers: simonpj, bgamari, austin, simonmar

Reviewed By: simonmar

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2242

GHC Trac Issues: #4012

3 years agoUse UniqDFM for HomePackageTable
Bartosz Nitka [Mon, 6 Jun 2016 09:10:07 +0000 (02:10 -0700)] 
Use UniqDFM for HomePackageTable

This isn't strictly necessary for deterministic ABIs.
The results of eltsHpt are consumed in two ways:
1) they determine the order of linking
2) if you track the data flow all the family instances get put in
   FamInstEnvs, so the nondeterministic order is forgotten.
3) same for VectInfo stuff
4) same for Annotations

The problem is that I haven't found a nice way to do 2. in
a local way and 1. is nice to have if we went for deterministic
object files. Besides these maps are keyed on ModuleNames so they
should be small relative to other things and the overhead should
be negligible.

As a bonus we also get more specific names.

Test Plan: ./validate

Reviewers: bgamari, austin, hvr, ezyang, simonmar

Reviewed By: simonmar

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2300

GHC Trac Issues: #4012

3 years agoFailing test-case for #12135.
Edward Z. Yang [Sun, 5 Jun 2016 18:40:35 +0000 (11:40 -0700)] 
Failing test-case for #12135.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
3 years agoBetter comment for orIfNotFound.
Edward Z. Yang [Mon, 16 May 2016 18:31:12 +0000 (11:31 -0700)] 
Better comment for orIfNotFound.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
3 years agoTestsuite: fixup comments for T9872d [skip ci]
Thomas Miedema [Sun, 5 Jun 2016 11:29:34 +0000 (13:29 +0200)] 
Testsuite: fixup comments for T9872d [skip ci]

Resolve confusion resulting from:
6746549772c5cc0ac66c0fce562f297f4d4b80a2 (typo in 64 + 32 bit numbers)
ae86eb9f72fa7220fe47ac54d6d21395691c1308 (corrects 64 bit number)
1a8d61ca1a54820d2bc30c6a964312faf76d0635 (corrects 32 bit number)

3 years agoAdd relocation type R_X86_64_REX_GOTPCRELX
Tamar Christina [Sun, 5 Jun 2016 07:59:05 +0000 (09:59 +0200)] 
Add relocation type R_X86_64_REX_GOTPCRELX

Summary:
Adding support for the `R_X86_64_REX_GOTPCRELX` relocation type.
This relocation is treated by the linker the same as the `R_X86_64_GOTPCRELX` type
`G + GOT + A - P` to generate relative offsets to the GOT.
The `REX` prefix has no influence in this stage.

This is based on https://github.com/hjl-tools/x86-psABI/wiki/x86-64-psABI-r252.pdf

Test Plan: ./validate

Reviewers: erikd, austin, bgamari, simonmar

Reviewed By: erikd

Subscribers: thomie, #ghc_windows_task_force

Differential Revision: https://phabricator.haskell.org/D2303

GHC Trac Issues: #12147

3 years agoReplace hand-written Bounded instances with derived ones
Ryan Scott [Sat, 4 Jun 2016 21:59:47 +0000 (17:59 -0400)] 
Replace hand-written Bounded instances with derived ones

Summary:
The spiritual successor to D2291, since deriving `Bounded` instances
in `GHC.Enum` wasn't possible prior to changes made in that Diff.

This Diff finds every manually implemented `Bounded` instance in `base` that is
completely equivalent to the derived instances, and replaces it.

Reviewers: bgamari, goldfire, austin, hvr

Reviewed By: austin, hvr

Subscribers: thomie, rwbarton

Differential Revision: https://phabricator.haskell.org/D2301

3 years agoRefactor the SymbolName and SymbolAddr types to be pointers
Tamar Christina [Sat, 4 Jun 2016 11:07:32 +0000 (13:07 +0200)] 
Refactor the SymbolName and SymbolAddr types to be pointers

Take the pointer notation out of the typedef such that it preserves the
fact that these are pointers at the use site.

Test Plan:
./validate on all platforms that use the runtime linker.

For unix platforms please ensure `DYNAMIC_GHC_PROGRAMS=NO` is
 added to your validate file.

Continuation of D2250

Reviewers: austin, bgamari, simonmar, erikd

Reviewed By: erikd

Subscribers: thomie, #ghc_windows_task_force

Differential Revision: https://phabricator.haskell.org/D2302

GHC Trac Issues: #11816

3 years agoRename isPinnedByteArray# to isByteArrayPinned#
Ben Gamari [Fri, 3 Jun 2016 20:22:42 +0000 (22:22 +0200)] 
Rename isPinnedByteArray# to isByteArrayPinned#

Reviewers: simonmar, duncan, erikd, austin

Reviewed By: austin

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2290

GHC Trac Issues: #12059

3 years agoRTS SMP: Use compiler built-ins on all platforms.
Peter Trommler [Fri, 3 Jun 2016 20:22:23 +0000 (22:22 +0200)] 
RTS SMP: Use compiler built-ins on all platforms.

Use C compiler builtins for atomic SMP primitives. This saves a lot
of CPP ifdefs.

Add test for atomic xchg:
Test if __sync_lock_test_and_set() builtin stores the second argument.
The gcc manual says the actual value stored is implementation defined.

Test Plan: validate and eyeball generated assembler code

Reviewers: kgardas, simonmar, hvr, bgamari, austin, erikd

Reviewed By: simonmar

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2233

3 years agoPrelInfo: Ensure that tuple promoted datacon names are in knownKeyNames
Ben Gamari [Fri, 3 Jun 2016 20:19:17 +0000 (22:19 +0200)] 
PrelInfo: Ensure that tuple promoted datacon names are in knownKeyNames

Previously the promoted datacons of the boxed tuple types were not
included in knownKeyNames, which lead to #12132.

Test Plan: Test with included TypeOf testcase

Reviewers: austin, simonpj

Reviewed By: simonpj

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2279

GHC Trac Issues: #12132

3 years agointeger-gmp: Make minusInteger more efficient
Alan Mock [Fri, 3 Jun 2016 20:16:27 +0000 (22:16 +0200)] 
integer-gmp: Make minusInteger more efficient

Give `minusInteger` its own implementation.
Previously `minusInteger` used `plusInteger` and `negateInteger`, which
meant it always allocated.  Now it works more like `plusInteger`.

Reviewers: goldfire, hvr, bgamari, austin

Reviewed By: hvr, bgamari, austin

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2278

GHC Trac Issues: #12129

3 years agoUse useful names for Symbol Addr and Names in Linker.c
Tamar Christina [Fri, 3 Jun 2016 19:42:45 +0000 (21:42 +0200)] 
Use useful names for Symbol Addr and Names in Linker.c

Replace `char*` and `void*` with `SymbolName` and `SymbolAddr` in
`Linker.c`. Gives some useful information about what the variables are
used for and also normalizes the types used in Mac, Linux and Windows

Test Plan:
./validate on all platforms that use the runtime linker.

For unix platforms please ensure `DYNAMIC_GHC_PROGRAMS=NO` is
 added to your validate file.

This is a continuation from D2184

Reviewers: austin, erikd, simonmar, bgamari

Reviewed By: bgamari

Subscribers: thomie, #ghc_windows_task_force

Differential Revision: https://phabricator.haskell.org/D2250

GHC Trac Issues: #11816

3 years agoRefactored SymbolInfo to lower memory usage in RTS
Tamar Christina [Fri, 3 Jun 2016 19:42:16 +0000 (21:42 +0200)] 
Refactored SymbolInfo to lower memory usage in RTS

Previously as part of #11223 a new struct `SymbolInfo` was introduced to
keep track it the weak symbol status of a symbol.

This structure also kept a copy of the calculated address of the symbol
which turns out was useful in ignoring non-weak zero-valued symbols.

The information was kept in an array so it means for every symbol two
extra bytes were kept even though the vast majority of symbols are
non-weak and non-zero valued.

This changes the array into a sparse map keeping this information only
for the symbols that are weak or zero-valued. This allows for a
reduction in the amount of information needed to be kept while giving up
a small (negligable) hit in performance as this information now has to
be looked up in hashmaps.

Test Plan: ./validate on all platforms that use the runtime linker.

For unix platforms please ensure `DYNAMIC_GHC_PROGRAMS=NO` is added to
your validate file.

Reviewers: simonmar, austin, erikd, bgamari

Reviewed By: simonmar, bgamari

Subscribers: thomie, #ghc_windows_task_force

Differential Revision: https://phabricator.haskell.org/D2184

GHC Trac Issues: #11816

3 years agotestsuite: Mark broken tests on powerpc64le
Peter Trommler [Fri, 3 Jun 2016 19:39:31 +0000 (21:39 +0200)] 
testsuite: Mark broken tests on powerpc64le

Mark all failing tests that have a ticket for powerpc64 as broken. Most
of these failures are due to the lack of linker support in the runtime
system.

Test Plan: validate on powerpc and AIX

Reviewers: erikd, bgamari, simonmar, hvr, austin

Reviewed By: austin

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2289

GHC Trac Issues: #11261, #11259, #11260, #11323

3 years agoDerive instances in Data.Data
Ryan Scott [Fri, 3 Jun 2016 18:48:16 +0000 (14:48 -0400)] 
Derive instances in Data.Data

Summary:
Currently, none of the `Data` instances in `Data.Data` are derived,
which has resulted in hundreds of lines of laboriously hand-written `Data`
instances. This cleans it up by using `DeriveDataTypeable` to derive all of
the boring instances.

Note that previously, `tcTopSrcDecls` in `TcRnDriver` was typechecking the
variables generated in `deriving` statements before other top-level variables,
which causes an error when `DeriveDataTypeable` is used in `Data.Data`, since
the `deriving`-generated variable definitions refer to top-level definitions
in `Data.Data` itself. To fix this, the order in which these two groups are
typechecked was reversed.

Test Plan: ./validate

Reviewers: rwbarton, bgamari, hvr, austin

Reviewed By: austin

Subscribers: rwbarton, thomie

Differential Revision: https://phabricator.haskell.org/D2291

3 years agoDocument putSymbolTable determinism
Bartosz Nitka [Fri, 3 Jun 2016 16:11:50 +0000 (09:11 -0700)] 
Document putSymbolTable determinism

Like explained in the comment it's OK here.

Test Plan: ./validate

Reviewers: bgamari, austin, simonmar

Reviewed By: simonmar

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2298

GHC Trac Issues: #4012

3 years agoMake FieldLabelEnv a deterministic set
Bartosz Nitka [Fri, 3 Jun 2016 16:11:10 +0000 (09:11 -0700)] 
Make FieldLabelEnv a deterministic set

This lets us kill fsEnvElts function which is nondeterministic.
We also get better guarantees than just comments.
We don't do lookups, but I believe a set is needed for deduplication.

Test Plan: ./validate

Reviewers: bgamari, mpickering, austin, simonmar

Reviewed By: simonmar

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2297

GHC Trac Issues: #4012

3 years agoHscMain: Minor simplification
Ömer Sinan Ağacan [Fri, 3 Jun 2016 08:05:48 +0000 (04:05 -0400)] 
HscMain: Minor simplification

3 years agoWhitespace only
Ömer Sinan Ağacan [Fri, 3 Jun 2016 07:38:34 +0000 (03:38 -0400)] 
Whitespace only

3 years agoKill nameSetElems in rnCmdTop
Bartosz Nitka [Thu, 2 Jun 2016 18:38:11 +0000 (11:38 -0700)] 
Kill nameSetElems in rnCmdTop

This change isn't necessary for determinism. appAName, choiceAName,
loopAName all have pre-allocated Uniques and their relative order
can't change. I opted to use nameSetElemsStable here because:
* the cost is negligible
* it's less fragile than just documenting

Test Plan: ./validate

Reviewers: simonpj, austin, bgamari, simonmar

Reviewed By: simonmar

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2292

GHC Trac Issues: #4012

3 years agoKill nameSetElems in findImportUsage
Bartosz Nitka [Thu, 2 Jun 2016 18:37:41 +0000 (11:37 -0700)] 
Kill nameSetElems in findImportUsage

nameSetElems is nondeterministic and while I think we don't need
determinism here it doesn't hurt.

Test Plan: ./validate

Reviewers: ezyang, bgamari, austin, simonmar

Reviewed By: simonmar

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2293

GHC Trac Issues: #4012

3 years agoUse UniqDSet for finding free names in the Linker
Bartosz Nitka [Thu, 2 Jun 2016 18:36:44 +0000 (11:36 -0700)] 
Use UniqDSet for finding free names in the Linker

This is not necessary for determinism, but it's a choice
between making this deterministic and using `nonDetEltsUFM`
and a comment explaining that it doesn't matter.

Test Plan: ./validate

Reviewers: austin, hvr, bgamari, simonmar

Reviewed By: simonmar

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2295

GHC Trac Issues: #4012

3 years agoRemove dead generics-related code from OccName
Ryan Scott [Thu, 2 Jun 2016 19:00:22 +0000 (15:00 -0400)] 
Remove dead generics-related code from OccName

Before #9766 was fixed, GHC would generate auxiliary datatypes for every
Generic instance, and it would use functions from OccName to prefix the
generated names. GHC no longer generates any auxiliary datatypes for
Generic instances, but the accompanying code was never removed from
OccName (until now).

3 years agoAdd nameSetElemsStable and fix the build
Bartosz Nitka [Thu, 2 Jun 2016 17:34:57 +0000 (10:34 -0700)] 
Add nameSetElemsStable and fix the build

3 years agoSerialize vParallelTyCons in a stable order
Bartosz Nitka [Thu, 2 Jun 2016 16:51:04 +0000 (09:51 -0700)] 
Serialize vParallelTyCons in a stable order

nameSetElems can introduce nondeterminism and while I haven't
observed this being a problem in practice (possibly because this
is dead code) there's no downside to doing this.

Test Plan: ./validate

Reviewers: bgamari, austin, simonpj, simonmar

Reviewed By: simonmar

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2296

GHC Trac Issues: #4012

3 years agoLocalize orphan-related nondeterminism
Bartosz Nitka [Thu, 2 Jun 2016 16:39:47 +0000 (09:39 -0700)] 
Localize orphan-related nondeterminism

chooseOrphanAnchor now takes a NameSet, relieving the callers
from the burden of converting it to a list

Test Plan: ./validate

Reviewers: bgamari, ezyang, austin, simonmar, simonpj

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2294

GHC Trac Issues: #4012

3 years agoTravis: llvm's apt repository is offline
Thomas Miedema [Thu, 2 Jun 2016 13:29:39 +0000 (15:29 +0200)] 
Travis: llvm's apt repository is offline

3 years agoTestsuite: run tests in /tmp/ghctest-xxx instead of /tmp/ghctest/xxx
Thomas Miedema [Thu, 2 Jun 2016 13:10:28 +0000 (15:10 +0200)] 
Testsuite: run tests in /tmp/ghctest-xxx instead of /tmp/ghctest/xxx

This fixes a bug of not being able to create files or directories in
/tmp/ghctest if it was created by a different user.

Trac ticket #11980.

3 years agoKill nameSetElems in getInfo
Bartosz Nitka [Thu, 2 Jun 2016 13:18:03 +0000 (06:18 -0700)] 
Kill nameSetElems in getInfo

nameSetAll is more precise here

3 years agoImprove failed knot-tying error message.
Edward Z. Yang [Mon, 30 May 2016 12:21:36 +0000 (14:21 +0200)] 
Improve failed knot-tying error message.

Test Plan: validate

Reviewers: simonpj, austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2207

3 years agoUse nameSetAny in findUses
Bartosz Nitka [Thu, 2 Jun 2016 09:17:37 +0000 (02:17 -0700)] 
Use nameSetAny in findUses

This kills one use of nameSetElems which is nondeterministic

3 years agoFix detection and use of `USE_LIBDW`
Erik de Castro Lopo [Tue, 31 May 2016 20:14:00 +0000 (06:14 +1000)] 
Fix detection and use of `USE_LIBDW`

Test Plan: Configure/build with and without --enable-libdw

Reviewers: trofi, hvr, austin, simonmar, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2276

3 years agoUpdate a Cmm note
Ömer Sinan Ağacan [Tue, 31 May 2016 11:54:17 +0000 (07:54 -0400)] 
Update a Cmm note

3 years agoRemove unused FAST_STRING_NOT_NEEDED macro defs
Ömer Sinan Ağacan [Tue, 31 May 2016 08:08:35 +0000 (04:08 -0400)] 
Remove unused FAST_STRING_NOT_NEEDED macro defs

Reviewers: austin, bgamari, simonmar, hvr

Reviewed By: hvr

Subscribers: hvr, thomie

Differential Revision: https://phabricator.haskell.org/D2285

3 years agoStgCmmUtils.emitMultiAssign: Make assertion msg more helpful
Ömer Sinan Ağacan [Mon, 30 May 2016 14:39:59 +0000 (10:39 -0400)] 
StgCmmUtils.emitMultiAssign: Make assertion msg more helpful

3 years agoRtsFlags.c: Const correct fixes
Erik de Castro Lopo [Sat, 28 May 2016 21:26:39 +0000 (07:26 +1000)] 
RtsFlags.c: Const correct fixes

Test Plan: validate

Reviewers: hvr, austin, simonmar, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2275

3 years agoTestsuite: don't use --interactive in Makefiles
Thomas Miedema [Wed, 25 May 2016 11:24:34 +0000 (13:24 +0200)] 
Testsuite: don't use --interactive in Makefiles

Add a linter to encourage the use of `$(TEST_HC_OPTS_INTERACTIVE)`
instead of `$(TEST_HC_OPTS) --interactive -ignore-dot-ghci -v0`. It's
too easy to forget one of those flags when adding a new test.

Update submodule hpc.

Reviewed by: austin

Differential Revision: https://phabricator.haskell.org/D2265

GHC Trac Issues: #11468

3 years agoClarify users' guide section on GeneralizedNewtypeDeriving
Ryan Scott [Fri, 27 May 2016 18:12:57 +0000 (14:12 -0400)] 
Clarify users' guide section on GeneralizedNewtypeDeriving

Summary:
It seemed to imply that GHC was generating infelicitous code when it
actually wasn't. Fixes #12047.

Reviewers: hvr, bgamari, austin

Reviewed By: austin

Subscribers: thomie, Iceland_jack

Differential Revision: https://phabricator.haskell.org/D2273

GHC Trac Issues: #12047

3 years agoTypos in comments
Gabor Greif [Fri, 27 May 2016 15:09:33 +0000 (17:09 +0200)] 
Typos in comments

3 years agoDo not init record accessors as exported
Ömer Sinan Ağacan [Fri, 27 May 2016 15:02:47 +0000 (11:02 -0400)] 
Do not init record accessors as exported

This was causing redundant code generation when accessors are not
actually exported, as they were being marked as "exported" at
initialization.

Test Plan: validate

Reviewers: simonpj, austin, bgamari

Reviewed By: simonpj

Subscribers: mpickering, thomie

Differential Revision: https://phabricator.haskell.org/D2270

3 years agoStgCmmExpr: Remove a redundant list
Ömer Sinan Ağacan [Fri, 27 May 2016 14:47:50 +0000 (10:47 -0400)] 
StgCmmExpr: Remove a redundant list

3 years agoComments and white space only
Simon Peyton Jones [Fri, 27 May 2016 13:38:25 +0000 (14:38 +0100)] 
Comments and white space only

3 years agoMore fixes for unboxed tuples
Simon Peyton Jones [Fri, 27 May 2016 13:34:45 +0000 (14:34 +0100)] 
More fixes for unboxed tuples

This is a continuation of
   commit e9e61f18a548b70693f4ccd245bc56335c94b498
   Date:   Thu May 26 15:24:53 2016 +0100
   Reduce special-casing for nullary unboxed tuple

which related to Trac #12115.  But typecheck/should_run/tcrun051
revealed that my patch was incomplete.

This fixes it, by removing another special case in Type.repType.
I had also missed a case in UnariseStg.unariseIdBinder.

I took the opportunity to add explanatory notes
  Note [Unarisation]
  Note [Unarisation and nullary tuples]
in UnariseStg

3 years agoStgCmmCon: Do not generate moves from unused fields to local variables
Ömer Sinan Ağacan [Fri, 27 May 2016 09:18:47 +0000 (05:18 -0400)] 
StgCmmCon: Do not generate moves from unused fields to local variables

Say we have a record like this:

    data Rec = Rec
      { f1 :: Int
      , f2 :: Int
      , f3 :: Int
      , f4 :: Int
      , f5 :: Int
      }

Before this patch, the code generated for `f1` looked like this:

    f1_entry()
        {offset
           ...
           cJT:
               _sI6::P64 = R1;
               _sI7::P64 = P64[_sI6::P64 + 7];
               _sI8::P64 = P64[_sI6::P64 + 15];
               _sI9::P64 = P64[_sI6::P64 + 23];
               _sIa::P64 = P64[_sI6::P64 + 31];
               _sIb::P64 = P64[_sI6::P64 + 39];
               R1 = _sI7::P64 & (-8);
               Sp = Sp + 8;
               call (I64[R1])(R1) args: 8, res: 0, upd: 8;
        }

Note how all fields of the record are moved to local variables, even though
they're never used. These moves make it to the final assembly:

    f1_info:
        ...
    _cJT:
        movq 7(%rbx),%rax
        movq 15(%rbx),%rcx
        movq 23(%rbx),%rcx
        movq 31(%rbx),%rcx
        movq 39(%rbx),%rbx
        movq %rax,%rbx
        andq $-8,%rbx
        addq $8,%rbp
        jmp *(%rbx)

With this patch we stop generating these move instructions. Cmm becomes this:

    f1_entry()
        {offset
           ...
           cJT:
               _sI6::P64 = R1;
               _sI7::P64 = P64[_sI6::P64 + 7];
               R1 = _sI7::P64 & (-8);
               Sp = Sp + 8;
               call (I64[R1])(R1) args: 8, res: 0, upd: 8;
        }

Assembly becomes this:

    f1_info:
        ...
    _cJT:
        movq 7(%rbx),%rax
        movq %rax,%rbx
        andq $-8,%rbx
        addq $8,%rbp
        jmp *(%rbx)

It turns out CmmSink already optimizes this, but it's better to generate
better code in the first place.

Reviewers: simonmar, simonpj, austin, bgamari

Reviewed By: simonmar, simonpj

Subscribers: rwbarton, thomie

Differential Revision: https://phabricator.haskell.org/D2269

3 years agoCoverage.hs: Fix a duplication
Ömer Sinan Ağacan [Thu, 26 May 2016 16:06:35 +0000 (12:06 -0400)] 
Coverage.hs: Fix a duplication

3 years agoStgCmmExpr: Fix a duplication
Ömer Sinan Ağacan [Thu, 26 May 2016 16:04:36 +0000 (12:04 -0400)] 
StgCmmExpr: Fix a duplication

3 years agoReduce special-casing for nullary unboxed tuple
Simon Peyton Jones [Thu, 26 May 2016 14:24:53 +0000 (15:24 +0100)] 
Reduce special-casing for nullary unboxed tuple

When we built the kind of a nullary unboxed tuple, we said, in
TysWiredIn.mk_tuple:

    res_rep | arity == 0 = voidRepDataConTy
                  -- See Note [Nullary unboxed tuple] in Type
            | otherwise  = unboxedTupleRepDataConTy

But this is bogus.  The Note deals with what the 'unarise' transformation
does, and up to that point it's simpler and more uniform to treat
nullary unboxed tuples the same as all the others.

Nicer now.  And it fixes the Lint error in Trac #12115

3 years agoFix bytecode gen to deal with rep-polymorphism
Simon Peyton Jones [Thu, 26 May 2016 13:20:29 +0000 (14:20 +0100)] 
Fix bytecode gen to deal with rep-polymorphism

When faced runtime-rep-polymorphic code from a pattern-synonym
matcher, the bytecode generator was treating the result as lifted,
which it isn't.  The fix is just to treat those rep-polymorphic
continuations like unlifted types, and add a dummy arg.

Trac #12007 is a case in point.

3 years agoTestsuite: add a test for #5522 (-fliberate-case -fspec-constr)
Thomas Miedema [Wed, 25 May 2016 19:23:09 +0000 (21:23 +0200)] 
Testsuite: add a test for #5522 (-fliberate-case -fspec-constr)

3 years agoTestsuite: fix enum01/02/03 on Windows (#9399)
Thomas Miedema [Wed, 25 May 2016 15:51:26 +0000 (17:51 +0200)] 
Testsuite: fix enum01/02/03 on Windows (#9399)

3 years agoTestsuite: also normalise platform-dependent .stdout/stderr
Thomas Miedema [Wed, 25 May 2016 14:03:19 +0000 (16:03 +0200)] 
Testsuite: also normalise platform-dependent .stdout/stderr

This effectively reverses commit
429f0099ab9adfadc779ca76f3aae1c9c160fb8c (2006).

I don't see why platform-dependent .stdout/stderr files should //not//
get normalised.

It fixes T11223_link_order_a_b_2_fail on Windows, by normalising
`ghc-stage2.exe` to `ghc` when comparing stderr with .stderr-mingw32.

Reviewed by: Phyx

Differential Revision: https://phabricator.haskell.org/D2267

GHC Trac Issues: #12118