ghc.git
3 years agoFix: #12084 deprecate old profiling flags
Seraphime Kirkovski [Tue, 24 May 2016 20:30:09 +0000 (22:30 +0200)] 
Fix: #12084 deprecate old profiling flags

Change help message so it doesn't specify -auto-all.
Make old profiling flags deprecated as they are no longer
documented.
Update Makefile and documentation accordingly.
Update release notes for ghc 8.2

Test Plan:
./verify; `ghc --help` shouldn't specify the -auto-all
flag. Furthermore `ghc -fprof -auto-all` should emit a warning

Reviewed By: thomie, austin

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

GHC Trac Issues: #12084

Update submodule nofib

3 years agoRuntime linker: Break m32 allocator out into its own file
Erik de Castro Lopo [Tue, 24 May 2016 09:26:56 +0000 (19:26 +1000)] 
Runtime linker: Break m32 allocator out into its own file

This makes the code a little more modular and allows the removal of some
CPP hackery. By providing dummy implementations of of the `m32_*`
functions (which simply call `errorBelch`) it means that the call sites
for these functions are syntax checked even when `RTS_LINKER_USE_MMAP`
is `0`.

Also changes some size parameter types from `unsigned int` to `size_t`.

Test Plan: Validate on Linux, OS X and Windows

Reviewers: Phyx, hsyl20, bgamari, simonmar, austin

Reviewed By: simonmar, austin

Subscribers: thomie

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

3 years agoRemove 'deriving Typeable' statements
Ryan Scott [Tue, 24 May 2016 13:22:04 +0000 (09:22 -0400)] 
Remove 'deriving Typeable' statements

Summary:
Deriving `Typeable` has been a no-op since GHC 7.10, and now that we
require 7.10+ to build GHC, we can remove all the redundant `deriving Typeable`
statements in GHC.

Test Plan: ./validate

Reviewers: goldfire, austin, hvr, bgamari

Reviewed By: austin, hvr, bgamari

Subscribers: thomie

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

3 years agoMake Arrow desugaring deterministic
Bartosz Nitka [Tue, 24 May 2016 11:44:37 +0000 (04:44 -0700)] 
Make Arrow desugaring deterministic

This kills two instances of varSetElems that turned out to be
nondeterministic. I've tried to untangle this before, but it's
a bit hard with the fixDs in the middle. Fortunately I now have
a test case that proves that we need determinism here.

Test Plan: ./validate, new testcase

Reviewers: simonpj, simonmar, austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

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

GHC Trac Issues: #4012

3 years agoDocument some benign nondeterminism
Bartosz Nitka [Tue, 24 May 2016 09:56:59 +0000 (02:56 -0700)] 
Document some benign nondeterminism

I've changed the functions to their nonDet equivalents and explained
why they're OK there. This allowed me to remove foldNameSet,
foldVarEnv, foldVarEnv_Directly, foldVarSet and foldUFM_Directly.

Test Plan: ./validate, there should be no change in behavior

Reviewers: simonpj, simonmar, austin, goldfire, bgamari

Reviewed By: bgamari

Subscribers: thomie

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

GHC Trac Issues: #4012

