5 years ago[skip ci] rts: Detabify sm/Evac.c
Austin Seipp [Tue, 21 Oct 2014 21:35:59 +0000 (16:35 -0500)] 
[skip ci] rts: Detabify sm/Evac.c

Signed-off-by: Austin Seipp <>
5 years ago[skip ci] rts: Detabify Threads.c
Austin Seipp [Tue, 21 Oct 2014 21:34:07 +0000 (16:34 -0500)] 
[skip ci] rts: Detabify Threads.c

Signed-off-by: Austin Seipp <>
5 years ago[skip ci] rts: Detabify Profiling.c
Austin Seipp [Tue, 21 Oct 2014 21:33:46 +0000 (16:33 -0500)] 
[skip ci] rts: Detabify Profiling.c

Signed-off-by: Austin Seipp <>
5 years ago[skip ci] rts: Detabify CheckUnload.c
Austin Seipp [Tue, 21 Oct 2014 21:33:29 +0000 (16:33 -0500)] 
[skip ci] rts: Detabify CheckUnload.c

Signed-off-by: Austin Seipp <>
5 years ago[skip ci] rts: Detabify Capability.h
Austin Seipp [Tue, 21 Oct 2014 21:32:58 +0000 (16:32 -0500)] 
[skip ci] rts: Detabify Capability.h

Signed-off-by: Austin Seipp <>
5 years ago[skip ci] rts: Detabify RaiseAsync.h
Austin Seipp [Tue, 21 Oct 2014 21:32:20 +0000 (16:32 -0500)] 
[skip ci] rts: Detabify RaiseAsync.h

Signed-off-by: Austin Seipp <>
5 years ago[skip ci] rts: Detabify RtsMessages.c
Austin Seipp [Tue, 21 Oct 2014 21:31:22 +0000 (16:31 -0500)] 
[skip ci] rts: Detabify RtsMessages.c

