ghc.git
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

3 years agoSpelling in comments
Gabor Greif [Tue, 24 May 2016 12:10:15 +0000 (14:10 +0200)] 
Spelling in comments

3 years agoTestsuite: introduce TEST_HC_OPTS_INTERACTIVE (#11468)
Thomas Miedema [Wed, 25 May 2016 11:01:42 +0000 (13:01 +0200)] 
Testsuite: introduce TEST_HC_OPTS_INTERACTIVE (#11468)

Refactoring only.

3 years agoRTS: simplify read_heap_profiling_flag
Thomas Miedema [Thu, 19 May 2016 08:20:15 +0000 (10:20 +0200)] 
RTS: simplify read_heap_profiling_flag

Since 535896e58f7fc8d89a5ff34629a3471eac529d93, "args" is not mutated
anymore, so we don't need to create a temporary copy.

Reviewed by: bgamari

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

3 years agoFix broken links to mdo papers
Bartosz Nitka [Wed, 25 May 2016 16:25:51 +0000 (09:25 -0700)] 
Fix broken links to mdo papers

There's no guarantee that the links will work in the future.
Is there a more future-proof solution to this?

Test Plan: none

Reviewers: bgamari, austin, simonmar

Reviewed By: simonmar

Subscribers: thomie, simonmar

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

3 years agoUpdate submodule vector [skip ci]
Thomas Miedema [Tue, 24 May 2016 09:26:58 +0000 (11:26 +0200)] 
Update submodule vector [skip ci]

Contains commits to let vector compile with primitive master.

3 years agoAlways use native-Haskell de/encoders for ASCII and latin1
Thomas Miedema [Tue, 24 May 2016 09:31:45 +0000 (11:31 +0200)] 
Always use native-Haskell de/encoders for ASCII and latin1

This fixes test encoding005 on Windows (#10623).

Reviewed by: austin, bgamari

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

3 years agoTestsuite: delete drvfail015.stderr-7.0 [skip ci]
Thomas Miedema [Tue, 24 May 2016 20:32:07 +0000 (22:32 +0200)] 
Testsuite: delete drvfail015.stderr-7.0 [skip ci]

Running the testsuite with ghc-7.0 is not supported.

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.