3 years agoAdd support for unicode TH quotes (#11743)
Josh Price [Tue, 24 May 2016 10:35:21 +0000 (12:35 +0200)] 
Add support for unicode TH quotes (#11743)

I've also added cases for `IToparenbar` and `ITcparenbar` (aka banana
brackets) to `isUnicode`.

Document unicode TH quote alternatives (#11743)

Test Plan: ./validate

Reviewers: austin, goldfire, bgamari

Reviewed By: bgamari

Subscribers: thomie, mpickering

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

GHC Trac Issues: #11743

3 years agoSpelling
Gabor Greif [Tue, 24 May 2016 10:58:18 +0000 (12:58 +0200)] 
Spelling

3 years agoTestsuite: delete check_files_written
Thomas Miedema [Tue, 2 Feb 2016 18:07:51 +0000 (19:07 +0100)] 
Testsuite: delete check_files_written

The CHECK_FILES_WRITTEN feature is no longer necessary, since tests
don't write to the source directory anymore (#11980).

Reviewed by: bgamari

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

3 years agoComments only
Simon Peyton Jones [Mon, 23 May 2016 15:27:08 +0000 (16:27 +0100)] 
Comments only

3 years agoRemove unused Type.splitFunTysN
Simon Peyton Jones [Mon, 23 May 2016 09:46:47 +0000 (10:46 +0100)] 
Remove unused Type.splitFunTysN

3 years agoSpelling in comment
Simon Peyton Jones [Mon, 23 May 2016 09:46:26 +0000 (10:46 +0100)] 
Spelling in comment

3 years agoDon't split the arg types in a PatSyn signature
Simon Peyton Jones [Thu, 19 May 2016 14:02:09 +0000 (15:02 +0100)] 
Don't split the arg types in a PatSyn signature

This patch fixes Trac #11977, and #12108, rather satisfactorily
maily by deleting code!

  pattern P :: Eq a => a -> a -> Int

The idea is simply /not/ to split the bit after the '=>' into the
pattern argument types, but to keep the (a->a->Int) part
un-decomposed, in the patsig_body_ty field of a TcPatSynInfo.

There is one awkward wrinkle, which is that we can't split the
implicitly-bound type variables into existential and universal until
we know which types are arguments and which are part of the result.
So we postpone the decision until we have the declaration in hand.
See TcPatSyn Note [The pattern-synonym signature splitting rule]

3 years agoSuppress the warning about __sync_fetch_and_nand (#9678)
Thomas Miedema [Mon, 23 May 2016 22:35:33 +0000 (00:35 +0200)] 
Suppress the warning about __sync_fetch_and_nand (#9678)

3 years agoRevert "compiler/iface: compress .hi files"
Ben Gamari [Mon, 23 May 2016 13:32:12 +0000 (15:32 +0200)] 
Revert "compiler/iface: compress .hi files"

This appears to cause validation issues on,

    TEST="T11108 T9071 T11076 T7600 T7672 T8329 T10420 T10322 T8308 T4114a
    T4114c T10602 T10110 T9204 T2435 T9838 T4114d T10233 T8696 T1735 T5281
    T6056 T10134 T9580 T6018 T9762 T8103"

With compiler panics of the form,

    Compile failed (status 256) errors were:
    ghc: panic! (the 'impossible' happened)
      (GHC version 8.1.20160523 for x86_64-unknown-linux):
            Binary.readBinMem: decompression failed
    CallStack (from HasCallStack):
      error, called at compiler/utils/Binary.hs:192:16 in ghc:Binary

    Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

This reverts commit d9cb7a8a94daa4d20aa042cd053e20b491315633.

3 years agotestsuite: Update max_bytes_used for T4029
Ben Gamari [Mon, 23 May 2016 12:41:44 +0000 (14:41 +0200)] 
testsuite: Update max_bytes_used for T4029

3 years agoFix build by removing unused import.
Matthew Pickering [Mon, 23 May 2016 13:53:39 +0000 (14:53 +0100)] 
Fix build by removing unused import.

3 years agoAllow unlifted types in pattern synonym result type
Matthew Pickering [Sun, 22 May 2016 10:52:26 +0000 (11:52 +0100)] 
Allow unlifted types in pattern synonym result type

Fixes #12094

Test Plan: ./validate

Reviewers: austin, bgamari

Subscribers: thomie

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

GHC Trac Issues: #12094

3 years agoTestsuite: fix T12010 for real
Thomas Miedema [Sun, 22 May 2016 12:41:48 +0000 (14:41 +0200)] 
Testsuite: fix T12010 for real

* Use `extra_files` instead of (the deprecated) `extra_clean` (#11980).

* Don't depend on generated files from build tree
  (libraries/base/include/HsBaseConfig.h). Running
  'make test TEST=T12010' should work, even without building GHC first
  (it will use the system installed ghc).

Test Plan: 'make test TEST=T12010' on Linux and Windows.

Reviewed by: Phyx

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

GHC Trac Issues: #12010

3 years agoUpdate format specifiers for Tickey.c
Tamar Christina [Sun, 22 May 2016 09:13:11 +0000 (11:13 +0200)] 
Update format specifiers for Tickey.c

Summary:
all `tot_` values in `Tickey.c` are `unsigned long` but
are being printed as `%ld` instead of `%lu`.

Test Plan: ./validate

Reviewers: austin, bgamari, simonmar, erikd

Reviewed By: erikd

Subscribers: thomie, #ghc_windows_task_force

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

3 years agorts/Linker.c: Fix compile error on Arm
Erik de Castro Lopo [Sun, 22 May 2016 07:59:18 +0000 (17:59 +1000)] 
rts/Linker.c: Fix compile error on Arm

Commit da3c1ebb8a left Arm with a compile error. This is a short term fixup
pending a much more through fix of removing as much CPP hackery as possible.

Test Plan: Validate on arm and x86_64

Reviewers: simonmar, austin, hsyl20, bgamari, Phyx

Reviewed By: Phyx

Subscribers: thomie

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

3 years agoUse `setSession` instead of `modifySession` when setting `HscEnv`
Ömer Sinan Ağacan [Sun, 22 May 2016 09:00:51 +0000 (05:00 -0400)] 
Use `setSession` instead of `modifySession` when setting `HscEnv`

Reviewers: austin, hvr, bgamari

Reviewed By: bgamari

Subscribers: thomie

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

3 years agoBuild system: temp solution for parallelisation bug (#11960)
Thomas Miedema [Sun, 22 May 2016 08:14:44 +0000 (10:14 +0200)] 
Build system: temp solution for parallelisation bug (#11960)

3 years agoFix deriving Ord when RebindableSyntax is enabled
Andrew Farmer [Sat, 21 May 2016 16:38:47 +0000 (18:38 +0200)] 
Fix deriving Ord when RebindableSyntax is enabled

Deriving clauses (Ord especially) generated if-expressions with nlHsIf
which were subject to RebindableSyntax. This changes nlHsIf to generate
concrete if-expressions.

There was also an error about calling tagToEnum# at a polymorphic type,
which is not allowed. Fixing nlHsIf didn't fix this for some reason, so
I generated a type ascription around the call to tagToEnum#. Not sure
why the typechecker could not figure this out.

Test Plan: Added a test, ran validate.

Reviewers: simonpj, simonmar, austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

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

GHC Trac Issues: #12080

3 years agoEnable checkProddableBlock on x86_64
Simon Marlow [Sat, 21 May 2016 16:36:49 +0000 (18:36 +0200)] 
Enable checkProddableBlock on x86_64

We've been seeing some memory corruption after using the linker, and I
want to enable this to see if it catches anything.

Test Plan:
* validate
* modified the linker_unload test to remove the performGC calls to use
  as a benchmark, saw no significant difference after this change.

Reviewers: bgamari, erikd, austin

Reviewed By: austin

Subscribers: thomie

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

3 years agousers-guide: Fix index in PDF output
Ben Gamari [Sat, 21 May 2016 11:20:15 +0000 (13:20 +0200)] 
users-guide: Fix index in PDF output

The madness that is latex never ceases to amaze.

3 years agorules/sphinx: Add missing dependency on conf.py for pdf rule
Ben Gamari [Sat, 21 May 2016 11:13:26 +0000 (13:13 +0200)] 
rules/sphinx: Add missing dependency on conf.py for pdf rule

3 years agousers-guide: Vector version of Thomson-Wheeler logo
Ben Gamari [Sat, 21 May 2016 10:49:27 +0000 (12:49 +0200)] 
users-guide: Vector version of Thomson-Wheeler logo

3 years agocompiler/iface: compress .hi files
Austin Seipp [Fri, 20 May 2016 03:25:08 +0000 (03:25 +0000)] 
compiler/iface: compress .hi files

Compress all interface files generated by the compiler with LZ4. While
being only a tiny amount of code, LZ4 is both fast at compression and
decompression, and has good compression ratios.

Non-scientific size test: size of stage2 compiler .hi files:

`find ./compiler/stage2 -type f -iname '*.hi' -exec du -ch {} + | grep total$`

Without this patch: 22MB of .hi files for stage2.
With this patch: 9.2MB of .hi files for stage2.

Signed-off-by: Austin Seipp <austin@well-typed.com>
Reviewed By: bgamari

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

3 years agoFix failing T12010
Tamar Christina [Sat, 21 May 2016 14:23:59 +0000 (10:23 -0400)] 
Fix failing T12010

Summary:
T12010 seems to be failing because it can't find the correct paths.
This gives the test some more qualified paths.

Test Plan: make TEST=12010

Reviewers: hvr, bgamari, austin, thomie

Reviewed By: austin

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

GHC Trac Issues: #12010

3 years agoTestsuite: mark T8761 expect_broken #12077
Thomas Miedema [Sat, 21 May 2016 11:11:26 +0000 (13:11 +0200)] 
Testsuite: mark T8761 expect_broken #12077

3 years agoFix Windows build after Ticky changes
Tamar Christina [Sat, 21 May 2016 09:31:58 +0000 (11:31 +0200)] 
Fix Windows build after Ticky changes

Summary:
Replace hardcoded ld with FMT_Int for
StgInt types.

Test Plan: ./validate

Reviewers: austin, bgamari, simonmar, erikd

Reviewed By: erikd

Subscribers: thomie, #ghc_windows_task_force

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

3 years agotestsuite: add CmmSwitchTest for 32-bit platforms
Alex Dzyoba [Fri, 20 May 2016 20:28:38 +0000 (20:28 +0000)] 
testsuite: add CmmSwitchTest for 32-bit platforms

Move CmmSwitchTest to CmmSwitchTest64, because it's broken on 32-bit
platforms. Create CmmSwitchTest32 that repeats CmmSwitchTest64 for
platforms with 32-bit wordsize.

Reviewed By: nomeata, austin, bgamari, thomie

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

GHC Trac Issues: #11297

3 years agoFunDep printer: Fix unicode arrow
Ömer Sinan Ağacan [Fri, 20 May 2016 08:39:57 +0000 (04:39 -0400)] 
FunDep printer: Fix unicode arrow

The arrow should be printed in unicode arrow syntax when
-fprint-unicode-syntax is used.

Reviewers: austin, bgamari, thomie

Reviewed By: thomie

Subscribers: thomie

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

GHC Trac Issues: #11825

3 years agoAdd -XStaticPointers to the flag reference.
Facundo Domínguez [Thu, 19 May 2016 20:44:34 +0000 (17:44 -0300)] 
Add -XStaticPointers to the flag reference.

3 years agoUse the correct return type for Windows' send()/recv() (Fix #12010)
Tamar Christina [Thu, 19 May 2016 19:48:53 +0000 (21:48 +0200)] 
Use the correct return type for Windows' send()/recv() (Fix #12010)

Summary:
They return signed 32 bit ints on Windows, even on a 64 bit OS, rather than
Linux's 64 bit ssize_t. This means when recv() returned -1 to signal an error we
thought it was 4294967295. It was converted to an int, -1 and the buffer was
memcpy'd which caused a segfault. Other bad stuff happened with send()s.

See also note CSsize in System.Posix.Internals.

Add a test for #12010

Test Plan:
- GHC testsuite (T12010)
- http-conduit test (https://github.com/snoyberg/http-client/issues/191)

Reviewers: austin, hvr, bgamari, Phyx

Reviewed By: Phyx

Subscribers: thomie

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

GHC Trac Issues: #12010

3 years agoGive lifted primitive types a representation
Ben Gamari [Thu, 19 May 2016 19:05:30 +0000 (21:05 +0200)] 
Give lifted primitive types a representation

As of D1774 everything in GHC.Prim has a representation generated for it
by TcTypeable (see #11120). Unfortunately I evidently missed propagating
this change to lifted primitive types. This patch fixes this (#12082).

Test Plan: Validate

Reviewers: austin

Subscribers: thomie

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

GHC Trac Issues: #12082

3 years agotestsuite: Add a TypeRep test
Ben Gamari [Thu, 19 May 2016 19:05:22 +0000 (21:05 +0200)] 
testsuite: Add a TypeRep test

Test Plan: Validate

Reviewers: goldfire, austin

Subscribers: thomie

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

GHC Trac Issues: #12082, #11120

3 years ago{,M}BLOCK_SIZE_W * sizeof(W_) -> {,M}BLOCK_SIZE
Tomas Carnecky [Thu, 19 May 2016 19:04:04 +0000 (21:04 +0200)] 
{,M}BLOCK_SIZE_W * sizeof(W_) -> {,M}BLOCK_SIZE

Reviewers: austin, erikd, simonmar, bgamari

Reviewed By: bgamari

Subscribers: thomie

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

3 years agoGet types in osFreeMBlocks in sync with osGetMBlocks
Tomas Carnecky [Thu, 19 May 2016 19:03:42 +0000 (21:03 +0200)] 
Get types in osFreeMBlocks in sync with osGetMBlocks

The first argument of 'osFreeMBlocks' ought to have the same type as the
return value from 'osGetMBlocks'. Make it so.

Reviewers: austin, simonmar, bgamari

Reviewed By: bgamari

Subscribers: erikd, rwbarton, thomie

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

3 years agoRemove use of caddr_t
Tomas Carnecky [Thu, 19 May 2016 19:03:32 +0000 (21:03 +0200)] 
Remove use of caddr_t

> caddr_t is a legacy BSD type associated with some low level calls like
> mmap, and it should never be used in modern code. It was rejected by
> the POSIX standard. The standardized mmap uses void *.

(http://stackoverflow.com/questions/6381526/what-is-the-significance-of-
caddr-t-and-when-is-it-used)

Reviewers: austin, simonmar, rwbarton, bgamari, erikd

Reviewed By: rwbarton, bgamari, erikd

Subscribers: erikd, thomie

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

3 years agoAdd libraries/ghci/GNUmakefile to .gitignore [skip ci]
Thomas Miedema [Thu, 19 May 2016 14:04:29 +0000 (16:04 +0200)] 
Add libraries/ghci/GNUmakefile to .gitignore [skip ci]

3 years agoTestsuite: fix T11827 (#11827)
Thomas Miedema [Thu, 19 May 2016 12:29:44 +0000 (14:29 +0200)] 
Testsuite: fix T11827 (#11827)

It didn't trigger the bug before.

3 years agotestsuite: Add expected output for T11108
Ben Gamari [Thu, 19 May 2016 12:14:40 +0000 (14:14 +0200)] 
testsuite: Add expected output for T11108

3 years agoComments only
Simon Peyton Jones [Thu, 19 May 2016 09:44:02 +0000 (10:44 +0100)] 
Comments only

3 years agoComments only
Simon Peyton Jones [Thu, 19 May 2016 09:43:45 +0000 (10:43 +0100)] 
Comments only

3 years agoImprove documentation for type wildcards
Simon Peyton Jones [Wed, 18 May 2016 16:13:29 +0000 (17:13 +0100)] 
Improve documentation for type wildcards

This docmentation improvement was triggered by Trac #12072

3 years agoImprove pretty-printing of equalities
Simon Peyton Jones [Mon, 16 May 2016 12:42:22 +0000 (13:42 +0100)] 
Improve pretty-printing of equalities

The previous pretty-printer didn't account for partially
applied equalities, causing Trac #12041

3 years agoFix Trac #12051
Simon Peyton Jones [Mon, 16 May 2016 12:41:06 +0000 (13:41 +0100)] 
Fix Trac #12051

A minor parser issue, allowing a mal-formed data constructor
through.

3 years agoKill varEnvElts in tcPragExpr
Bartosz Nitka [Wed, 18 May 2016 23:47:29 +0000 (16:47 -0700)] 
Kill varEnvElts in tcPragExpr

I had to refactor some things to take VarSet instead of [Var],
but I think it's more precise this way.

Test Plan: ./validate

Reviewers: simonmar, simonpj, austin, bgamari, goldfire

Reviewed By: simonpj

Subscribers: thomie

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

GHC Trac Issues: #4012

3 years agoKill varSetElems in tidyFreeTyCoVars
Bartosz Nitka [Wed, 18 May 2016 17:36:49 +0000 (10:36 -0700)] 
Kill varSetElems in tidyFreeTyCoVars

I haven't observed this to have an effect on nondeterminism,
but tidyOccName appears to modify the TidyOccEnv in a
way dependent on the order of inputs.
It's easy enough to change it to be deterministic to be on the
safe side.

Test Plan: ./validate

Reviewers: simonmar, austin, bgamari, simonpj

Reviewed By: simonpj

Subscribers: thomie

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

GHC Trac Issues: #4012

3 years agorts: Add missing `const` from HashTable API
Erik de Castro Lopo [Wed, 18 May 2016 20:19:24 +0000 (06:19 +1000)] 
rts: Add missing `const` from HashTable API

Thanks to Tamar Christina (Phyx) for spotting this.

Test Plan: Validate

Reviewers: simonmar, austin, trofi, bgamari, hsyl20, Phyx

Reviewed By: Phyx

Subscribers: thomie

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

3 years agoFailing test case for #12076.
Edward Z. Yang [Tue, 17 May 2016 04:05:24 +0000 (21:05 -0700)] 
Failing test case for #12076.

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

Reviewers: austin, bgamari

Subscribers: thomie

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

GHC Trac Issues: #12076

3 years agoAdd (broken) test for #12063.
Edward Z. Yang [Sun, 15 May 2016 23:29:35 +0000 (16:29 -0700)] 
Add (broken) test for #12063.

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

Reviewers: austin, bgamari

Subscribers: thomie

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

GHC Trac Issues: #12063

3 years agoCLabel: Catch #11155 during C-- pretty-printing
Ben Gamari [Tue, 17 May 2016 17:16:30 +0000 (19:16 +0200)] 
CLabel: Catch #11155 during C-- pretty-printing

In #11555 we ended up generating references to the non-existence
stg_ap_0_upd. Here we add asserts to verify that we don't generate
references to non-existent selector or application symbols.

It would likely also make sense to add further asserts during code
generation, so we can catch the issue even closer to its source.

Test Plan: Validate

Reviewers: simonmar, austin, ezyang

Reviewed By: simonmar, austin

Subscribers: thomie

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

GHC Trac Issues: #11155

3 years agorts: Add isPinnedByteArray# primop
Ben Gamari [Tue, 17 May 2016 17:05:26 +0000 (19:05 +0200)] 
rts: Add isPinnedByteArray# primop

Adds a primitive operation to determine whether a particular
`MutableByteArray#` is backed by a pinned buffer.

Test Plan: Validate with included testcase

Reviewers: austin, simonmar

Reviewed By: austin, simonmar

Subscribers: thomie

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

GHC Trac Issues: #12059

3 years agoRework parser to allow use with DynFlags
Dave Laing [Tue, 17 May 2016 17:03:41 +0000 (19:03 +0200)] 
Rework parser to allow use with DynFlags

Split out the options needed by the parser from DynFlags, making the
parser more friendly to standalone usage.

Test Plan: validate

Reviewers: simonmar, alanz, bgamari, austin, thomie

Reviewed By: simonmar, alanz, bgamari, thomie

Subscribers: thomie, mpickering

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

GHC Trac Issues: #10961

3 years agoAdd a test for #11108
Ben Gamari [Tue, 17 May 2016 17:03:16 +0000 (19:03 +0200)] 
Add a test for #11108

Reviewers: austin, simonmar, bgamari

Reviewed By: bgamari

Subscribers: thomie

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

GHC Trac Issues: #11108

3 years agoFix histograms for ticky code
Mateusz Lenik [Tue, 17 May 2016 06:33:54 +0000 (08:33 +0200)] 
Fix histograms for ticky code

This patch fixes Cmm generation required to produce histograms when
compiling with -ticky flag, strips dead code from rts/Ticky.c and
reworks it to use a shared constant in both C and Haskell code.

Fixes #8308.

Test Plan: T8308

Reviewers: jstolarek, simonpj, austin

Reviewed By: simonpj

Subscribers: mpickering, simonpj, bgamari, mlen, thomie, jstolarek

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

GHC Trac Issues: #8308

3 years agoMake inert_model and inert_eqs deterministic sets
Bartosz Nitka [Tue, 17 May 2016 12:45:43 +0000 (05:45 -0700)] 
Make inert_model and inert_eqs deterministic sets

The order inert_model and intert_eqs fold affects the order that the
typechecker looks at things. I've been able to experimentally confirm
that the order of equalities and the order of the model matter for
determinism. This is just a straigthforward replacement of
nondeterministic VarEnv for deterministic DVarEnv.

Test Plan: ./validate

Reviewers: simonpj, goldfire, austin, bgamari, simonmar

Reviewed By: simonmar

Subscribers: thomie

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

GHC Trac Issues: #4012

3 years agoUpdate .mailmap [skip ci]
Thomas Miedema [Tue, 17 May 2016 17:33:01 +0000 (19:33 +0200)] 
Update .mailmap [skip ci]

3 years agoTestsuite: don't warn when mk/ghcconfig_* hasn't been created yet
Thomas Miedema [Wed, 18 May 2016 09:08:55 +0000 (11:08 +0200)] 
Testsuite: don't warn when mk/ghcconfig_* hasn't been created yet

[skip ci]

3 years agoTestsuite: T10052 requires interpreter (#11730)
Thomas Miedema [Wed, 18 May 2016 09:07:35 +0000 (11:07 +0200)] 
Testsuite: T10052 requires interpreter (#11730)

3 years agorts: More const correct-ness fixes
Erik de Castro Lopo [Tue, 17 May 2016 20:33:03 +0000 (06:33 +1000)] 
rts: More const correct-ness fixes

In addition to more const-correctness fixes this patch fixes an
infelicity of the previous const-correctness patch (995cf0f356) which
left `UNTAG_CLOSURE` taking a `const StgClosure` pointer parameter
but returning a non-const pointer. Here we restore the original type
signature of `UNTAG_CLOSURE` and add a new function
`UNTAG_CONST_CLOSURE` which takes and returns a const `StgClosure`
pointer and uses that wherever possible.

Test Plan: Validate on Linux, OS X and Windows

Reviewers: Phyx, hsyl20, bgamari, austin, simonmar, trofi

Reviewed By: simonmar, trofi

Subscribers: thomie

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

3 years agorules/build-prog: Ensure programs depend upon their transitive deps
Ben Gamari [Tue, 17 May 2016 16:05:24 +0000 (18:05 +0200)] 
rules/build-prog: Ensure programs depend upon their transitive deps

Previously programs only depended upon the direct dependencies; while I
would have thought that this would be sufficient, somehow we were
getting to the link step of building `ghc-pkg` before `ghc-boot-th` was
built (despite the fact that `ghc-boot` has a direct dependency on
`ghc-boot-th`).

See #12078.

3 years agorules: Fix name of ghc-boot-th library
Ben Gamari [Tue, 17 May 2016 13:18:37 +0000 (15:18 +0200)] 
rules: Fix name of ghc-boot-th library

There was a missing `#`. Hadrian couldn't come soon enough.

3 years agoDelete libraries/ghci/GNUmakefile [skip ci]
Thomas Miedema [Tue, 17 May 2016 16:05:28 +0000 (18:05 +0200)] 
Delete libraries/ghci/GNUmakefile [skip ci]

This file should not have been included in the repository, as it is
generated by `./boot`.

3 years agoTestsuite: don't skip concio001 and concio001_thr
Thomas Miedema [Mon, 25 Apr 2016 18:33:52 +0000 (20:33 +0200)] 
Testsuite: don't skip concio001 and concio001_thr

I think they were skipped before because they write to the same output
file (concio001). This is no longer a problem.

3 years agoTestsuite: delete unused file [skip ci]
Thomas Miedema [Fri, 6 May 2016 08:12:38 +0000 (10:12 +0200)] 
Testsuite: delete unused file [skip ci]

3 years agoTestsuite: delete old cleanup code (#11980)
Thomas Miedema [Sun, 24 Apr 2016 14:24:25 +0000 (16:24 +0200)] 
Testsuite: delete old cleanup code (#11980)

3 years agoTestsuite: run tests in /tmp after copying required files
Thomas Miedema [Sat, 29 Aug 2015 13:52:43 +0000 (15:52 +0200)] 
Testsuite: run tests in /tmp after copying required files

Major change to the testsuite driver.

For each TEST:
   * create a directory `<testdir>` inside `/tmp`.

   * link/copy all source files that the test needs into `<testdir>`.

   * run the test inside `<testdir>`.

   * delete `<testdir>`

Extra files are (temporarily) tracked in
`testsuite/driver/extra_files.py`, but can also be specified using the
`extra_files` setup function.

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

Reviewed by: Rufflewind, bgamari

Trac: #11980

3 years agoDocument determinism in shortOutIndirections
Bartosz Nitka [Tue, 17 May 2016 09:46:30 +0000 (02:46 -0700)] 
Document determinism in shortOutIndirections

varEnvElts didn't introduce nondeterminism here. This makes it
obvious that it could and explains why it doesn't.

Test Plan: ./validate

Reviewers: bgamari, simonmar, austin, simonpj

Reviewed By: simonpj

Subscribers: thomie

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

GHC Trac Issues: #4012

3 years agoAdd ghc-boot-th to rules/foreachLibrary
Ben Gamari [Tue, 17 May 2016 07:53:00 +0000 (09:53 +0200)] 
Add ghc-boot-th to rules/foreachLibrary

This may have been the cause of various build failures on FreeBSD and
Solaris.

3 years agoSet `USE_MMAP` at configure time
Erik de Castro Lopo [Mon, 16 May 2016 03:59:57 +0000 (13:59 +1000)] 
Set `USE_MMAP` at configure time

Summary:
The `USE_MMAP` macro is used in the run time linker and was being set with
some really ugly CPP hackery. Setting in the configure script is much
neater.

Reviewers: rwbarton, hvr, austin, simonmar, bgamari

Reviewed By: hvr, bgamari

Subscribers: thomie

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

3 years agoRemove html_theme requirement of haddock docs
Ben Gamari [Mon, 16 May 2016 19:07:13 +0000 (21:07 +0200)] 
Remove html_theme requirement of haddock docs

Updates haddock submodule.

3 years agoAnother bump of haddock submodule
Ben Gamari [Mon, 16 May 2016 17:37:11 +0000 (19:37 +0200)] 
Another bump of haddock submodule

Trying to ensure consistent haddock documentation across Sphinx versions
is far too much work for too little benefit; reverting Alabaster
vendorization.

3 years agoKill varSetElems in tcInferPatSynDecl
Bartosz Nitka [Mon, 16 May 2016 10:27:53 +0000 (03:27 -0700)] 
Kill varSetElems in tcInferPatSynDecl

varSetElems introduces unnecessary non-determinism and while
I didn't estabilish experimentally that this matters here
I'm convinced that it will, because I expect pattern synonyms
to end up in interface files.

Test Plan: ./validate

Reviewers: austin, simonmar, bgamari, mpickering, simonpj

Reviewed By: simonpj

Subscribers: thomie

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

GHC Trac Issues: #4012

3 years agoMove Extension type to ghc-boot-th
Ben Gamari [Mon, 16 May 2016 13:21:34 +0000 (15:21 +0200)] 
Move Extension type to ghc-boot-th

This creates a new package, `ghc-boot-th`, to contain the `Extension`
type, which now lives in `GHC.LanguageExtension.Type`. This ensures that
the transitive dependency set of the `template-haskell` package remains
minimal.

The `GHC.LanguageExtensions.Type` module is also re-exported by
`ghc-boot`, which provides an orphan `binary` instance as well.

Test Plan: Validate

Reviewers: goldfire, thomie, hvr, austin

Reviewed By: thomie

Subscribers: RyanGlScott, thomie, erikd, ezyang

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

3 years agotestsuite/ImpSafe03: Normalize version of bytestring
Ben Gamari [Mon, 16 May 2016 13:56:09 +0000 (15:56 +0200)] 
testsuite/ImpSafe03: Normalize version of bytestring

3 years agoPPC: Implement SMP primitives using gcc built-ins
Peter Trommler [Mon, 16 May 2016 13:19:09 +0000 (15:19 +0200)] 
PPC: Implement SMP primitives using gcc built-ins

The SMP primitives were missing appropriate memory barriers
(sync, isync instructions) on all PowerPCs.

Use the built-ins _sync_* provided by gcc and clang. This
reduces code size significantly.

Remove broken mark for concprog001 on powerpc64. The referenced
ticket number (11259) was wrong.

Test Plan: validate on powerpc and ARM

Reviewers: erikd, austin, simonmar, bgamari, hvr

Reviewed By: bgamari, hvr

Subscribers: thomie

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

GHC Trac Issues: #12070

3 years agoPPC NCG: Fix pretty printing of st[wd]ux instr.
Peter Trommler [Mon, 16 May 2016 13:16:49 +0000 (15:16 +0200)] 
PPC NCG: Fix pretty printing of st[wd]ux instr.

Printing STU was mixed up. The tab character must appear
after the 'x'.

Test Plan: validate on powerpc

Reviewers: bgamari, austin, erikd

Reviewed By: austin, erikd

Subscribers: thomie

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

GHC Trac Issues: #12054

3 years agoBump haddock submodule
Ben Gamari [Mon, 16 May 2016 13:14:18 +0000 (15:14 +0200)] 
Bump haddock submodule

Vendorise alabaster theme for older sphinx releases.

3 years agoUpdate bytestring submodule to 0.10.8.1 release tag
Herbert Valerio Riedel [Sun, 15 May 2016 21:19:18 +0000 (23:19 +0200)] 
Update bytestring submodule to 0.10.8.1 release tag

3 years agoFix a performance issue with -fprint-expanded-synonyms
Ömer Sinan Ağacan [Sun, 15 May 2016 11:04:39 +0000 (07:04 -0400)] 
Fix a performance issue with -fprint-expanded-synonyms

The type synonym expander was doing redundant work by looking at same
types again and again. This patch fixes the loop code when both of the
types can be expanded, to do `O(min(n, m))` comparisons and `O(n + m)`
expansions, where `n` is expansions of the first type and `m` is
expansions of the second type.

Reported by sjcjoosten in T10547.

Test Plan:
Added a regression test that was taking several minutes to type check
before this patch.

Reviewers: bgamari, simonpj, austin, ezyang

Reviewed By: bgamari, simonpj, austin, ezyang

Subscribers: simonpj, thomie

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

GHC Trac Issues: #10547

3 years agoBump haddock submodule
Ben Gamari [Thu, 12 May 2016 15:44:49 +0000 (17:44 +0200)] 
Bump haddock submodule

This includes various fixes to Haddock's integration with the GHC build
system.

3 years agoTest Trac #12039
Simon Peyton Jones [Thu, 12 May 2016 15:15:18 +0000 (16:15 +0100)] 
Test Trac #12039

3 years agoRefactor some ppr functions to use pprUFM
Bartosz Nitka [Thu, 12 May 2016 15:01:34 +0000 (08:01 -0700)] 
Refactor some ppr functions to use pprUFM

Nondeterminism doesn't matter in these places and pprUFM makes
it obvious. I've flipped the order of arguments for convenience.

Test Plan: ./validate

Reviewers: simonmar, bgamari, austin, simonpj

Reviewed By: simonpj

Subscribers: thomie

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

GHC Trac Issues: #4012

3 years agoFix comments about scavenging WEAK objects
Takano Akio [Thu, 12 May 2016 13:45:44 +0000 (15:45 +0200)] 
Fix comments about scavenging WEAK objects

This is a follow-up of D2189. If fixes some comments, deletes a section
in the User's Guide about the bug, and updates .mailmap as suggested on
the WorkinConventions wiki page.

Test Plan: It compiles.

Reviewers: austin, simonmar, bgamari

Reviewed By: bgamari

Subscribers: thomie

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

GHC Trac Issues: #11108

3 years agoRtsUtils: Use `size_t` instead of `int` where appropriate
Erik de Castro Lopo [Thu, 12 May 2016 13:45:10 +0000 (15:45 +0200)] 
RtsUtils: Use `size_t` instead of `int` where appropriate

Functions like `stgMallocBytes` take a size parameter which was of type
`int`, but is commonly used as `stgMallocBytes (sizeof (...))`. This is
problematic because the `sizeof` operator returns `size_t` so that on 64
bit systems, in this common use case the `size_t` parameter would be
truncated to 32 bits when passed to `stgMallocBytes` where it was cast
back to `size_t`.

Test Plan: Validate on Linux, OS X and Windows

Reviewers: austin, hvr, bgamari, simonmar, hsyl20

Reviewed By: hvr, bgamari, simonmar, hsyl20

Subscribers: thomie

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

3 years agorts: Make function pointer parameters `const` where possible
Erik de Castro Lopo [Thu, 12 May 2016 13:45:00 +0000 (15:45 +0200)] 
rts: Make function pointer parameters `const` where possible

If a function takes a pointer parameter and doesn't update what
the pointer points to, we can add `const` to the parameter
declaration to document that no updates occur.

Test Plan: Validate on Linux, OS X and Windows

Reviewers: austin, Phyx, bgamari, simonmar, hsyl20

Reviewed By: bgamari, simonmar, hsyl20

Subscribers: thomie

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

3 years agoUse StgHalfWord instead of a CPP #if
Tomas Carnecky [Thu, 12 May 2016 13:44:42 +0000 (15:44 +0200)] 
Use StgHalfWord instead of a CPP #if

Reviewers: simonmar, bgamari, austin

Reviewed By: bgamari, austin

Subscribers: thomie

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

3 years agoKill varEnvElts in specImports
Bartosz Nitka [Thu, 12 May 2016 13:55:00 +0000 (06:55 -0700)] 
Kill varEnvElts in specImports

We need the order of specialized binds and rules to be deterministic,
so we use a deterministic set here.

Test Plan: ./validate

Reviewers: simonmar, bgamari, austin, simonpj

Reviewed By: simonpj

Subscribers: thomie

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

GHC Trac Issues: #4012

3 years agoDocument zonkTyCoVarsAndFV determinism
Bartosz Nitka [Thu, 12 May 2016 13:44:52 +0000 (06:44 -0700)] 
Document zonkTyCoVarsAndFV determinism

I've changed it to use nonDetEltsUFM and documented why
it's OK.

Test Plan: it builds

Reviewers: bgamari, austin, simonmar, goldfire, simonpj

Reviewed By: simonpj

Subscribers: thomie

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

GHC Trac Issues: #4012

3 years agoAllow putting Haddocks on derived instances
Ryan Scott [Wed, 11 May 2016 13:58:35 +0000 (15:58 +0200)] 
Allow putting Haddocks on derived instances

Currently, one can document top-level instance declarations, but derived
instances (both those in `deriving` clauses and standalone `deriving`
instances) do not enjoy the same privilege. This makes the necessary
changes to the parser to enable attaching Haddock comments for derived
instances.

Updates haddock submodule.

Fixes #11768.

Test Plan: ./validate

Reviewers: hvr, bgamari, austin

Reviewed By: austin

Subscribers: thomie, mpickering

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

GHC Trac Issues: #11768

3 years agoMake Generic1 poly-kinded
RyanGlScott [Wed, 11 May 2016 13:57:48 +0000 (15:57 +0200)] 
Make Generic1 poly-kinded

This generalizes the `Generic1` typeclass to be of kind `k -> *`, and
this also makes the relevant datatypes and typeclasses in `GHC.Generics`
poly-kinded. If `PolyKinds` is enabled, `DeriveGeneric` derives
`Generic1` instances such that they use the most general kind possible.
Otherwise, deriving `Generic1` defaults to make an instance where the
argument is of kind `* -> *` (the current behavior).

Fixes #10604. Depends on D2117.

Test Plan: ./validate

Reviewers: kosmikus, dreixel, goldfire, austin, hvr, simonpj, bgamari

Reviewed By: simonpj, bgamari

Subscribers: thomie, ekmett

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

GHC Trac Issues: #10604

3 years agoFix deriveTyData's kind unification when two kind variables are unified
RyanGlScott [Wed, 11 May 2016 13:57:24 +0000 (15:57 +0200)] 
Fix deriveTyData's kind unification when two kind variables are unified

When `deriveTyData` attempts to unify two kind variables (which can
happen if both the typeclass and the datatype are poly-kinded), it
mistakenly adds an extra mapping to its substitution which causes the
unification to fail when applying the substitution. This can be
prevented by checking both the domain and the range of the original
substitution to see which kind variables shouldn't be put into the
domain of the substitution. A more in-depth explanation is included in
`Note [Unification of two kind variables in deriving]`.

Fixes #11837.

Test Plan: ./validate

Reviewers: simonpj, hvr, goldfire, niteria, austin, bgamari

Reviewed By: bgamari

Subscribers: niteria, thomie

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

GHC Trac Issues: #11837

3 years agoAdd TH support for pattern synonyms (fixes #8761)
Dominik Bollmann [Wed, 11 May 2016 13:55:13 +0000 (15:55 +0200)] 
Add TH support for pattern synonyms (fixes #8761)

This commit adds Template Haskell support for pattern synonyms as
requested by trac ticket #8761.

Test Plan: ./validate

Reviewers: thomie, jstolarek, osa1, RyanGlScott, mpickering, austin,
goldfire, bgamari

Reviewed By: goldfire, bgamari

Subscribers: rdragon

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

GHC Trac Issues: #8761

3 years agoBump haddock submodule
Ben Gamari [Thu, 12 May 2016 13:39:24 +0000 (15:39 +0200)] 
Bump haddock submodule

3 years agodocs: add skeleton 8.2.1 release notes
Austin Seipp [Wed, 11 May 2016 13:52:08 +0000 (15:52 +0200)] 
docs: add skeleton 8.2.1 release notes

Summary:
Out with the old, in with the new.

Not much has diverged yet, but it's good to get this out of the way early.

Signed-off-by: Austin Seipp <austin@well-typed.com>
Test Plan: Built and looked at the documentation.

Reviewers: bgamari

Reviewed By: bgamari

Subscribers: thomie

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

3 years agoMake absentError not depend on uniques
Bartosz Nitka [Thu, 12 May 2016 12:42:21 +0000 (05:42 -0700)] 
Make absentError not depend on uniques

As explained in the comment it will cause changes in
inlining if we don't suppress them.

Test Plan: ./validate

Reviewers: bgamari, austin, simonpj, goldfire, simonmar

Reviewed By: simonmar

Subscribers: thomie

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

GHC Trac Issues: #4012

3 years agoDon't prematurely force TyThing thunks with -ddump-if-trace.
Edward Z. Yang [Tue, 10 May 2016 07:14:05 +0000 (00:14 -0700)] 
Don't prematurely force TyThing thunks with -ddump-if-trace.

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