Signed-off-by: Austin Seipp <>
5 years agoEnabled warn on tabs by default (fixes #9230)
Mateusz Lenik [Tue, 21 Oct 2014 20:34:00 +0000 (15:34 -0500)] 
Enabled warn on tabs by default (fixes #9230)

This revision enables -fwarn-tabs by default and add a suppression
flag, so that GHC compilation won't fail when some files contain tab

Test Plan: Additional test case, T9230, was added to cover that change.

Reviewers: austin

Reviewed By: austin

Subscribers: simonmar, ezyang, carter, thomie, mlen

Differential Revision:

GHC Trac Issues: #9230


5 years agoFixes the ARM build
Moritz Angermann [Tue, 21 Oct 2014 20:33:18 +0000 (15:33 -0500)] 
Fixes the ARM build

CodeGen.Platform.hs was changed with the following diff:

    globalRegMaybe _                        = Nothing
   +globalRegMaybe _ = Nothing
   +globalRegMaybe = panic "globalRegMaybe not defined for this platform"

which causes globalRegMaybe ot panic for arch ARM.

This patch ensures globalRegMaybe is not called on ARM.

Signed-off-by: Moritz Angermann <>
Test Plan: Building arm cross-compiler (e.g. --target=arm-apple-darwin10)

Reviewers: hvr, ezyang, simonmar, rwbarton, austin

Reviewed By: austin

Subscribers: dterei, bgamari, simonmar, ezyang, carter

Differential Revision:

GHC Trac Issues: #9593

5 years agoAdd release note about Unicode 7.0
Austin Seipp [Tue, 21 Oct 2014 20:31:57 +0000 (15:31 -0500)] 
Add release note about Unicode 7.0

Signed-off-by: Austin Seipp <>
5 years agoAdd doctest examples for Data.Bool.
Michael Orlitzky [Tue, 21 Oct 2014 20:02:29 +0000 (15:02 -0500)] 
Add doctest examples for Data.Bool.

Add examples for `Data.Bool`, and rework the existing documentation of
the `bool` function slightly: the `a`,`b` in its explanation were changed
to `x`,`y` to avoid ambiguity with the type variable 'a'.

The examples have been tested, and two trailing spaces were removed.

Reviewers: austin

Reviewed By: austin

Subscribers: thomie, carter, ezyang, simonmar

Differential Revision:

5 years agoFix typo in -XConstraintKinds docs
Ricky Elrod [Tue, 21 Oct 2014 20:02:21 +0000 (15:02 -0500)] 
Fix typo in -XConstraintKinds docs

Fix a minor typo that seems to have existed for a long time.

Signed-off-by: Ricky Elrod <>
Test Plan: My eyes.

Reviewers: austin, #ghc

Reviewed By: austin, #ghc

Subscribers: thomie, carter, ezyang, simonmar

Differential Revision:

5 years agoAdd doctest examples for Data.Functor.
Michael Orlitzky [Tue, 21 Oct 2014 20:02:11 +0000 (15:02 -0500)] 
Add doctest examples for Data.Functor.

Add doctest examples for the three standalone functions defined in

  * Data.Functor.$>
  * Data.Functor.<$>
  * Data.Functor.void

This is part of a larger plan to add examples for the functions in
base, and to eventually enable automatic testing of them.

Reviewers: austin, hvr, ekmett

Reviewed By: austin

Subscribers: hvr, ekmett, thomie, carter, ezyang, simonmar

Differential Revision:

5 years agoMake Data.List.concatMap fuse better
David Feuer [Tue, 21 Oct 2014 20:02:03 +0000 (15:02 -0500)] 
Make Data.List.concatMap fuse better

Fix #9537 precisely as Joachim Breitner proposed in

Reviewers: austin, nomeata

Reviewed By: austin, nomeata

Subscribers: thomie, carter, ezyang, simonmar

Differential Revision:

GHC Trac Issues: #9537

5 years agoMake findIndices fuse
David Feuer [Tue, 21 Oct 2014 20:01:26 +0000 (15:01 -0500)] 
Make findIndices fuse

Steal the findIndices implementation from Data.Sequence, that can
participate in fold/build fusion

Reviewers: nomeata, austin

Reviewed By: nomeata, austin

Subscribers: thomie, carter, ezyang, simonmar

Differential Revision:

5 years agoImprove isDigit, isSpace, etc.
David Feuer [Tue, 21 Oct 2014 20:01:14 +0000 (15:01 -0500)] 
Improve isDigit, isSpace, etc.

Make things less branchy; use unsigned comparisons for range checking.
Eliminate non-spaces more quickly in common cases in isSpace.

Reviewers: ekmett, carter, austin

Reviewed By: austin

Subscribers: thomie, carter, ezyang, simonmar

Differential Revision:

GHC Trac Issues: #1473

5 years agoRemove extra period
Matt Kraai [Tue, 21 Oct 2014 20:00:51 +0000 (15:00 -0500)] 
Remove extra period

The documentation has an extra period, which is rendered as

> However, GHCi also has support for interactively loading compiled
> code, as well as supporting all[2] the language extensions that GHC
> provides. .

Removing the extra period should fix this problem.

Reviewers: austin

Reviewed By: austin

Subscribers: thomie, carter, ezyang, simonmar

Differential Revision:

5 years agoUpdate to Unicode version 7.0
David Feuer [Tue, 21 Oct 2014 20:00:33 +0000 (15:00 -0500)] 
Update to Unicode version 7.0

Summary: Update Unicode data to version 7.0

Reviewers: rwbarton, austin

Reviewed By: austin

Subscribers: thomie, carter, ezyang, simonmar

Differential Revision:

5 years agoghc-prim: Use population count appropriate for platform
Ben Gamari [Tue, 21 Oct 2014 20:00:02 +0000 (15:00 -0500)] 
ghc-prim: Use population count appropriate for platform

This #ifdef was previously x86-centric and consequently the 64-bit
implementation was chosen for ARM.

Reviewers: rwbarton, hvr, austin, tibbe

Reviewed By: hvr, austin, tibbe

Subscribers: hvr, thomie, carter, ezyang, simonmar

Differential Revision:

5 years agoUse objdump instead of nm to derive constants on OpenBSD
Austin Seipp [Tue, 21 Oct 2014 19:58:21 +0000 (14:58 -0500)] 
Use objdump instead of nm to derive constants on OpenBSD

Summary: OpenBSD's nm doesn't support the -P option and there appears to be no other way to get the desired information from it.

Reviewers: kgardas, #ghc, austin

Reviewed By: kgardas, #ghc, austin

Subscribers: austin, ggreif

Projects: #ghc

Differential Revision:

GHC Trac Issues: #9549

5 years agoUpdated testsuite/.gitignore to cover artifacts on Windows.
Gintautas Miliauskas [Tue, 21 Oct 2014 19:57:57 +0000 (14:57 -0500)] 
Updated testsuite/.gitignore to cover artifacts on Windows.

Test Plan: git status after a test run

Reviewers: austin

Reviewed By: austin

Subscribers: thomie, carter, ezyang, simonmar

Differential Revision:

GHC Trac Issues: #9679

5 years agoMake Applicative-Monad fixes for tests.
Geoffrey Mainland [Thu, 2 Oct 2014 21:39:34 +0000 (17:39 -0400)] 
Make Applicative-Monad fixes for tests.

5 years agoUpdate primitive, vector, and dph submodules.
Geoffrey Mainland [Thu, 28 Aug 2014 02:33:44 +0000 (22:33 -0400)] 
Update primitive, vector, and dph submodules.

5 years agoReify data family instances correctly.
Richard Eisenberg [Mon, 20 Oct 2014 19:36:57 +0000 (15:36 -0400)] 
Reify data family instances correctly.

Fix #9692.

The reifier didn't account for the possibility that data/newtype
instances are sometimes eta-reduced. It now eta-expands as necessary.

Test Plan: th/T9692

Reviewers: simonpj, austin

Subscribers: thomie, carter, ezyang, simonmar

Differential Revision:

5 years agoClarify location of Note. Comment change only.
Richard Eisenberg [Mon, 20 Oct 2014 19:36:37 +0000 (15:36 -0400)] 
Clarify location of Note. Comment change only.

5 years agoTest #9692 in th/T9692
Richard Eisenberg [Mon, 20 Oct 2014 19:11:59 +0000 (15:11 -0400)] 
Test #9692 in th/T9692

5 years agoRevert "rts/PrimOps.cmm: follow '_static_closure' update"
Sergei Trofimovich [Tue, 21 Oct 2014 08:40:07 +0000 (09:40 +0100)] 
Revert "rts/PrimOps.cmm: follow '_static_closure' update"

This reverts commit eb191ab6c85f4b668a6e9151dcecaf1f1e7ec7c2.

Follows revert of STATIC_CLOSURE and restores UNREG build.

5 years agoUpdate Haddock submodule
Austin Seipp [Tue, 21 Oct 2014 01:08:14 +0000 (20:08 -0500)] 
Update Haddock submodule

As requested by Yuras Shumovich, this updates Haddock to include
.arcconfig and .arclint files, so diffs for GHC patches can go into

Signed-off-by: Austin Seipp <>
5 years agoRevert "Place static closures in their own section."
Edward Z. Yang [Mon, 20 Oct 2014 23:03:50 +0000 (16:03 -0700)] 
Revert "Place static closures in their own section."

This reverts commit b23ba2a7d612c6b466521399b33fe9aacf5c4f75.


5 years agoRevert "BC-breaking changes to C-- CLOSURE syntax."
Edward Z. Yang [Mon, 20 Oct 2014 23:01:45 +0000 (16:01 -0700)] 
Revert "BC-breaking changes to C-- CLOSURE syntax."

This reverts commit 3b5a840bba375c4c4c11ccfeb283f84c3a1ef22c.

5 years agoRevert "Properly generate info tables for static closures in C--."
Edward Z. Yang [Mon, 20 Oct 2014 23:01:39 +0000 (16:01 -0700)] 
Revert "Properly generate info tables for static closures in C--."

This reverts commit 178eb9060f369b216f3f401196e28eab4af5624d.

5 years agoRevert "Rename _closure to _static_closure, apply naming consistently."
Edward Z. Yang [Mon, 20 Oct 2014 22:57:13 +0000 (15:57 -0700)] 
Revert "Rename _closure to _static_closure, apply naming consistently."

This reverts commit 35672072b4091d6f0031417bc160c568f22d0469.


5 years agoRevert "Check for staticclosures section in Windows linker."
Edward Z. Yang [Mon, 20 Oct 2014 22:55:29 +0000 (15:55 -0700)] 
Revert "Check for staticclosures section in Windows linker."

This reverts commit 2fc0c6cf594731f343b4f8a5b3ecf9e72db4c3c0.

5 years agoRevert "Fix typo in section name: no leading period."
Edward Z. Yang [Mon, 20 Oct 2014 22:55:12 +0000 (15:55 -0700)] 
Revert "Fix typo in section name: no leading period."

This reverts commit e8dac6dc60beea863c3a5daded68f5157ab546fb.

5 years agoSync up `containers` submodule to latest `master`-tip
Herbert Valerio Riedel [Mon, 20 Oct 2014 09:38:27 +0000 (11:38 +0200)] 
Sync up `containers` submodule to latest `master`-tip

This updates `containers` to provide more specialised `Foldable`
instance methods, see also

for more details.

5 years agoIndentation and non-semantic changes only.
Edward Z. Yang [Thu, 16 Oct 2014 05:51:59 +0000 (22:51 -0700)] 
Indentation and non-semantic changes only.

Get these lines fitting in 80 columns, and replace ptext (sLit ...) with text

Signed-off-by: Edward Z. Yang <>
Test Plan: validate

Reviewers: simonmar, austin

Subscribers: thomie, carter, ezyang, simonmar

Differential Revision:

5 years agoRefactor module imports in base
Herbert Valerio Riedel [Sun, 19 Oct 2014 12:15:14 +0000 (14:15 +0200)] 
Refactor module imports in base

This commit removes a couple of

  {-# OPTIONS_GHC -fno-warn-unused-imports #-}

by cleaning up the imports, as well as ensuring that all modules in the
GHC.* hierarchy avoid importing the `Prelude` module to clean-up the
import graph a bit.

5 years agoPython 3 support, second attempt (Trac #9184)
Krzysztof Gogolewski [Sun, 19 Oct 2014 11:41:24 +0000 (13:41 +0200)] 
Python 3 support, second attempt (Trac #9184)

This is a fixup of

The only difference is in findTFiles (first commit), which
previously broke Windows runner; now I translated literally
instead attempting to improve it, and checked it works.

Test Plan:
I used validate under 2,3 on Linux and under 2 on msys2.
On Windows I've seen a large number of failures, but they don't
seem to be connected with the patch.

Reviewers: hvr, simonmar, thomie, austin

Reviewed By: austin

Subscribers: thomie, carter, ezyang, simonmar

Differential Revision:

GHC Trac Issues: #9184

5 years agoRemove redundant explicit `Prelude` imports
Herbert Valerio Riedel [Sun, 19 Oct 2014 10:03:11 +0000 (12:03 +0200)] 
Remove redundant explicit `Prelude` imports

Since they're implied by the lack of `NoImplicitPrelude`

5 years agoGeneralise `Control.Monad.{foldM,foldM_}` to `Foldable` (#9586)
Herbert Valerio Riedel [Sat, 18 Oct 2014 15:01:11 +0000 (17:01 +0200)] 
Generalise `Control.Monad.{foldM,foldM_}` to `Foldable` (#9586)

With this change `Control.Monad.foldM` becomes an alias for

Reviewed By: austin, ekmett

Differential Revision:

5 years agoRemove obsolete Data.OldTypeable (#9639)
Michael Karg [Sat, 18 Oct 2014 13:50:48 +0000 (15:50 +0200)] 
Remove obsolete Data.OldTypeable (#9639)

This finally removes the `Data.OldTypeable` module (which
has been deprecated in 7.8), from `base`, compiler and testsuite.

The deprecated `Typeable{1..7}` aliases in `Data.Typeable` are not
removed yet in order to give existing code a bit more time to adapt.

Reviewed By: hvr, dreixel

Differential Revision:

5 years agoImplement optimized NCG `MO_Ctz W64` op for i386 (#9340)
Herbert Valerio Riedel [Sat, 18 Oct 2014 12:32:33 +0000 (14:32 +0200)] 
Implement optimized NCG `MO_Ctz W64` op for i386 (#9340)

This is an optimization to the CTZ primops introduced for #9340

Previously we called out to `hs_ctz64`, but we can actually generate
better hand-tuned code while avoiding the FFI ccall.

With this patch, the code

  {-# LANGUAGE MagicHash #-}
  module TestClz0 where
  import GHC.Prim
  ctz64 :: Word64# -> Word#
  ctz64 x = ctz64# x

results in the following assembler generated by NCG on i386:

      movl (%ebp),%eax
      movl 4(%ebp),%ecx
      movl %ecx,%edx
      orl %eax,%edx
      movl $64,%edx
      je _nAO

      bsf %ecx,%ecx
      addl $32,%ecx
      bsf %eax,%eax
      cmovne %eax,%ecx
      movl %ecx,%edx
      movl %edx,%esi
      addl $8,%ebp
      jmp *(%ebp)

For comparision, here's what LLVM 3.4 currently generates:

  000000fc <TestClzz_ctzz64_info>:
    fc:   0f bc 45 04             bsf    0x4(%ebp),%eax
   100:   b9 20 00 00 00          mov    $0x20,%ecx
   105:   0f 45 c8                cmovne %eax,%ecx
   108:   83 c1 20                add    $0x20,%ecx
   10b:   8b 45 00                mov    0x0(%ebp),%eax
   10e:   8b 55 08                mov    0x8(%ebp),%edx
   111:   0f bc f0                bsf    %eax,%esi
   114:   85 c0                   test   %eax,%eax
   116:   0f 44 f1                cmove  %ecx,%esi
   119:   83 c5 08                add    $0x8,%ebp
   11c:   ff e2                   jmp    *%edx

Reviewed By: austin

Auditors: simonmar

Differential Revision:

5 years agorts: fix unused parameter warning
Austin Seipp [Fri, 17 Oct 2014 16:58:07 +0000 (11:58 -0500)] 
rts: fix unused parameter warning

If `pthread_setname_np` is not available, then a regular
./validate will fail due to warnings; the `name` parameter to
`createOSThread` becomes unused.

Signed-off-by: Austin Seipp <>
Test Plan: iiam

Reviewers: simonmar, nomeata, jstolarek, hvr

Reviewed By: nomeata, jstolarek, hvr

Subscribers: nomeata, thomie, carter, ezyang, simonmar

Differential Revision:

5 years agoUpdate T6056 output
Joachim Breitner [Fri, 17 Oct 2014 14:54:22 +0000 (16:54 +0200)] 
Update T6056 output

according to travis (and proably Harbormaster), although I just cannot
reproduce it here.

5 years agoAvoid printing uniques in specialization rules
Joachim Breitner [Fri, 17 Oct 2014 09:09:16 +0000 (11:09 +0200)] 
Avoid printing uniques in specialization rules

Akio found an avoidable cause of non-determinisim: The names of RULES
generated by Specialise had uniques in them:
    "SPEC $cshowsPrec_a2QX @ [GHC.Types.Char]" [ALWAYS] forall ...
By using showSDocForUser instead of showSDocDump when building the rule
name, this is avoided:
    "SPEC $cshowsPrec @ [Char]" [ALWAYS] forall ...
See #4012, comments 61ff.

5 years agoDeclare official GitHub home of libraries/deepseq
Herbert Valerio Riedel [Thu, 16 Oct 2014 07:47:31 +0000 (09:47 +0200)] 
Declare official GitHub home of libraries/deepseq

Effective immediately, `deepseq` is maintained officially by the
core-library-comittee.  Moreover, pushing to libraries/deepseq requires
pushing to ssh:// from now on.

[skip ci]

5 years agoMake tails a good producer (#9670)
David Feuer [Thu, 16 Oct 2014 07:44:25 +0000 (09:44 +0200)] 
Make tails a good producer (#9670)

Reviewed By: nomeata, austin
Differential Revision:

5 years agoMake Data.List.Inits fast
David Feuer [Thu, 16 Oct 2014 07:42:27 +0000 (09:42 +0200)] 
Make Data.List.Inits fast

Fixes #9345. Use a modified banker's queue to achieve amortized optimal
performance for inits. The previous implementation was extremely slow.

Reviewed By: nomeata, ekmett, austin

Differential Revision:

5 years agoAdd a configure test for pthread_setname_np
Simon Marlow [Mon, 13 Oct 2014 17:30:30 +0000 (18:30 +0100)] 
Add a configure test for pthread_setname_np

5 years agoFix comment typos: lll -> ll, THe -> The
Jan Stolarek [Tue, 14 Oct 2014 12:38:16 +0000 (14:38 +0200)] 
Fix comment typos: lll -> ll, THe -> The

5 years agoActually put in new perf number for T4801
Joachim Breitner [Mon, 13 Oct 2014 21:33:45 +0000 (23:33 +0200)] 
Actually put in new perf number for T4801

which I just put it in comments. Thanks Yuras for noticing, and sorry
for the noise.

5 years agoT9675: Allow Much wider range of values
Joachim Breitner [Mon, 13 Oct 2014 17:20:44 +0000 (19:20 +0200)] 
T9675: Allow Much wider range of values

to include at least what’s observed on ghc-speed and my laptop, and
hopefully also Harbormaster.

5 years agoUpdate more performance numbers due to stricter seqDmdType
Joachim Breitner [Mon, 13 Oct 2014 14:37:15 +0000 (16:37 +0200)] 
Update more performance numbers due to stricter seqDmdType

including T9675 itself. Maybe its memory behaviour is too spiky for
max_bytes_used and peak_megabytes_allocated to be used sensibly at all.

5 years agoseqDmdType needs to seq the DmdEnv as well
Joachim Breitner [Mon, 13 Oct 2014 10:44:56 +0000 (12:44 +0200)] 
seqDmdType needs to seq the DmdEnv as well

otherwise this can retain large lazy calculations. This fixed one space
leak pointed out in #9675.

5 years agoAdjust T9675 baseline numbers based on ghc-speed
Joachim Breitner [Mon, 13 Oct 2014 11:49:55 +0000 (13:49 +0200)] 
Adjust T9675 baseline numbers based on ghc-speed

although I obtained them originally from a clean validate tree on my
laptop, they did not match what I found on the build bot host.

5 years agoCompiler performance benchmark for #9675
Joachim Breitner [Mon, 13 Oct 2014 09:27:17 +0000 (11:27 +0200)] 
Compiler performance benchmark for #9675

so that whoever improves the situation can feel good about it.

5 years agoUpdate `time` submodule to address linker issue
Herbert Valerio Riedel [Mon, 13 Oct 2014 07:56:28 +0000 (09:56 +0200)] 
Update `time` submodule to address linker issue

See also

However, while the `time-1.5` package now loads successful in GHCi,
the linker warnings as reported in #9297 occur (which let the
testsuite fail for a dozen of testcases due to this additional

5 years agoFix build on some platforms
Simon Marlow [Sun, 12 Oct 2014 16:39:23 +0000 (17:39 +0100)] 
Fix build on some platforms

5 years agoRefactor to avoid need for `Unicode.hs-boot`
Herbert Valerio Riedel [Sat, 11 Oct 2014 10:35:28 +0000 (12:35 +0200)] 
Refactor to avoid need for `Unicode.hs-boot`

This avoids the import-cycle caused by the import of `Foreign.C.Types`
by using `Int` instead of `CInt` for the Unicode classification
functions. This refactoring also allows to remove a couple of

Reviewed By: rwbarton, ekmett

Differential Revision:

5 years agoExtend windows detection in testsuite to recognize MSYS target
Gintautas Miliauskas [Wed, 17 Sep 2014 18:57:39 +0000 (20:57 +0200)] 
Extend windows detection in testsuite to recognize MSYS target

Currently, the detection recognizes the following `uname -s` strings:

 - `CYGWIN_NT-6.3`
 - `MINGW32_NT-6.3`
 - `MINGW64_NT_6.3`

However, MSYS2 provides an additional target, in which case `uname -s`
returns a string such as `MSYS_NT-6.3`. In all these cases, the system
ought to be recognized as being a `windows` os by the testsuite runner.

See also #9604

5 years agoFallback to `ctypes.cdll` if `ctypes.windll` unavailable
Gintautas Miliauskas [Wed, 17 Sep 2014 18:57:04 +0000 (20:57 +0200)] 
Fallback to `ctypes.cdll` if `ctypes.windll` unavailable

On Windows, we may be using a native build of Python or a mingw/msys build. The
former exports `ctypes.windll`, the latter exports `cdll`. Previously the code
threw an exception when using the msys Python because it expected `windll` to
always be available on Windows.

Differential Revision:

5 years agoRemove a few redundant `.hs-boot` files
Herbert Valerio Riedel [Fri, 10 Oct 2014 22:44:54 +0000 (00:44 +0200)] 
Remove a few redundant `.hs-boot` files

There don't seem to be any corresponding `{-# SOURCE #-}` for the removed
`.hs-boot`-files anymore (if there ever was any in the first place).

This also removes a commented out `{-# SOURCE #-}` import which turns up when
grepping the source for `{-# SOURCE #-}` occurences.

5 years agorts: don't crash on 'hs_init(NULL, NULL)' in debug rts
Sergei Trofimovich [Fri, 10 Oct 2014 20:43:30 +0000 (21:43 +0100)] 
rts: don't crash on 'hs_init(NULL, NULL)' in debug rts

Caught by T6006 as a NULL dereference:

  Command: ./T6006

  Invalid read of size 8
     at 0x660ED9: hs_init_ghc (RtsStartup.c:168)
     by 0x660D90: hs_init (RtsStartup.c:112)
     by 0x40504D: main (in /home/slyfox/dev/git/ghc-validate/testsuite/tests/rts/T6006)
   Address 0x0 is not stack'd, malloc'd or (recently) free'd

The regression was introduced by commit

Signed-off-by: Sergei Trofimovich <>
5 years agoName worker threads using pthread_setname_np
Simon Marlow [Fri, 10 Oct 2014 13:26:19 +0000 (14:26 +0100)] 
Name worker threads using pthread_setname_np

This helps identify threads in gdb particularly in processes with a
lot of threads.

5 years agoRewrite section 1 of the Backpack manual. [skip ci]
Edward Z. Yang [Fri, 10 Oct 2014 07:01:57 +0000 (00:01 -0700)] 
Rewrite section 1 of the Backpack manual. [skip ci]

Signed-off-by: Edward Z. Yang <>
5 years agoUpdate haddock submodule with lazy IO fix.
Edward Z. Yang [Fri, 10 Oct 2014 04:40:41 +0000 (21:40 -0700)] 
Update haddock submodule with lazy IO fix.

Signed-off-by: Edward Z. Yang <>
5 years agoIgnore exe files in base (from tests)
Edward Z. Yang [Fri, 3 Oct 2014 22:15:52 +0000 (15:15 -0700)] 
Ignore exe files in base (from tests)

Signed-off-by: Edward Z. Yang <>
5 years agoMake the linker more robust to errors
Simon Marlow [Wed, 1 Oct 2014 12:15:05 +0000 (13:15 +0100)] 
Make the linker more robust to errors

When linking fails because there was a problem with the supplied
object file, then we should not barf() or exit, we should emit a
suitable error message and return an error code to the caller.  We
should also free all memory that might have been allocated during
linking, and generally not do any damage.  This patch fixes most
common instances of this problem.

Test Plan: validate

Reviewers: rwbarton, austin, ezyang

Reviewed By: ezyang

Subscribers: simonmar, ezyang, carter, thomie

Differential Revision:

5 years agoPreemptive performance number updates
Joachim Breitner [Wed, 8 Oct 2014 08:07:39 +0000 (10:07 +0200)] 
Preemptive performance number updates

5 years agoUpdate T4801 perf numbers
Joachim Breitner [Wed, 8 Oct 2014 07:41:35 +0000 (09:41 +0200)] 
Update T4801 perf numbers

5 years agoMake Data.List.takeWhile fuse: fix #9132
Joachim Breitner [Wed, 8 Oct 2014 06:53:26 +0000 (08:53 +0200)] 
Make Data.List.takeWhile fuse: fix #9132

Rewrites takeWhile to a build/foldr form; fuses repeated
applications of takeWhile.

Reviewers: nomeata, austin

Reviewed By: nomeata

Subscribers: thomie, carter, ezyang, simonmar

Projects: #ghc

Differential Revision:

GHC Trac Issues: #9132

5 years agoUpdate some out-of-date things in Backpack implementation doc [skip ci]
Edward Z. Yang [Wed, 8 Oct 2014 05:38:48 +0000 (23:38 -0600)] 
Update some out-of-date things in Backpack implementation doc [skip ci]

Signed-off-by: Edward Z. Yang <>
5 years agoInitial commit of the Backpack manual [skip ci]
Edward Z. Yang [Wed, 8 Oct 2014 05:20:33 +0000 (23:20 -0600)] 
Initial commit of the Backpack manual [skip ci]

Signed-off-by: Edward Z. Yang <>
5 years agoUse Data.Map.mergeWithKey
Joachim Breitner [Tue, 7 Oct 2014 15:07:36 +0000 (17:07 +0200)] 
Use Data.Map.mergeWithKey

Summary: now that we can rely on having containers > 0.5.

Reviewers: austin

Subscribers: thomie, carter, ezyang, simonmar

Differential Revision:

5 years agoBump haddock.base perf numbers
Reid Barton [Tue, 7 Oct 2014 20:27:41 +0000 (16:27 -0400)] 
Bump haddock.base perf numbers

We were so close to the max that the test failed if the pathname to
the GHC repository was more than a few dozen characters, causing the
haddock.base test to fail on Phab but not locally.

5 years agotestsuite: T5486 requires integer-gmp internals
Sergei Trofimovich [Tue, 7 Oct 2014 20:49:19 +0000 (21:49 +0100)] 
testsuite: T5486 requires integer-gmp internals

Signed-off-by: Sergei Trofimovich <>
5 years agoCode size micro-optimizations in the X86 backend
Reid Barton [Tue, 7 Oct 2014 13:24:15 +0000 (09:24 -0400)] 
Code size micro-optimizations in the X86 backend

Carter Schonwald suggested looking for opportunities to replace
instructions in GHC's output by equivalent ones that are shorter,
as recommended by the Intel optimization manuals.

This patch reduces the module sizes as reported by nofib
by about 1.5% on x86_64.

Test Plan:
Built an i386 cross-compiler and ran the test suite; the same
(rather large) set of tests failed before and after this commit.
Will let Harbormaster validate on x86_64.

Reviewers: austin

Subscribers: thomie, carter, ezyang, simonmar

Differential Revision:

5 years agoMake scanl fuse; add scanl'
David Feuer [Tue, 7 Oct 2014 18:51:25 +0000 (20:51 +0200)] 
Make scanl fuse; add scanl'

Make scanl a good producer and a good consumer for fold/build
fusion. Add strictly-accumulating scanl', which is required for

Reviewers: nomeata, austin

Reviewed By: austin

Subscribers: spacekitteh, thomie, carter, ezyang, simonmar

Differential Revision:

GHC Trac Issues: #9356

5 years agoFix closing parenthesis
Matt Kraai [Tue, 7 Oct 2014 13:51:30 +0000 (08:51 -0500)] 
Fix closing parenthesis

Reviewers: rwbarton, austin

Reviewed By: rwbarton, austin

Subscribers: rwbarton, thomie, carter, ezyang, simonmar

Differential Revision:

5 years agoClean up and remove todo.
Joel Burget [Tue, 7 Oct 2014 13:51:13 +0000 (08:51 -0500)] 
Clean up and remove todo.

The code is equivalent, just formatted nicely and without the
enthusiastic message to clean it up.

Test Plan: None

Reviewers: austin

Reviewed By: austin

Subscribers: simonmar, ezyang, carter, thomie

Differential Revision:

5 years agoconfigure in base: add msys to windows check
Yuras Shumovich [Tue, 7 Oct 2014 13:49:25 +0000 (08:49 -0500)] 
configure in base: add msys to windows check

I'm building ghc on windows x86 under msys2, and found that libraries/base/configure isn't able to detect msys as windows platform.

I'm not 100% sure it is the right solution. Probably I have local misconfiguration somewhere. So feel free to reject.

Test Plan: not necessary

Reviewers: austin

Reviewed By: austin

Subscribers: simonmar, ezyang, carter, thomie

Projects: #ghc

Differential Revision:

5 years agoFix configure check for 9439 bug
Yuras Shumovich [Tue, 7 Oct 2014 13:49:13 +0000 (08:49 -0500)] 
Fix configure check for 9439 bug

Summary: We should escape path to ghc.On wondows usually ghc comes from HP, which is installed somewhere in "...\Haskell Platform\..." Note space in the middle.

Test Plan: not necessary

Reviewers: rwbarton, hvr, austin

Reviewed By: rwbarton, hvr, austin

Subscribers: rwbarton, simonmar, ezyang, carter, thomie

Projects: #ghc

Differential Revision:

5 years agoAdd support for LINE pragma in template-haskell
Eric Mertens [Tue, 7 Oct 2014 13:48:37 +0000 (08:48 -0500)] 
Add support for LINE pragma in template-haskell

Provide a way to generate {-# LINE #-} pragmas when generating
Decs in Template Haskell. This allows more meaningful line
numbers to be reported in compile-time errors for dynamically
generated code.

Test Plan: Run test suite

Reviewers: austin, hvr

Reviewed By: austin

Subscribers: hvr, simonmar, ezyang, carter, thomie

Differential Revision:

5 years agoRemove unused hashName declaration
Jack Henahan [Tue, 7 Oct 2014 13:48:18 +0000 (08:48 -0500)] 
Remove unused hashName declaration

With the exception of the todo added in 2012, this function has been
untouched since 2007. It is not used anywhere else in GHC, so it appears
to be safe to remove. The accompanying comment refers to hashExpr, which
I couldn't find anywhere in the sources, either.

Test Plan: Removed declaration and export. Compiler built succesfully. No test cases exist to fail, and no other module appears to use it.

Reviewers: thomie, austin

Reviewed By: thomie, austin

Subscribers: simonmar, ezyang, carter, thomie

Differential Revision:

5 years agoDelete __GLASGOW_HASKELL__ ifdefs for stage0 < 7.6.
Thomas Miedema [Tue, 7 Oct 2014 13:48:06 +0000 (08:48 -0500)] 
Delete __GLASGOW_HASKELL__ ifdefs for stage0 < 7.6.

My understanding is that ghc 7.10 should be buildable with the last 3 versions
of ghc, i.e 7.6, 7.8 and 7.10 itself.

Test Plan: x

Reviewers: austin

Reviewed By: austin

Subscribers: hvr, simonmar, ezyang, carter, thomie

Differential Revision:

5 years agoRemove RAWCPP_FLAGS
Thomas Miedema [Tue, 7 Oct 2014 13:47:52 +0000 (08:47 -0500)] 

#9094 mentions to "remove the RAW_CPP bits from the ghc build system because
they're not longer needed", "once the CPP settings ticket is merged #8683"

#8683 was merged with 34f7e9a3c99850859901ca74370f55f1d4e2279a, Phab:D26.

Test Plan: harbormaster

Reviewers: carter, austin

Reviewed By: austin

Subscribers: simonmar, ezyang, carter

Differential Revision:

GHC Trac Issues: #9094

5 years agoFix a typo in an error message
Gabor Greif [Tue, 7 Oct 2014 08:20:08 +0000 (10:20 +0200)] 
Fix a typo in an error message

5 years agoMerge branch 'master' of
Simon Peyton Jones [Tue, 7 Oct 2014 07:03:58 +0000 (08:03 +0100)] 
Merge branch 'master' of

5 years agoUse correct precedence when printing contexts with class operators
Simon Peyton Jones [Thu, 2 Oct 2014 16:47:21 +0000 (17:47 +0100)] 
Use correct precedence when printing contexts with class operators

Fixes Trac #9658

5 years agotestsuite: fix seward-space-leak build aganst Prelude/Main 'traverse' clash
Sergei Trofimovich [Mon, 6 Oct 2014 21:01:14 +0000 (22:01 +0100)] 
testsuite: fix seward-space-leak build aganst Prelude/Main 'traverse' clash

Signed-off-by: Sergei Trofimovich <>
5 years agotestsuite: fix T1735_Help/State.hs build failure (AMP)
Sergei Trofimovich [Mon, 6 Oct 2014 20:55:02 +0000 (21:55 +0100)] 
testsuite: fix T1735_Help/State.hs build failure (AMP)

Signed-off-by: Sergei Trofimovich <>
5 years agotestsuite: fix T5751 build failure (AMP)
Sergei Trofimovich [Mon, 6 Oct 2014 20:46:26 +0000 (21:46 +0100)] 
testsuite: fix T5751 build failure (AMP)

Signed-off-by: Sergei Trofimovich <>
5 years agotestsuite: fix tcrun036 build against Prelude/Main 'traverse' clash
Sergei Trofimovich [Mon, 6 Oct 2014 20:43:42 +0000 (21:43 +0100)] 
testsuite: fix tcrun036 build against Prelude/Main 'traverse' clash

Signed-off-by: Sergei Trofimovich <>
5 years agorts: unrust 'libbfd' debug symbols parser
Sergei Trofimovich [Sun, 5 Oct 2014 20:20:39 +0000 (21:20 +0100)] 
rts: unrust 'libbfd' debug symbols parser

Patch does the following:
- fixes detection of working libbfd on modern linux
  platforms (where bfd_uncompress_section_contents is a macro)
- disables 'bfd' by default and adds '--enable-bfd-debug'
  configure option. As bfd's ABI is unstable
  the feature is primarily useful by ghc hackers.

Not done (subject for another patch):
- one-time bfd object memory leak in DEBUG_LoadSymbols
- in '-dynamic' mode debugging symbols are loaded only for
  current executable, not all libraries it is linked against.

Fixes Issue #8790

Signed-off-by: Sergei Trofimovich <>
Test Plan: built unregisterised ghc on amd64 and ran './hello +RTS -Di' there

Reviewers: simonmar, austin

Reviewed By: simonmar, austin

Subscribers: thomie, simonmar, ezyang, carter

Differential Revision:

GHC Trac Issues: #8790

5 years agoImplement `MIN_VERSION_GLASGOW_HASKELL()` macro
Herbert Valerio Riedel [Sun, 5 Oct 2014 20:35:22 +0000 (22:35 +0200)] 

This exposes the `cProjectPatchLevel{1,2}` value at the CPP level to
allow it to be used in CPP conditionals. Concretely, GHC
would result in

  #define __GLASGOW_HASKELL__             710
  #define __GLASGOW_HASKELL_PATCHLEVEL2__ 20150623

while GHC 7.10.3 results in

  #define __GLASGOW_HASKELL__             710

and finally GHC 7.9.20141009 results in

  #define __GLASGOW_HASKELL__             709
  #define __GLASGOW_HASKELL_PATCHLEVEL1__ 20141009

As it's error-prone to properly express CPP conditionals for testing GHC
multi-component versions, a new macro `MIN_VERSION_GLASGOW_HASKELL()` is
provided (also via the new CPP include file `ghcversion.h`)

Finally, in order to make it easier to define the new CPP macro
`MIN_VERSION_GLASGOW_HASKELL()`, a new default-included
`include/ghcversion.h` is used for the new CPP definitions.

Reviewed By: ekmett, austin, #ghc

Differential Revision:

5 years fix list for dll-split on GHCi-less builds
Sergei Trofimovich [Sat, 4 Oct 2014 19:48:22 +0000 (20:48 +0100)] fix list for dll-split on GHCi-less builds

To reproduce build failure it's enough to try
to build GHC on amd64 with the following setup:

    $ cat mk/
    # for #9552
    GhcWithInterpreter = NO

It gives:

    Reachable modules from DynFlags out of date
    Please fix compiler/, or building DLLs on Windows may break (#7780)
    Redundant modules: Bitmap BlockId ... <list of 42 modules>
    <make error>

dll-split among other things makes sure
all mentioned modules are used by DynFlags.
'#ifdef GHCI' keeps is from happening.

Patch moves those 42 modules under
'GhcWithInterpreter' guard.

Fixes Issue #9552

Signed-off-by: Sergei Trofimovich <>
5 years agoFix typo in section name: no leading period.
Edward Z. Yang [Fri, 3 Oct 2014 22:05:50 +0000 (15:05 -0700)] 
Fix typo in section name: no leading period.

Signed-off-by: Edward Z. Yang <>
5 years agoCheck for staticclosures section in Windows linker.
Edward Z. Yang [Fri, 3 Oct 2014 21:12:51 +0000 (14:12 -0700)] 
Check for staticclosures section in Windows linker.

Signed-off-by: Edward Z. Yang <>
5 years agoRestore spaces instead of tabs, caused by revert of Python 3
Krzysztof Gogolewski [Fri, 3 Oct 2014 17:56:00 +0000 (19:56 +0200)] 
Restore spaces instead of tabs, caused by revert of Python 3

The git hook does not allow to reinsert tabs.

5 years agoRevert "Basic Python 3 support for testsuite driver (Trac #9184)"
Krzysztof Gogolewski [Fri, 3 Oct 2014 17:18:38 +0000 (19:18 +0200)] 
Revert "Basic Python 3 support for testsuite driver (Trac #9184)"

This reverts commit 084d241b316bfa12e41fc34cae993ca276bf0730.

This is a possible culprit of Windows breakage reported at ghc-devs.