3 years agoMinor fix of MonadFail instance for `ReadPrec`
Herbert Valerio Riedel [Fri, 1 Jan 2016 00:50:07 +0000 (01:50 +0100)] 
Minor fix of MonadFail instance for `ReadPrec`

This fixes the instance to be semantically cleaner but other than that
this fix has no practical consequences as the implementations of
`Monad(fail)` and `MonadFail(fail)` for `ReadP` coincide.

3 years agoCanonicalise `MonadPlus` instances
Herbert Valerio Riedel [Fri, 1 Jan 2016 00:45:08 +0000 (01:45 +0100)] 
Canonicalise `MonadPlus` instances

This refactoring exploits the fact that since AMP, in most cases,
`instance MonadPlus` can be automatically derived from the respective
`Alternative` instance.  This is because `MonadPlus`'s default method
implementations are fully defined in terms of `Alternative(empty, (<>))`.

3 years agotravis: use GHC 7.10.3
Herbert Valerio Riedel [Thu, 31 Dec 2015 22:49:49 +0000 (23:49 +0100)] 
travis: use GHC 7.10.3

3 years agoUpdate haskeline submodule to latest snapshot
Herbert Valerio Riedel [Thu, 31 Dec 2015 22:42:59 +0000 (23:42 +0100)] 
Update haskeline submodule to latest snapshot

This pulls in a fix to suppress a `hsc2hs`-related
warning in the windows backend.

3 years agoSimplify -fcmm-sink handling for Parser.hs
Herbert Valerio Riedel [Thu, 31 Dec 2015 20:33:46 +0000 (21:33 +0100)] 
Simplify -fcmm-sink handling for Parser.hs

As we're requiring GHC >= 7.10 now, the conditional handling introduced
in 9e133b9dccec0553c6ec302d6ca0d3bc5eea06c4 for addressing #8182 can be
made unconditional, and thus simplify the build-system a little bit.

3 years agoRemove ghc-7.8 `-package-name`-compat handling
Herbert Valerio Riedel [Thu, 31 Dec 2015 20:25:26 +0000 (21:25 +0100)] 
Remove ghc-7.8 `-package-name`-compat handling

This code was introduced in 66218d15b7c27a4a38992003bd761f60bae84b1f to
use `-package-name` for GHC 7.8, whereas GHC 7.10 needs the new
`-this-package-key` flag.

3 years agoRemove some redundant definitions/constraints
Herbert Valerio Riedel [Thu, 31 Dec 2015 15:42:38 +0000 (16:42 +0100)] 
Remove some redundant definitions/constraints

Starting with GHC 7.10 and base-4.8, `Monad` implies `Applicative`,
which allows to simplify some definitions to exploit the superclass
relationship. This a first refactoring to that end.

3 years agoDrop pre-AMP compatibility CPP conditionals
Herbert Valerio Riedel [Thu, 31 Dec 2015 12:47:43 +0000 (13:47 +0100)] 
Drop pre-AMP compatibility CPP conditionals

Since GHC 8.1/8.2 only needs to be bootstrap-able by GHC 7.10 and
GHC 8.0 (and GHC 8.2), we can now finally drop all that pre-AMP
compatibility CPP-mess for good!

Reviewers: austin, goldfire, bgamari

Subscribers: goldfire, thomie, erikd

Differential Revision:

3 years agoDrop redundant/explicit `=1` in `-DFOO=1` flags
Herbert Valerio Riedel [Thu, 31 Dec 2015 21:01:26 +0000 (22:01 +0100)] 
Drop redundant/explicit `=1` in `-DFOO=1` flags

Quoting the POSIX standard for the `-D` C compiler flag:

  -D  name[=value]

      Define name as if by a C-language #define directive.
      If no `=value` is given, a value of 1 shall be used.

Removing this explicit `=1` definition from `-D` flags which are used to
define boolean macro constants makes the CLI invocation a bit more
idiomatic and reduces visual noise in debugging output
(flags containing `=`s are additionally put in single-quotes by GHC)

3 years agoUse 0/1 instead of YES/NO as `__GLASGOW_HASKELL_TH__` macro value
Herbert Valerio Riedel [Thu, 31 Dec 2015 20:02:50 +0000 (21:02 +0100)] 
Use 0/1 instead of YES/NO as `__GLASGOW_HASKELL_TH__` macro value

Using `YES`/`NO` causes all sorts of problems as CPP doesn't work on
symbolic tokens but rather on scalar values.

A use like

   {-# LANGUAGE TemplateHaskell #-}

doesn't do what one may naively expect, and neither does

   {-# LANGUAGE TemplateHaskell #-}

*unless* `YES` happens to evaluate to a non-zero scalar.

`__GLASGOW_HASKELL_TH__ was originally introduced via D396 / #9734.

Fixes #11322

Reviewed By: austin

Differential Revision:

3 years agoDrop redundant `-D__GLASGOW_HASKELL__=...` flag
Herbert Valerio Riedel [Thu, 31 Dec 2015 15:58:28 +0000 (16:58 +0100)] 
Drop redundant `-D__GLASGOW_HASKELL__=...` flag

In 3549c952b535803270872adaf87262f2df0295a4 a `include/ghcversions.h` include
file was introduced which defines `__GLASGOW_HASKELL__` as well.

So there's no need to define it twice.

3 years agoTest Trac #11245
Simon Peyton Jones [Thu, 31 Dec 2015 14:32:27 +0000 (14:32 +0000)] 
Test Trac #11245

3 years agoComments only
Simon Peyton Jones [Thu, 31 Dec 2015 09:21:58 +0000 (09:21 +0000)] 
Comments only

3 years agoImprove exprIsBottom
Simon Peyton Jones [Thu, 31 Dec 2015 09:07:33 +0000 (09:07 +0000)] 
Improve exprIsBottom

This fixes Trac #11290, by being sligthtly cleverer about finding
what expressions are bottom.  Actually this might have minor
other side benefits.

3 years agofix ghci build on ArchUnknown targets
Sergei Trofimovich [Thu, 31 Dec 2015 10:32:40 +0000 (10:32 +0000)] 
fix ghci build on ArchUnknown targets

Observed failure on ia64 as:

    "inplace/bin/hsc2hs" \
         ... \
         --cflag=-Dia64_HOST_ARCH=1 --cflag=-Dlinux_HOST_OS=1 \
         ... \
         libraries/ghci/./GHCi/InfoTable.hsc \
         -o libraries/ghci/dist-install/build/GHCi/InfoTable.hs

    InfoTable.hsc:84:2: error: #error Unknown architecture

Signed-off-by: Sergei Trofimovich <>
3 years agoVarious API Annotations fixes
Alan Zimmerman [Wed, 30 Dec 2015 16:51:53 +0000 (18:51 +0200)] 
Various API Annotations fixes

- Export unicodeAnn from GHC
- unicodeAnn for Annlarrowtail was wrong
- Use actual source for a CImport SourceText

3 years agoAddress #11245: Ensure the non-matched list is always non-empty
George Karachalias [Wed, 30 Dec 2015 15:09:29 +0000 (16:09 +0100)] 
Address #11245: Ensure the non-matched list is always non-empty

When there is an uncovered vector of length 0 (which in turn means that
it represents a guard failure) print "(incomplete guards)" instead of an
empty list of non-covered vectors.

Test Plan: validate

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #11245

3 years agoBump GHC HEAD's Version from 7.11 to 8.1 ghc-8.1-start
Herbert Valerio Riedel [Wed, 30 Dec 2015 16:28:13 +0000 (17:28 +0100)] 
Bump GHC HEAD's Version from 7.11 to 8.1

This updates the haddock submodule

3 years agoglasgow_exts.rst: fix code block
Sergei Trofimovich [Wed, 30 Dec 2015 16:21:25 +0000 (16:21 +0000)] 
glasgow_exts.rst: fix code block

Detected by sphinx as:
    ERROR: Unexpected indentation.

Signed-off-by: Sergei Trofimovich <>
3 years agorts/Linker.c: mark ia64 as 64-bit ELF, drop unused branches
Sergei Trofimovich [Wed, 30 Dec 2015 12:40:56 +0000 (12:40 +0000)] 
rts/Linker.c: mark ia64 as 64-bit ELF, drop unused branches

Signed-off-by: Sergei Trofimovich <>
3 years agorts/PrimOps.cmm: fix UNREG profiled build
Sergei Trofimovich [Wed, 30 Dec 2015 12:35:53 +0000 (12:35 +0000)] 
rts/PrimOps.cmm: fix UNREG profiled build

Brought 'CCS_MAIN' into scope, otherwise UNREG
prof build is unhappy:

    rts_dist_HC rts/dist/build/PrimOps.p_o
  /tmp/ghc25593_0/ghc_3.hc: In function 'clB_entry':

  /tmp/ghc25593_0/ghc_3.hc:2983:24: error:
     error: 'CCS_MAIN' undeclared (first use in this function)
     *((P_)(_cly+8)) = (W_)&CCS_MAIN;

Signed-off-by: Sergei Trofimovich <>
3 years agoFix some typos
Gabor Greif [Wed, 30 Dec 2015 12:27:57 +0000 (13:27 +0100)] 
Fix some typos

3 years agoTestsuite: mark T7653 with high_memory_usage
Thomas Miedema [Sat, 26 Dec 2015 13:32:55 +0000 (14:32 +0100)] 
Testsuite: mark T7653 with high_memory_usage

3 years agousers_guide/ghci: Fix heading
Ben Gamari [Wed, 30 Dec 2015 10:21:43 +0000 (11:21 +0100)] 
users_guide/ghci: Fix heading

3 years agoT11303: Set maximum heap size
Ben Gamari [Wed, 30 Dec 2015 10:16:59 +0000 (11:16 +0100)] 
T11303: Set maximum heap size

As suggested by @thomie.

3 years agoMake iserv-bin compatible with GHC version bump to 8.0
Herbert Valerio Riedel [Wed, 30 Dec 2015 07:37:02 +0000 (08:37 +0100)] 
Make iserv-bin compatible with GHC version bump to 8.0

3 years agoFix #11305.
Richard Eisenberg [Tue, 29 Dec 2015 05:27:59 +0000 (00:27 -0500)] 
Fix #11305.

In the fallthrough case when doing a subsumption case, we
need to deeply instantiate to remove any buried foralls in
the "actual" type.

Once this validates, please feel free to commit it; I may not
have the chance to do this on Tuesday. Back in full action on

Test Plan: ./validate, typecheck/should_compiler/T11305

Reviewers: austin, bgamari, hvr

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #11305

3 years agotestsuite: normalise away `ld`-warning on AIX
Herbert Valerio Riedel [Mon, 28 Dec 2015 22:18:33 +0000 (23:18 +0100)] 
testsuite: normalise away `ld`-warning on AIX

On AIX, `ld` doesn't support `-x` and ignores it. However, a warning is
emitted to stderr which ends up triggering false positives in some of
GHC's testsuite tests. So we simply filter out that noise as part of
normalising stderr.

3 years agoRemove `cabal07`-test broken by e4cc19de4bdbcc
Herbert Valerio Riedel [Tue, 29 Dec 2015 21:57:29 +0000 (22:57 +0100)] 
Remove `cabal07`-test broken by e4cc19de4bdbcc

This test is no longer legitimate as the feature it tests was removed
from Cabal via

3 years agoUpdate Cabal submodule to latest snapshot
Herbert Valerio Riedel [Tue, 29 Dec 2015 21:19:54 +0000 (22:19 +0100)] 
Update Cabal submodule to latest snapshot

3 years agoAdd regression test for #11303
Ben Gamari [Tue, 29 Dec 2015 19:42:19 +0000 (20:42 +0100)] 
Add regression test for #11303

Test Plan: Validate

Reviewers: austin

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #11303

3 years agotestlib: Make TyCon normalization Python 2.6-compatible
Ben Gamari [Tue, 29 Dec 2015 17:16:59 +0000 (18:16 +0100)] 
testlib: Make TyCon normalization Python 2.6-compatible

D1629 introduced this normalization which was not Python 2.6 compatible
due to the use of the `flags` argument of `re.sub`. Fix this.

Test Plan: Validate

Reviewers: austin, thomie

Differential Revision:

3 years agoIntroduce negative patterns for literals (addresses #11303)
George Karachalias [Tue, 29 Dec 2015 17:16:38 +0000 (18:16 +0100)] 
Introduce negative patterns for literals (addresses #11303)

Introduce negative patterns for literals. In addition to storing term
constraints for literals (checked at the end by the term oracle), also
check eagerly, using negative patterns. This means generation of smaller
sets (covered, uncovered, and divergent), instead of generating big sets
and pruning afterwards.

Test Plan: validate

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #11303

3 years agoAccept submodule libraries/primitive commit 1af89788d
Gabor Greif [Tue, 29 Dec 2015 15:40:26 +0000 (16:40 +0100)] 
Accept submodule libraries/primitive commit 1af89788d

3 years agoModify getFullArgs to include program name
Rik Steenkamp [Tue, 29 Dec 2015 13:38:40 +0000 (14:38 +0100)] 
Modify getFullArgs to include program name

Fixes an inconsistency of `getFullArgs` across operating systems. On
non-Windows systems the returning list did not include the program name
as the first element, while on Windows systems it did.

As `System.Environment` depends on this behaviour of `getFullArgs` under
Windows, this is now the behaviour across all operating systems.
Computation `getFullArgs` is now like the "raw" version of `getArgs`,
similar to `argv` in other languages.

This patch also fixes T10728 under Windows.

Reviewers: austin, hvr, erikd, #ghc_windows_task_force, Phyx, bgamari

Reviewed By: #ghc_windows_task_force, Phyx, bgamari

Subscribers: Phyx, thomie

Differential Revision:

3 years agoUpdate a few references to GHC 7.12
Ben Gamari [Tue, 29 Dec 2015 13:21:18 +0000 (14:21 +0100)] 
Update a few references to GHC 7.12

3 years agousers_guide: Move 7.12.1-notes to 8.0.1-notes
Ben Gamari [Tue, 29 Dec 2015 13:16:46 +0000 (14:16 +0100)] 
users_guide: Move 7.12.1-notes to 8.0.1-notes

3 years agoFix GEq1 when optimizations are enabled
RyanGlScott [Tue, 29 Dec 2015 12:43:52 +0000 (13:43 +0100)] 
Fix GEq1 when optimizations are enabled

When optimizations are enabled, primitive string literals can be
inlined, which can create two copies of a string constant with different
addresses. We want to avoid this behavior at all costs in the `GEq1`
test, since the output depends on the result of `eqAddr#`. We prevent
such inlining through use of the `{-# NOINLINE #-}` pragma.

Fixes #11292.

Test Plan: Validate with T11292

Reviewers: thomie, austin, bgamari

Reviewed By: bgamari

Differential Revision:

GHC Trac Issues: #11292

3 years agoExport some useful GHC API functions.
Edward Z. Yang [Tue, 29 Dec 2015 12:43:02 +0000 (13:43 +0100)] 
Export some useful GHC API functions.

Working on some code using the GHC API, I found these
functions were useful and wished they were exported.  This
commit exports them.

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

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: hvr, thomie

Differential Revision:

3 years agoFix panic when using pattern synonyms with DisambiguateRecordFields
Adam Gundry [Tue, 29 Dec 2015 12:42:32 +0000 (13:42 +0100)] 
Fix panic when using pattern synonyms with DisambiguateRecordFields

This fixes a `find_tycon` panic when constructing a record pattern
synonym when `DisambiguateRecordFields` (turned on by `RecordWildCards`)
is enabled.  The handling of record wild cards in such constructions
isn't completely satisfactory, but doing better will require the
`Parent` type to be more informative, as I'll explain on #11228.

Test Plan: New test patsyn/should_compile/T11283.hs

Reviewers: mpickering, austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #11283

3 years agoghc/Main: Update list of --print modes
Ben Gamari [Mon, 28 Dec 2015 14:14:18 +0000 (15:14 +0100)] 
ghc/Main: Update list of --print modes

Test Plan: Validate

Reviewers: austin, hvr

Reviewed By: hvr

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #9614

3 years agodrop obsolete/redundant OPTIONS pragma [skip ci]
Herbert Valerio Riedel [Tue, 29 Dec 2015 12:48:47 +0000 (13:48 +0100)] 
drop obsolete/redundant OPTIONS pragma [skip ci]

3 years agoMake git-committer inferred version-date TZ-invariant
Herbert Valerio Riedel [Mon, 28 Dec 2015 21:55:24 +0000 (22:55 +0100)] 
Make git-committer inferred version-date TZ-invariant

The existing code suffers from the issue of converting the
committer date to localtime, thereby resulting in varying
inferred dates for the same commit-hash depending on the currently
set local timezone.

In order to have a universally unique mapping between commit-hashes and
their snapshot-version-date it's better to convert to the date expressed
in a fixed timezone like e.g. UTC.

Sadly, `git` doesn't seem to provide a way to directly format dates the
way we need it, so we shell out to `perl` for this.

Reviewers: austin, thomie, erikd, bgamari

Differential Revision:

3 years agoUpdate time submodule to latest snapshot
Herbert Valerio Riedel [Mon, 28 Dec 2015 21:51:43 +0000 (22:51 +0100)] 
Update time submodule to latest snapshot

3 years agoUpdate filepath submodule to v1.4.1.0 rls tag
Herbert Valerio Riedel [Mon, 28 Dec 2015 20:41:28 +0000 (21:41 +0100)] 
Update filepath submodule to v1.4.1.0 rls tag

This submodule update contains only changelog changes,
hence [skip ci].

/cc @ndmitchell

3 years agoUpdate hpc submodule to version
Herbert Valerio Riedel [Mon, 28 Dec 2015 09:42:38 +0000 (10:42 +0100)] 
Update hpc submodule to version

3 years agoPatch-level increment integer-simple version
Herbert Valerio Riedel [Mon, 28 Dec 2015 09:40:37 +0000 (10:40 +0100)] 
Patch-level increment integer-simple version

3 years agoPatch-level increment integer-gmp to
Herbert Valerio Riedel [Mon, 28 Dec 2015 09:39:31 +0000 (10:39 +0100)] 
Patch-level increment integer-gmp to

and update

3 years agoSynchronise ghci-package version with ghc-package
Herbert Valerio Riedel [Sun, 27 Dec 2015 08:03:44 +0000 (09:03 +0100)] 
Synchronise ghci-package version with ghc-package

In order to simplify the task, the version munging logic has
been radically simplified:

Previously, in cases where the version contained dates as version components,
the build-system would munge the version of the stage1 ghc package before
registering the `ghc` package.

However, this hack was already questionable at the time of its introduction
(c.f. 7b45c46cbabe1288ea87bd9b94c57e010ed17e60).
Simplifying the build-systems by avoiding such hacks may also help the
shaking-up-ghc effort.

So now we simply munge directly via the `.cabal` files, which gives a simpler
picture, as now every stage is munged the same. Munging is only active when
the first patch-level version component is a date. So stable snapshots and release
candidates are unaffacted (as those have the date in the second patch-level
version component)

Reviewers: simonmar, bgamari, austin, thomie, ezyang

Reviewed By: bgamari, thomie, ezyang

Differential Revision:

3 years agorts/Linker(ARM): Ensure all code sections are flushed from cache
Ben Gamari [Sun, 27 Dec 2015 22:59:59 +0000 (23:59 +0100)] 
rts/Linker(ARM): Ensure all code sections are flushed from cache

Test Plan: Validate with T12299

Reviewers: hsyl20, austin, erikd

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #11299

3 years agoThe -package flag should select match from right-most package db.
Edward Z. Yang [Sun, 27 Dec 2015 22:57:18 +0000 (23:57 +0100)] 
The -package flag should select match from right-most package db.

The shadowing and default behavior (in the absence of
-hide-all-packages) prefers packages that come from "later" package
databases.  So for example if tmp1.d and tmp2.d both expose p-1.0, then

    ghc -package-db tmp1.d -package-db tmp2.d

brings the p-1.0 from tmp2.d into scope (and if they have the same IPID,
tmp2.d shadows tmp1.d).  HOWEVER, -package flags do NOT respect this

    ghc -package-db tmp1.d -package-db tmp2.d -package p-1.0

this will force the p-1.0 from tmp1.d to be exposed!  This is
confusing, so this patch makes the behavior of -package flags

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

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision:

3 years agoRTS: Detect powerpc64le as ELF 64-bit system
Peter Trommler [Sun, 27 Dec 2015 22:53:18 +0000 (23:53 +0100)] 
RTS: Detect powerpc64le as ELF 64-bit system

Test Plan: validate

Reviewers: simonmar, erikd, austin, bgamari

Reviewed By: austin, bgamari

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #11269

3 years agoAdding flags: -ffull-guard-reasoning and too-many-guards
George Karachalias [Sun, 27 Dec 2015 22:05:02 +0000 (23:05 +0100)] 
Adding flags: -ffull-guard-reasoning and too-many-guards

Introduction of two new flags, for more precise control over the new
pattern match checker's behaviour when reasoning about guards. This is
supposed to address #11195 (and maybe more performance bugs related to
the NP-Hardness of coverage checking).

Expected behaviour:

  * When `-ffull-guard-reasoning` is on, run the new pattern match
    checker in its full power

  * When `-ffull-guard-reasoning` is off (the default), for every
    match, check a metric to see whether pattern match checking for it
    has high probability of being non performant (at the the moment we
    check whether the number of guards is over 20 but I would like to
    use a more precise measure in the future). If the probability is

    - Oversimplify the guards (less expressive but more performant)
      and run the checker, and

    - Issue a warning about the simplification that happened.

A new flag `-Wtoo-many-guards/-Wno-too-many-guards` suppresses the
warning about the simplification (useful when combined with -Werror).

Test Plan: validate

Reviewers: goldfire, austin, hvr, bgamari

Reviewed By: bgamari

Subscribers: mpickering, thomie

Differential Revision:

GHC Trac Issues: #11195

3 years agointeger-gmp: Fix #11296
Ben Gamari [Sun, 27 Dec 2015 16:49:10 +0000 (17:49 +0100)] 
integer-gmp: Fix #11296

This was introduced by a mental fumble in
9e8562ae02701270e2c1dfcee3279d862dc5b7b6 wherein I replaced
`getSizeofMutableByteArray` with `getSizeofMutBigNat`. This was noticed
by invalid integers being produced on 32-bit machines in #11296.

Test Plan: Validate

Reviewers: hvr, goldfire, austin

Reviewed By: hvr

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #11296

3 years agoAdd testcase for getSizeofMutableByteArray#
Ben Gamari [Sun, 27 Dec 2015 16:49:03 +0000 (17:49 +0100)] 
Add testcase for getSizeofMutableByteArray#

In an attempt to track down #11296. Unfortunately the primop appears
to be working as expected.

Test Plan: validate

Reviewers: hvr, austin

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #11296

3 years agotestsuite/CmmSwitchTest: Mark as broken on 32-bit platforms
Ben Gamari [Sun, 27 Dec 2015 11:11:39 +0000 (12:11 +0100)] 
testsuite/CmmSwitchTest: Mark as broken on 32-bit platforms

As pointed out in #11297 this test is broken on 32-bit platforms.

3 years agoClean up a botched merge.
Edward Z. Yang [Sat, 26 Dec 2015 23:48:13 +0000 (15:48 -0800)] 
Clean up a botched merge.

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

Reviewers: austin, bgamari

Subscribers: thomie

Differential Revision:

3 years agotestsuite/joao-circular: Clean up test results
Ben Gamari [Sun, 27 Dec 2015 00:14:00 +0000 (01:14 +0100)] 
testsuite/joao-circular: Clean up test results

Eliminate redundant pattern which resulted in warning. Also increase the
compile timeout multiplier since this test tends to take quite a while
to build. I have seen it fail numerous times during Harbormaster builds
and have never seen it pass on ARM.

Test Plan: Validate

Reviewers: austin, thomie

Reviewed By: thomie

Differential Revision:

3 years agoLinker(ELF): Fix addProddableBlocks usage
Ben Gamari [Sun, 27 Dec 2015 00:13:39 +0000 (01:13 +0100)] 
Linker(ELF): Fix addProddableBlocks usage

The range marked as proddable didn't actually match the range that we
mapped. This fixed `ghc-api/T8628` et al on ARM.

Test Plan: Validate

Reviewers: austin, erikd

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #11289

3 years agolibraries/ghci: Implement mkJumpToAddr for ppc64
Peter Trommler [Sun, 27 Dec 2015 00:12:51 +0000 (01:12 +0100)] 
libraries/ghci: Implement mkJumpToAddr for ppc64

Test Plan: validated on powerpc64 and powerpc64le

Reviewers: austin, erikd, simonmar, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #11257

3 years agoLinker: Reenable Thumb support
Ben Gamari [Sat, 26 Dec 2015 12:32:56 +0000 (13:32 +0100)] 
Linker: Reenable Thumb support

I believe this ought to be okay now since we only produce ARM-encoded
objects. Added a Note describing the state of things.

3 years agotestsuite/T9430: Fix word-size dependence
Ben Gamari [Sat, 26 Dec 2015 22:23:03 +0000 (23:23 +0100)] 
testsuite/T9430: Fix word-size dependence

Summary: This test was wrong.

Test Plan: Validate

Reviewers: erikd, austin

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #11294

3 years agotestsuite/codegen: Add missing dummy Makefiles
Ben Gamari [Sat, 26 Dec 2015 21:47:45 +0000 (22:47 +0100)] 
testsuite/codegen: Add missing dummy Makefiles

3 years agotestsuite/T8274: Remove 32-bit test output
Ben Gamari [Sat, 26 Dec 2015 21:41:42 +0000 (22:41 +0100)] 
testsuite/T8274: Remove 32-bit test output

It appears that this was only necessary on account of the varying types
of type representation fingerprints, which has been resolved in

3 years agoT10518: Ensure literal has 64-bit type
Ben Gamari [Mon, 26 Oct 2015 09:12:13 +0000 (09:12 +0000)] 
T10518: Ensure literal has 64-bit type

Otherwise we get a C-- lint error due to mismatched RHS and
variable types.

3 years agoLinker: Fix cut-and-paste error in debug output
Ben Gamari [Sat, 26 Dec 2015 11:55:12 +0000 (12:55 +0100)] 
Linker: Fix cut-and-paste error in debug output

3 years agoBump Haddock submodule again
Ben Gamari [Fri, 25 Dec 2015 10:11:50 +0000 (11:11 +0100)] 
Bump Haddock submodule again

Merged a few outstanding pull requests. Still need to work through
haddock testsuite issues.

3 years agoTest #10619 in typecheck/should_fail/T10619
Richard Eisenberg [Sat, 26 Dec 2015 18:55:42 +0000 (13:55 -0500)] 
Test #10619 in typecheck/should_fail/T10619

3 years agoTest #10589 in typecheck/should_compile/T10589
Richard Eisenberg [Sat, 26 Dec 2015 18:04:44 +0000 (13:04 -0500)] 
Test #10589 in typecheck/should_compile/T10589

3 years agoFix #11287.
Richard Eisenberg [Sat, 26 Dec 2015 17:58:03 +0000 (12:58 -0500)] 
Fix #11287.

Happily, the fix is simply deleting some old code. I love it when
that happens.

3 years agoHave mkCastTy look more closely for reflexivity.
Richard Eisenberg [Sat, 26 Dec 2015 14:11:33 +0000 (09:11 -0500)] 
Have mkCastTy look more closely for reflexivity.

This may have performance implications.

3 years agoNote [TyBinder] in TyCoRep
Richard Eisenberg [Tue, 22 Dec 2015 18:35:33 +0000 (13:35 -0500)] 
Note [TyBinder] in TyCoRep

3 years agoTest #11254 in typecheck/should_compile/T11254
Richard Eisenberg [Tue, 22 Dec 2015 18:34:52 +0000 (13:34 -0500)] 
Test #11254 in typecheck/should_compile/T11254

3 years agoFix #11255.
Richard Eisenberg [Fri, 18 Dec 2015 20:53:26 +0000 (15:53 -0500)] 
Fix #11255.

We need to instantiate types in tuples. Quite straightforward.

3 years agoTestsuite: mark T7681 expect_broken (#11287)
Thomas Miedema [Fri, 25 Dec 2015 14:11:05 +0000 (15:11 +0100)] 
Testsuite: mark T7681 expect_broken (#11287)

When compiler_debugged only. This makes the Travis build green again.

3 years agoTestsuite: fix qq005 and qq006 (#11279)
Thomas Miedema [Fri, 25 Dec 2015 13:10:35 +0000 (14:10 +0100)] 
Testsuite: fix qq005 and qq006 (#11279)

With 399a5b46591dfbee0499d6afa1bb80ad2fd52598, the old `[$foo| ... |]`
syntax for quasi-quotes is no longer allowed.

3 years agoVisible type application
Richard Eisenberg [Thu, 24 Dec 2015 19:33:19 +0000 (14:33 -0500)] 
Visible type application

This re-working of the typechecker algorithm is based on
the paper "Visible type application", by Richard Eisenberg,
Stephanie Weirich, and Hamidhasan Ahmed, to be published at

This patch introduces -XTypeApplications, which allows users
to say, for example `id @Int`, which has type `Int -> Int`. See
the changes to the user manual for details.

This patch addresses tickets #10619, #5296, #10589.

3 years agoDon't drop last char of file if -osuf contains dot
Thomas Miedema [Wed, 18 Mar 2015 19:08:08 +0000 (20:08 +0100)] 
Don't drop last char of file if -osuf contains dot

 * `file = "foo.a.b"`
 * `osuf = ".a.b"`  -- Note the initial dot.
 * `new_osuf = "c"`

Before (bad, the last character of the filename is dropped):
  `dropTail (length osuf + 1) file <.> new_osuf == "fo.c"`
After (good):
  `stripExtension osuf file <.> new_osuf` == "foo.c"

This regression was introduced in commit c489af73 (#5554). That commit
fixed a similar but different bug, and care has been taken to not
reintroduce it (using the the newly introduced

 * `file = "foo.a.b"`
 * `osuf = "a.b"`
 * `new_osuf = "c"`

Before c489af73 (bad, the full suffix should get replaced):
  `replaceExtension file new_osuf == "foo.a.c"`
After c489af73 (good):
  `dropTail (length osuf + 1) file <.> new_osuf == "foo.c"`
After this commit (still good):
  `stripExtension osuf file <.> new_osuf == "foo.c"`

Reviewed by: bgamari

Differential Revision:

GHC Trac Issues: #9760

3 years agoFix normalisation of TyCon representations
Erik de Castro Lopo [Thu, 24 Dec 2015 13:41:53 +0000 (14:41 +0100)] 
Fix normalisation of TyCon representations

Test Plan: run tests on powerpc and x86_64

Reviewers: hvr, austin, thomie, bgamari

Reviewed By: thomie, bgamari

Subscribers: thomie

Differential Revision:

3 years agoRefactoring only
Simon Peyton Jones [Thu, 24 Dec 2015 14:55:35 +0000 (14:55 +0000)] 
Refactoring only

This moves code around to more sensible places.

- Construction for CoAxiom is localised in FamInstEnv

- orphNamesOfxx moves to CoreFVs

- roughMatchTcs, instanceCantMatch moves to Unify

- mkNewTypeCo moves from Coercion to FamInstEnv, and is
  renamed mkNewTypeCoAxiom, which makes more sense

3 years agoImprove tracing a bit in CoreSubst
Simon Peyton Jones [Thu, 24 Dec 2015 14:44:16 +0000 (14:44 +0000)] 
Improve tracing a bit in CoreSubst

3 years agoImprove the runRW magic in CorePrep
Simon Peyton Jones [Thu, 24 Dec 2015 14:42:34 +0000 (14:42 +0000)] 
Improve the runRW magic in CorePrep

Instead of substituting, just augment the environment.
Less code, more efficient.

And the previous version had a bogus in-scope set which
triggered a WARNING

3 years agoImprove SimplUtils.interestingArg
Simon Peyton Jones [Thu, 24 Dec 2015 14:40:08 +0000 (14:40 +0000)] 
Improve SimplUtils.interestingArg

There were two problems here:
 - We were looking under a lambda without extending
   the in-scope env, which triggered a WARNING
   But there's no need to look under a lambda.

 - We were looking under a letrec without extending
   the in-scope env, which triggered the same WARNING
   Solution: extend the in-scope env

3 years agoghc-cabal: Bring back TRANSITIVE_DEP_NAMES
Ben Gamari [Thu, 24 Dec 2015 12:39:28 +0000 (13:39 +0100)] 
ghc-cabal: Bring back TRANSITIVE_DEP_NAMES

This is still needed by the Shake build system until things have been
reworked to use Cabal directly.

3 years Disable stripping by default on ARM
Ben Gamari [Wed, 23 Dec 2015 22:51:02 +0000 (23:51 +0100)] Disable stripping by default on ARM

The Cortex A8 hardware apparently has a bug which will try to
correct; however in order to do so it must have unstripped executables
lest we see warnings of the form (see #10376, #10464),

    /usr/bin/ warning: cannot scan executable section 1 of ...
    for Cortex-A8 erratum because it has no mapping symbols.

Consequently we disabling stripping by default on this architecture.

A bit more discussion about this issue can be found in this [Android

Test Plan: Try validating on ARM

Reviewers: erikd, austin, thomie

Reviewed By: austin, thomie

Differential Revision:

GHC Trac Issues: #10376, #10464

3 years agoMake testsuite work again with Py3
Herbert Valerio Riedel [Wed, 23 Dec 2015 21:37:42 +0000 (22:37 +0100)] 
Make testsuite work again with Py3

Python 3 support seems to have mildly bitrotten since #9184 was closed.
Luckily, only some minor tweaks seem necessary.

3 years agoDocs: -interactive-print should reside in registered package
Thomas Miedema [Wed, 23 Dec 2015 21:14:57 +0000 (22:14 +0100)] 
Docs: -interactive-print should reside in registered package

Since commit 03c4893e355948fe865bc52c744359c42e4b06d7, ic_int_print is
retained from registered packages after `:reload`.

Fixes #11159.

3 years agoTest #10432
Jan Stolarek [Wed, 23 Dec 2015 08:35:36 +0000 (09:35 +0100)] 
Test #10432

Summary: A regression test for #10432, which seems to already be fixed.

Test Plan: ./validate

Reviewers: simonpj, austin, bgamari

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #10432

3 years agoUpdate tests for Trac #11039
Simon Peyton Jones [Wed, 23 Dec 2015 12:09:32 +0000 (12:09 +0000)] 
Update tests for Trac #11039

3 years agoAPI Annotaions:add name in PatBind Match
Alan Zimmerman [Wed, 23 Dec 2015 10:44:23 +0000 (12:44 +0200)] 
API Annotaions:add name in PatBind Match

A PatBind operates similarly to a FunBind, and so the RdrName and
infix/prefix state needs to be captured for use in API Annotations.

3 years agoAllow CallStacks to be frozen
Eric Seidel [Wed, 23 Dec 2015 09:10:04 +0000 (10:10 +0100)] 
Allow CallStacks to be frozen

This introduces "freezing," an operation which prevents further
locations from being appended to a CallStack.  Library authors may want
to prevent CallStacks from exposing implementation details, as a matter
of hygiene. For example, in

head [] = error "head: empty list"

ghci> head []
*** Exception: head: empty list
CallStack (from implicit params):
  error, called at ...

including the call-site of `error` in `head` is not strictly necessary
as the error message already specifies clearly where the error came

So we add a function `freezeCallStack` that wraps an existing CallStack,
preventing further call-sites from being pushed onto it. In other words,

pushCallStack callSite (freezeCallStack callStack) = freezeCallStack callStack

Now we can define `head` to not produce a CallStack at all

head [] =
  let ?callStack = freezeCallStack emptyCallStack
  in error "head: empty list"

ghci> head []
*** Exception: head: empty list
CallStack (from implicit params):
  error, called at ...


1. We add the `freezeCallStack` and `emptyCallStack` and update the
   definition of `CallStack` to support this functionality.

2. We add `errorWithoutStackTrace`, a variant of `error` that does not
   produce a stack trace, using this feature. I think this is a sensible
   wrapper function to provide in case users want it.

3. We replace uses of `error` in base with `errorWithoutStackTrace`. The
   rationale is that base does not export any functions that use CallStacks
   (except for `error` and `undefined`) so there's no way for the stack
   traces (from Implicit CallStacks) to include user-defined functions.
   They'll only contain the call to `error` itself. As base already has a
   good habit of providing useful error messages that name the triggering
   function, the stack trace really just adds noise to the error. (I don't
   have a strong opinion on whether we should include this third commit,
   but the change was very mechanical so I thought I'd include it anyway in
   case there's interest)

4. Updates tests in `array` and `stm` submodules

Test Plan: ./validate, new test is T11049

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

Reviewed By: simonpj

Subscribers: thomie

Projects: #ghc

Differential Revision:

GHC Trac Issues: #11049

3 years agoFix ASSERT in buildPatSyn, and T10897 test
Simon Peyton Jones [Wed, 23 Dec 2015 10:13:26 +0000 (10:13 +0000)] 
Fix ASSERT in buildPatSyn, and T10897 test

This closes Trac #10897

3 years agoComments only
Simon Peyton Jones [Wed, 23 Dec 2015 10:11:56 +0000 (10:11 +0000)] 
Comments only

3 years agoFix super-class cycle check
Simon Peyton Jones [Wed, 23 Dec 2015 10:11:11 +0000 (10:11 +0000)] 
Fix super-class cycle check

Fixes Trac #11278

3 years ago- fix gc_thread related compilation failure on Solaris/i386 platform
Karel Gardas [Tue, 22 Dec 2015 21:53:00 +0000 (22:53 +0100)] 
- fix gc_thread related compilation failure on Solaris/i386 platform

This patch fixes gc_thread related compilation failure
on Solaris/i386 platform. It uses Linux way of __thread declared
gc_thread variable for register starving i386 from now.

Reviewers: bgamari, austin, erikd

Subscribers: thomie

Differential Revision:

3 years agoDelete incorrect *-ws-32 expected test output
Erik de Castro Lopo [Wed, 23 Dec 2015 09:23:24 +0000 (20:23 +1100)] 
Delete incorrect *-ws-32 expected test output

The *-ws-32 file were too difficult to keep up-to-date so @bgamari
updated the test outut normalization code in commit 786d528e8f949d
to make these files un-necessary.

Test Plan: test on PowerPC

Reviewers: hvr, austin, bgamari

Reviewed By: bgamari

Subscribers: thomie, bgamari

Differential Revision:

3 years agoModify Nmax to maxN Trac #10728
MarcelineVQ [Wed, 23 Dec 2015 00:23:33 +0000 (01:23 +0100)] 
Modify Nmax to maxN Trac #10728

Added test and changed -Nmax to -maxN, -n was taken

Noticed strange -m behavoir and fixed -m from quietly
ignoring being passed invalid opts, e.g. "-msasd"

Reviewers: simonmar, hvr, austin, thomie, bgamari

Reviewed By: hvr, thomie, bgamari

Subscribers: bgamari, hvr, thomie, simonmar

Differential Revision:

GHC Trac Issues: #10728

3 years agoTest Trac #11274
Simon Peyton Jones [Tue, 22 Dec 2015 15:49:24 +0000 (15:49 +0000)] 
Test Trac #11274

3 years agoTidy up and comment wildcards in family instances
Simon Peyton Jones [Tue, 22 Dec 2015 09:08:28 +0000 (09:08 +0000)] 
Tidy up and comment wildcards in family instances

I found it was possible to do this a bit more nicely
See Note [Family instance declaration binders] in HsDecls, and
    Note [Wildcards in family instances] in RnSource

3 years agoComments only
Simon Peyton Jones [Tue, 22 Dec 2015 09:06:47 +0000 (09:06 +0000)] 
Comments only