4 years agoAdd NOINLINE for hs-boot functions
Simon Peyton Jones [Mon, 20 Jul 2015 15:18:05 +0000 (16:18 +0100)] 
Add NOINLINE for hs-boot functions

This fixes Trac #10083.

The key change is in TcBinds.tcValBinds, where we construct
the prag_fn.  With this patch we add a NOINLINE pragma for
any functions that were exported by the hs-boot file for this

See Note [Inlining and hs-boot files], and #10083, for details.

The commit touches several other files becuase I also changed the
representation of the "pragma function" from a function TcPragFun
to an environment, TcPragEnv. This makes it easer to extend
during construction.

4 years agoRefactor self-boot info
Simon Peyton Jones [Mon, 20 Jul 2015 14:38:12 +0000 (15:38 +0100)] 
Refactor self-boot info

This patch is a simple refactoring that prepares for a later one,
related to Trac #10083.

* Add a field tcg_self_boot :: SelfBootInfo to TcGblEnv,
  where SelfBootInfo is a new data type, describing the
  hi-boot file, if any, for the module being compiled.

* Make tcHiBootIface return SelfBootInfo, a new data type

* Make other functions get SelfBootInfo from the monad.

* Remove tcg_mod_name from TcGblEnv; it was barely used and
  simpler to pass around explicitly.

4 years agoComments and white space only
Simon Peyton Jones [Mon, 20 Jul 2015 13:40:20 +0000 (14:40 +0100)] 
Comments and white space only

4 years agoImprove strictness analysis for exceptions
Simon Peyton Jones [Tue, 21 Jul 2015 11:28:42 +0000 (12:28 +0100)] 
Improve strictness analysis for exceptions

Two things here:

* For exceptions-catching primops like catch#, we know
  that the main argument function will be called, so
  we can use strictApply1Dmd, rather than lazy

  Changes in primops.txt.pp

* When a 'case' scrutinises a I/O-performing primop,
  the Note [IO hack in the demand analyser] was
  throwing away all strictness from the code that

  I found that this was causing quite a bit of unnecessary
  reboxing in the (heavily used) function

  So this patch prevents the hack applying when the
  case scrutinises a primop.  See the revised
  Note [IO hack in the demand analyser]

Thse two things buy us quite a lot in programs that do a lot of IO.

        Program           Size    Allocs   Runtime   Elapsed  TotalMem
            hpg          -0.4%     -2.9%     -0.9%     -1.0%     +0.0%
reverse-complem          -0.4%    -10.9%    +10.7%    +10.9%     +0.0%
         simple          -0.3%     -0.0%    +26.2%    +26.2%     +3.7%
         sphere          -0.3%     -6.3%      0.09      0.09     +0.0%
            Min          -0.7%    -10.9%     -4.6%     -4.7%     -1.7%
            Max          -0.2%     +0.0%    +26.2%    +26.2%     +6.5%
 Geometric Mean          -0.4%     -0.3%     +2.1%     +2.1%     +0.1%

I think the increase in runtime for 'simple' is measurement error.

4 years agoRefactor newSCWorkFromFlavoured
Simon Peyton Jones [Mon, 20 Jul 2015 22:39:44 +0000 (23:39 +0100)] 
Refactor newSCWorkFromFlavoured

No change in behaviour is intended here

4 years agoComments only (superclasses and improvement)
Simon Peyton Jones [Mon, 20 Jul 2015 22:37:42 +0000 (23:37 +0100)] 
Comments only (superclasses and improvement)

4 years agoUse varToCoreExpr in mkWWcpr_help
Simon Peyton Jones [Mon, 20 Jul 2015 22:34:31 +0000 (23:34 +0100)] 
Use varToCoreExpr in mkWWcpr_help

Lacking this cuased Trac #10658.
The fix is easy; it was a simple omission.

4 years agoDelete __GLASGOW_HASKELL__ ifdefs for stage0 < 7.8
Thomas Miedema [Tue, 21 Jul 2015 11:02:29 +0000 (13:02 +0200)] 
Delete __GLASGOW_HASKELL__ ifdefs for stage0 < 7.8

Reviewers: austin, goldfire, bgamari

Reviewed By: bgamari

Subscribers: bgamari, thomie

Differential Revision:

4 years agoprimops: Fix spelling mistake
Ben Gamari [Tue, 21 Jul 2015 10:27:28 +0000 (12:27 +0200)] 
primops: Fix spelling mistake

4 years agoRevert "Revert "Support for multiple signature files in scope.""
Edward Z. Yang [Tue, 21 Jul 2015 03:16:40 +0000 (20:16 -0700)] 
Revert "Revert "Support for multiple signature files in scope.""

This reverts commit bac927b9770ff769128b66d13a3e72bf5a9bc514.

As it turns out, we need these commits for separate compilation
and accurate dependency tracking.  So back in they go!

4 years agoRevert "Revert "Change loadSrcInterface to return a list of ModIface""
Edward Z. Yang [Tue, 21 Jul 2015 03:16:35 +0000 (20:16 -0700)] 
Revert "Revert "Change loadSrcInterface to return a list of ModIface""

This reverts commit c60704fc405149407c155e297433f1cc299ae58a.

4 years agoUpdate submodule hpc with fix for #10529
Thomas Miedema [Thu, 16 Jul 2015 15:40:50 +0000 (17:40 +0200)] 
Update submodule hpc with fix for #10529

4 years agoTestsuite: simplify T8089 (#8089)
Thomas Miedema [Thu, 16 Jul 2015 18:16:17 +0000 (20:16 +0200)] 
Testsuite: simplify T8089 (#8089)

The previous implementation wasn't working for the `ghci` test way,
causing a fulltest failure.

Differential Revision:

4 years agoTestsuite: mark concprog002 expect_broken_for(#10661, ['threaded2_hT'])
Thomas Miedema [Sun, 19 Jul 2015 19:43:55 +0000 (21:43 +0200)] 
Testsuite: mark concprog002 expect_broken_for(#10661, ['threaded2_hT'])

4 years agoTestsuite: fix concprog002 (AMP)
Thomas Miedema [Sun, 19 Jul 2015 17:44:56 +0000 (19:44 +0200)] 
Testsuite: fix concprog002 (AMP)

Requires random to be installed.

4 years agoFix primops documentation syntax
Ben Gamari [Mon, 20 Jul 2015 16:39:54 +0000 (12:39 -0400)] 
Fix primops documentation syntax

4 years agoDo not treat prim and javascript imports as C imports in TH and QQ
Luite Stegeman [Mon, 20 Jul 2015 15:01:06 +0000 (17:01 +0200)] 
Do not treat prim and javascript imports as C imports in TH and QQ

Reviewers: austin, hvr, goldfire, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #10638

4 years agoprimops: Add haddocks to BCO primops
Ben Gamari [Mon, 20 Jul 2015 14:45:01 +0000 (16:45 +0200)] 
primops: Add haddocks to BCO primops

Test Plan: none

Reviewers: simonmar, austin, hvr

Subscribers: hvr, thomie

Differential Revision:

GHC Trac Issues: #10640

4 years agoSupport wild cards in TH splices
Thomas Winant [Mon, 20 Jul 2015 13:43:53 +0000 (15:43 +0200)] 
Support wild cards in TH splices

- Declaration splices: partial type signatures are fully supported in TH
  declaration splices.

  For example, the wild cards in the example below will unify with `Eq
  and `a -> a -> Bool`, as expected:

[d| foo :: _ => _
    foo x y = x == y |]

- Expression splices: anonymous and named wild cards are supported in
  expression signatures, but extra-constraints wild cards aren't. Just
  as is the case for regular expression signatures.

[e | Just True :: _a _ |]

- Typed expression splices: the same wildcards as in (untyped)
  expression splices are supported.

- Pattern splices: TH doesn't support type signatures in pattern
  splices, consequently, partial type signatures aren't supported

- Type splices: partial type signatures are only partially supported in
  type splices, specifically: only anonymous wild cards are allowed.

  So `[t| _ |]`, `[t| _ -> Maybe _ |]` will work, but `[t| _ => _ |]` or
  `[| _a |]` won't (without `-XNamedWildCards`, the latter will work as
  the named wild card is treated as a type variable).

  Normally, named wild cards are collected before renaming a (partial)
  type signature. However, TH type splices are run during renaming, i.e.
  after the initial traversal, leading to out of scope errors for named
  wild cards. We can't just extend the initial traversal to collect the
  named wild cards in TH type splices, as we'd need to expand them,
  which is supposed to happen only once, during renaming.

  Similarly, the extra-constraints wild card is handled right before
  renaming too, and is therefore also not supported in a TH type splice.
  Another reason not to support extra-constraints wild cards in TH type
  splices is that a single signature can contain many TH type splices,
  whereas it mustn't contain more than one extra-constraints wild card.
  Enforcing would this be hard the way things are currently organised.

  Anonymous wild cards pose no problem, because they start without names
  and are given names during renaming. These names are collected right
  after renaming. The names generated for anonymous wild cards in TH
  type splices will thus be collected as well.

  With a more invasive refactoring of the renaming, partial type
  signatures could be fully supported in TH type splices. As only
  anonymous wild cards have been requested so far, these small changes
  satisfying this request will do for now. Also don't forget that a TH
  declaration splices support all kinds of wild cards.

- Extra-constraints wild cards were silently ignored in expression and
  pattern signatures, appropriate error messages are now generated.

Test Plan: run new tests

Reviewers: austin, goldfire, adamgundry, bgamari

Reviewed By: goldfire, adamgundry, bgamari

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #10094, #10548

4 years agoLlvmCodeGen: add support for MO_U_Mul2 CallishMachOp
Michal Terepeta [Mon, 20 Jul 2015 13:43:31 +0000 (15:43 +0200)] 
LlvmCodeGen: add support for MO_U_Mul2 CallishMachOp

This adds support MO_U_Mul2 to the LLVM backend by simply using 'mul'
instruction but operating at twice the bit width (e.g., for 64 bit
words we will generate mul that operates on 128 bits and then extract
the two 64 bit values for the result of the CallishMachOp).

Test Plan: validate

Reviewers: rwbarton, austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #9430

4 years agoTestsuite: add regression test for missing class constraint
Thomas Miedema [Mon, 20 Jul 2015 13:40:59 +0000 (15:40 +0200)] 
Testsuite: add regression test for missing class constraint

The following program is accepted by ghc-7.0 to ghc-7.10, but rejected
by ghc-6.12.3 and HEAD (and rightfully so):

    class Class1 a
    class Class1 a => Class2 a
    class Class2 a => Class3 a
    instance Class3 a => Class2 a

The last line is missing a `Class1 a` constraint. Add a regression test
for this (typechecker/should_fail/tcfail223).

Add similar missing class constraints to T7126 and T5751. I verified
that the these changes don't interfer with the intention of the tests
(they still result in a loop with ghc-7.4.1).

Reviewers: austin, simonpj, bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie

Differential Revision:

4 years agoTestsuite: add -XUndecidableInstances to T3500a
Thomas Miedema [Mon, 20 Jul 2015 13:40:26 +0000 (15:40 +0200)] 
Testsuite: add -XUndecidableInstances to T3500a

This makes the test pass again with HEAD (7.11), instead of resulting

  T3500a.hs:11:10: error:
      The constraint ‘C (F a)’ is no smaller than the instance head
      (Use UndecidableInstances to permit this)
      In the instance declaration for ‘C (a, b)’

Test Plan: I verified that ghc-6.12.3's typechecker still loops on this

Reviewers: austin, bgamari, simonpj

Reviewed By: simonpj

Subscribers: thomie

Differential Revision:

4 years agoTestsuite: add ImpredicativeTypes to T7861 (#7861)
Thomas Miedema [Mon, 20 Jul 2015 13:39:52 +0000 (15:39 +0200)] 
Testsuite: add ImpredicativeTypes to T7861 (#7861)

The test was failing with:

    T7861: T7861.hs:15:13:
        Cannot instantiate unification variable ‘t0’
        with a type involving foralls: A a0 -> a0
          GHC doesn't yet support impredicative polymorphism
        In the first argument of ‘seq’, namely ‘f’
        In a stmt of a 'do' block: f `seq` print "Hello 2"

It requires ImpredicativeTypes, at least since 7.8, because we
instantiate seq's type (c->d->d) with f's type (c:= (forall b. a) -> a),
which is polymorphic (it has foralls).

I simplified the test a bit by removing the type synonym, and verified
that ghc-7.6.3 still panics on this test.

Reviewers: simonpj, austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #7861

4 years agoAdd regression test for unused implicit parameter warning (#10632)
Reid Barton [Mon, 20 Jul 2015 02:36:08 +0000 (22:36 -0400)] 
Add regression test for unused implicit parameter warning (#10632)

4 years agoTestsuite: mark array001 and conc034 expect_broken_for(#10659, ['optasm',...])
Thomas Miedema [Sat, 18 Jul 2015 20:19:01 +0000 (22:19 +0200)] 
Testsuite: mark array001 and conc034 expect_broken_for(#10659, ['optasm',...])

Update submodule array.

4 years agoTestsuite: mark gadt/termination expect_broken_for(#10658, ['optasm','optllvm'])
Thomas Miedema [Sat, 18 Jul 2015 19:28:10 +0000 (21:28 +0200)] 
Testsuite: mark gadt/termination expect_broken_for(#10658, ['optasm','optllvm'])

4 years agoTestsuite: mark qq007 and qq008 expect_broken(#10047)
Thomas Miedema [Sat, 18 Jul 2015 18:55:24 +0000 (20:55 +0200)] 
Testsuite: mark qq007 and qq008 expect_broken(#10047)

This fixes the wrong ticket number in
16a87397295fa92bcbe7a2c6277f938622b93969 (#10181).

4 years agoTestsuite: mark qq007 and qq008 expect_broken(#10181)
Thomas Miedema [Sat, 18 Jul 2015 18:45:14 +0000 (20:45 +0200)] 
Testsuite: mark qq007 and qq008 expect_broken(#10181)

4 years agoTestsuite: mark 3 tests expect_broken_for(#10181, ['optasm', 'optllvm'])
Thomas Miedema [Sat, 18 Jul 2015 18:38:57 +0000 (20:38 +0200)] 
Testsuite: mark 3 tests expect_broken_for(#10181, ['optasm', 'optllvm'])

4 years agoTestsuite: mark T7919 expect_broken_for(#7919, ['optasm','dyn','optllvm'])
Thomas Miedema [Sat, 18 Jul 2015 17:25:37 +0000 (19:25 +0200)] 
Testsuite: mark T7919 expect_broken_for(#7919, ['optasm','dyn','optllvm'])

It fails with a segmentation fault. Occasionally also for WAY=threaded2.

4 years agoTestsuite: mark T2497 expect_broken_for(#10657, ['optasm', 'optllvm'])
Thomas Miedema [Sat, 18 Jul 2015 17:01:13 +0000 (19:01 +0200)] 
Testsuite: mark T2497 expect_broken_for(#10657, ['optasm', 'optllvm'])

4 years agoBuild system: fail when encountering an unknown package tag
Thomas Miedema [Wed, 15 Jul 2015 09:05:57 +0000 (11:05 +0200)] 
Build system: fail when encountering an unknown package tag

4 years agoTestsuite: accept new stderr for T9497{a,b,c}-run (#10224)
Thomas Miedema [Thu, 16 Jul 2015 08:42:22 +0000 (10:42 +0200)] 
Testsuite: accept new stderr for T9497{a,b,c}-run (#10224)

4 years agoTestsuite: small test cleanups
Thomas Miedema [Thu, 16 Jul 2015 15:41:56 +0000 (17:41 +0200)] 
Testsuite: small test cleanups

* don't print anything to stdout
* add missing Makefile
* also ignore mk/ghcconfig*.mk when using installed compiler
* prevent warning: -rtsopts and -with-rtsopts have no effect with -shared

4 years agoTravis: actually do debug builds
Thomas Miedema [Fri, 17 Jul 2015 09:34:46 +0000 (11:34 +0200)] 
Travis: actually do debug builds

4 years agoUpdate assert to fix retc001 and retc002 (#9243)
Thomas Miedema [Fri, 17 Jul 2015 09:42:24 +0000 (11:42 +0200)] 
Update assert to fix retc001 and retc002 (#9243)

Since 2223e196b2dc5340d70e58be011c279d381b4319, maybe_old_linkable can
be Nothing even with an up-to-date interface file. This happens when
compiling with --make -fno-code -fwrite-interface.

See also Note [Recompilation checking when typechecking only] in

This fixes retc001 and retc002 when ghc_debugged.

Differential Revision:

4 years agoReduce non-determinism in ABI hashes with RULES and instance decls
Bartosz Nitka [Fri, 17 Jul 2015 15:50:52 +0000 (16:50 +0100)] 
Reduce non-determinism in ABI hashes with RULES and instance decls

Before this change the `RULES` would be attached to one for the names from
the module that appear on the left hand side. The choice depended on the
`uniq` that was generated, which are known to be non-deterministic (a
separate, bigger problem). Now we use `OccName`s which should be stable.

Analogously for instance declarations, but they are attached to one of
the types involved.

Test Plan:
it made `Data.Text.Internal.Fusion.Common` interface stable, previously
stream fusion rule would be attached either to `streamList` or
`unstreamList` depending on if the module was compiled after `cabal
clean` or after `find | grep '\.o$' | xargs rm`.

Reviewers: simonpj, austin, bgamari, simonmar

Subscribers: puffnfresh, thomie

Differential Revision:

GHC Trac Issues: #4012

4 years agoFix off-by-one error in GHCi line reporting (Trac #10578)
Ömer Sinan Ağacan [Thu, 16 Jul 2015 22:06:28 +0000 (00:06 +0200)] 
Fix off-by-one error in GHCi line reporting (Trac #10578)

Test Plan: I couldn't add tests because apparently line number
reporting was already working correctly when loading script files. I
don't know how to test by running commands using stdin, is this

Reviewers: austin, thomie, bgamari

Reviewed By: thomie, bgamari

Subscribers: hvr, thomie

Differential Revision:

4 years agoHandle Char#, Addr# in TH quasiquoter (fixes #10620)
RyanGlScott [Thu, 16 Jul 2015 22:05:14 +0000 (00:05 +0200)] 
Handle Char#, Addr# in TH quasiquoter (fixes #10620)

DsMeta does not attempt to handle quasiquoted Char# or Addr# values,
which causes expressions like `$([| 'a'# |])` or `$([| "abc"# |])` to
with an `Exotic literal not (yet) handled by Template Haskell` error.

To fix this, the API of `template-haskell` had to be changed so that
now has an extra constructor `CharPrimL` (a `StringPrimL` constructor
existed, but it wasn't used). In addition, `DsMeta` has to manipulate
`CoreExpr`s directly that involve `Word8`s. In order to do this,
`Word8` had
to be added as a wired-in type to `TysWiredIn`.

Actually converting from `HsCharPrim` and `HsStringPrim` to `CharPrimL`
`StringPrimL`, respectively, is pretty straightforward after that, since
both `HsCharPrim` and `CharPrimL` use `Char` internally, and
uses a `ByteString` internally, which can easily be converted to
which is what `StringPrimL` uses.

Reviewers: goldfire, austin, simonpj, bgamari

Reviewed By: simonpj, bgamari

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #10620

4 years agoDeriveFoldable for data types with existential constraints (#10447)
RyanGlScott [Thu, 16 Jul 2015 22:04:24 +0000 (00:04 +0200)] 
DeriveFoldable for data types with existential constraints (#10447)

Reviewers: dolio, shachaf, ekmett, austin, #core_libraries_committee,
simonpj, bgamari

Reviewed By: simonpj, bgamari

Subscribers: thomie, bgamari

Differential Revision:

GHC Trac Issues: #10447

4 years agoPut Opt_Static into defaultFlags if not pc_DYNAMIC_BY_DEFAULT (#7478)
Bernhard Herzog [Thu, 16 Jul 2015 22:04:05 +0000 (00:04 +0200)] 
Put Opt_Static into defaultFlags if not pc_DYNAMIC_BY_DEFAULT (#7478)

The test for Trac issue #7478 fails on some systems due to
inconsistent default flags for dynamic vs. static linking.

Test Plan: validate

Reviewers: austin, thomie

Reviewed By: thomie

Subscribers: thomie, bgamari

Differential Revision:

GHC Trac Issues: #7478

4 years agoImplement -fprint-expanded-synonyms
Ömer Sinan Ağacan [Thu, 16 Jul 2015 22:02:09 +0000 (00:02 +0200)] 
Implement -fprint-expanded-synonyms

Add a flag to print type-synonyms-expanded versions of types in type
error messages (in addition to old error messages with synonyms)

 * Mailing list discussion:
 * Wiki page:
 * Trac:

Test Plan:
 * I'll find some examples and add tests.

Reviewers: austin, simonpj, goldfire, bgamari

Reviewed By: austin, simonpj, goldfire, bgamari

Subscribers: rodlogic, thomie, bgamari

Differential Revision:

GHC Trac Issues: #10547

4 years agoFix tests
Ben Gamari [Fri, 10 Jul 2015 11:48:24 +0000 (13:48 +0200)] 
Fix tests

4 years agoCoreLint: Use size-annotated ppr variant
Ben Gamari [Mon, 22 Jun 2015 10:48:07 +0000 (12:48 +0200)] 
CoreLint: Use size-annotated ppr variant

4 years agoPprCore: Add size annotations for top-level bindings
Ben Gamari [Mon, 22 Jun 2015 10:47:33 +0000 (12:47 +0200)] 
PprCore: Add size annotations for top-level bindings

4 years agoCoreUtils: Move size utilities to CoreStats
Ben Gamari [Mon, 22 Jun 2015 10:35:02 +0000 (12:35 +0200)] 
CoreUtils: Move size utilities to CoreStats

This allows PprCore to use these functions. It will soon do so to enable
CoreLint to output size annotations on top-level bindings.

4 years agoCoreUtils: Move seq* functions to CoreSeq
Ben Gamari [Tue, 7 Jul 2015 18:25:50 +0000 (20:25 +0200)] 
CoreUtils: Move seq* functions to CoreSeq

These seem to sit near the top of the import graph and have been causing
import cycles.

4 years agoFailing test case: idArity invariant check, #10181
Joachim Breitner [Thu, 16 Jul 2015 13:57:42 +0000 (15:57 +0200)] 
Failing test case: idArity invariant check, #10181

This was found Thomas Miedema.

4 years agoDocs: `sortOn = sortBy (comparing f)` [skip ci]
Thomas Miedema [Thu, 16 Jul 2015 08:10:18 +0000 (10:10 +0200)] 
Docs: `sortOn = sortBy (comparing f)` [skip ci]

4 years agoinitGroup: only initialize the first and last blocks of a group
Simon Marlow [Wed, 15 Jul 2015 11:57:18 +0000 (12:57 +0100)] 
initGroup: only initialize the first and last blocks of a group

Summary: Initialising the whole group is expensive and unnecessary.

Test Plan: validate

Reviewers: austin, bgamari, rwbarton

Subscribers: thomie

Differential Revision:

4 years agoFix #10642.
Richard Eisenberg [Wed, 15 Jul 2015 13:50:57 +0000 (09:50 -0400)] 
Fix #10642.

Representational equalities cannot discharge nominal ones.
Even if, somehow, this didn't cause a type error (as reported
in the ticket), it would surely cause a core lint error.

4 years agoDon't get a new nursery if we exceeded large_alloc_lim
Simon Marlow [Wed, 15 Jul 2015 12:07:35 +0000 (13:07 +0100)] 
Don't get a new nursery if we exceeded large_alloc_lim

When using nursery chunks, if we failed a heap check due to
large_alloc_lim, we would pointlessly keep grabbing new nursery
chunks when we should just GC immediately.

Test Plan: validate

Reviewers: austin, bgamari, niteria

Subscribers: thomie

Differential Revision:

4 years agoRemove all references to sync-all
Thomas Miedema [Tue, 14 Jul 2015 15:15:12 +0000 (17:15 +0200)] 
Remove all references to sync-all

4 years agoBuild system: delete [skip ci]
Thomas Miedema [Wed, 15 Jul 2015 08:18:37 +0000 (10:18 +0200)] 
Build system: delete [skip ci]

fingerprint makes no sense anymore w/ submodules.

4 years agoTestsuite: mark T10294 conditionally expect_broken on #10301
Thomas Miedema [Wed, 15 Jul 2015 11:27:59 +0000 (13:27 +0200)] 
Testsuite: mark T10294 conditionally expect_broken on #10301

Fix 8e6a50339a4a61d4f2cbec645c78abc85098a294.

4 years agoMark test case for #10294 conditionally expect_broken on #10301
Joachim Breitner [Wed, 15 Jul 2015 08:41:03 +0000 (10:41 +0200)] 
Mark test case for #10294 conditionally expect_broken on #10301

the hypothesis is that it only breaks with `DYNAMIC_GHC_PROGRAMS = NO`,
so use `unless(have_dynamic(),expect_broken(10301))` to not break the
Phabricator build.

4 years agoFlush stdout in test case for #10596
Joachim Breitner [Wed, 15 Jul 2015 08:29:26 +0000 (10:29 +0200)] 
Flush stdout in test case for #10596

which might help, as it has helped with lots of other TH-related test
cases in the past.

4 years agoMark test case for #10294 expect_broken on #10301
Joachim Breitner [Wed, 15 Jul 2015 08:26:05 +0000 (10:26 +0200)] 
Mark test case for #10294 expect_broken on #10301

as it is broken on Travis, and in #10301 others have reported the same

4 years agoTestsuite: delete *.stderr-ghc-7.0 *.stdout-ghc-7.0
Thomas Miedema [Tue, 14 Jul 2015 11:57:29 +0000 (13:57 +0200)] 
Testsuite: delete *.stderr-ghc-7.0 *.stdout-ghc-7.0

No point in pretending the testsuite can be run with older versions of GHC.

4 years agoTestsuite: rename *.stderr-ghc to *.stderr
Thomas Miedema [Tue, 14 Jul 2015 11:37:55 +0000 (13:37 +0200)] 
Testsuite: rename *.stderr-ghc to *.stderr

And *.stdout-ghc to *.stdout. We only have output files for ghc now.

4 years agotraivs: Use the new container based travis setup
Joachim Breitner [Tue, 14 Jul 2015 07:54:28 +0000 (09:54 +0200)] 
traivs: Use the new container based travis setup

which supposedly has more resources, so maybe this makes travis useful
for us again.

4 years agoTestsuite: delete remaining only_compiler_types(['ghc']) setups
Thomas Miedema [Mon, 13 Jul 2015 10:18:10 +0000 (12:18 +0200)] 
Testsuite: delete remaining only_compiler_types(['ghc']) setups

No point in pretending other compilers can use the GHC testsuite. This
makes the *.T files a bit shorter.

4 years agoTestsuite: delete unused with_namebase
Thomas Miedema [Mon, 13 Jul 2015 09:30:37 +0000 (11:30 +0200)] 
Testsuite: delete unused with_namebase

It was introduced in 39c6c735c216d259854ee31b15ec87ea653f2b5d (2007).

4 years agoBuild system: do not build stm and parallel by default
Thomas Miedema [Fri, 10 Jul 2015 17:15:49 +0000 (19:15 +0200)] 
Build system: do not build stm and parallel by default

stm and parallel have an 'extra' tag in the ./packages file, so would get
added to PACKAGES_STAGE2 by default, and subsequently build by the stage2

With this patch, this happens only when you set BUILD_EXTRA_PKGS=YES in A normal validate still builds (and tests) the 'extra'
packages, but they are skipped for `validate --fast`. Maybe this brings
us closer to finishing within the 50 minute Travis limit as well.

We can later try to give random, primitive and vector an 'extra' tag as
well (now they have a 'dph' tag), but some tests will probably fail at

Differential Revision:

4 years agoBuild system: delete REGULAR_INSTALL_DYNLIBS and INSTALL_DYNLIBS
Thomas Miedema [Thu, 9 Jul 2015 17:21:28 +0000 (19:21 +0200)] 

Ever since we ship xhtml, terminfo and haskeline (#8919), commit
4caadb7cbee5c176abb99df25c4cc1657ae57f40, REGULAR_INSTALL_DYNLIBS is
always empty.



So we can delete it, and all the places where it is used. This
simplifies a bit.

Differential Revision:

4 years agoBuild system: delete two unused files
Thomas Miedema [Mon, 13 Jul 2015 09:34:17 +0000 (11:34 +0200)] 
Build system: delete two unused files

They were introduced in 6ae696a1d1f25bf52923a3dd1c3b4a08e2033bfd. We do
cross-compilation differently now.

4 years agoBuild system: add `make show!` command (#7810)
Thomas Miedema [Fri, 10 Jul 2015 16:38:02 +0000 (18:38 +0200)] 
Build system: add `make show!` command (#7810)

A normal `make show` starts a build of the ghc-stage1 compiler, to
create files. This version doesn't read those, so it
will work right after ./configure.

Differential Revision:

4 years agoBuild system: comments only [skip ci]
Thomas Miedema [Thu, 9 Jul 2015 17:27:17 +0000 (19:27 +0200)] 
Build system: comments only [skip ci]

4 years agoAnother comment with a leading # (sigh)
Simon Peyton Jones [Mon, 13 Jul 2015 12:30:47 +0000 (13:30 +0100)] 
Another comment with a leading # (sigh)

4 years agoTest Trac #10634
Simon Peyton Jones [Mon, 13 Jul 2015 12:28:27 +0000 (13:28 +0100)] 
Test Trac #10634

4 years agoTest Trac #10463
Simon Peyton Jones [Mon, 13 Jul 2015 12:20:56 +0000 (13:20 +0100)] 
Test Trac #10463

was fixed along with Trac #10224

4 years agoReformat a leading # in a comment
Simon Peyton Jones [Mon, 13 Jul 2015 12:08:44 +0000 (13:08 +0100)] 
Reformat a leading # in a comment

The leading hash in a comment confused CPP, though
it worked fine on my machine. Apologies.

4 years agoMake sure rule LHSs are simplified
Simon Peyton Jones [Mon, 13 Jul 2015 11:58:34 +0000 (12:58 +0100)] 
Make sure rule LHSs are simplified

SpecConstr was generating a rule LHS with nested casts,
which the simplifier then optimised away.  Result: unbound
template variables.

Easily fixed.  See Note [SpecConstr call patterns]

4 years agoAdd Linting for Rules
Simon Peyton Jones [Mon, 13 Jul 2015 09:40:44 +0000 (10:40 +0100)] 
Add Linting for Rules

4 years agoDo not optimise RULE lhs in substRule
Simon Peyton Jones [Mon, 13 Jul 2015 09:29:18 +0000 (10:29 +0100)] 
Do not optimise RULE lhs in substRule

This was causing Trac #10627.
See Note [Substitute lazily] in CoreSubst.

The bug was introduced by
   commit 30c17e7096919c55218083c8fcb98e6287552058
    Author: <unknown>
    Date:   Thu Nov 25 17:23:56 2010 +0000
    Substitution should just substitute, not optimise

The fix is not to optimise the RHS as well as not-optimising the LHS!
The simplifier does the right thing in Simplify.simplRule

4 years agoT9872d: Update 32-bit allocations
Ben Gamari [Sat, 11 Jul 2015 11:07:34 +0000 (13:07 +0200)] 
T9872d: Update 32-bit allocations

4 years agoperf/compiler: Switch to -G1 and update performance metrics
Ben Gamari [Sat, 11 Jul 2015 10:53:40 +0000 (10:53 +0000)] 
perf/compiler: Switch to -G1 and update performance metrics

4 years agoT876 (32-bit): Update bytes allocated
Ben Gamari [Sat, 11 Jul 2015 10:42:14 +0000 (12:42 +0200)] 
T876 (32-bit): Update bytes allocated

This seems to have improved by a bit

4 years agoT1969: Update max_bytes_used
Ben Gamari [Sat, 11 Jul 2015 10:27:20 +0000 (12:27 +0200)] 
T1969: Update max_bytes_used

b5e1944e2b069a7df3444e57bae0b4ee15bde73c started using a single GC
generation yet didn't update this.

4 years agoFix self-contained handling of ASCII encoding
Ben Gamari [Fri, 10 Jul 2015 17:49:29 +0000 (19:49 +0200)] 
Fix self-contained handling of ASCII encoding

D898 was primarily intended to fix hangs in the event that iconv was
unavailable (namely #10298 and #7695). In addition to this fix, it also
introduced self-contained handling of ANSI terminals to allow compiled
executables to run in minimal environments lacking iconv.

However, the behavior that the patch introduced is highly suspicious.
Specifically, it gives the user a UTF-8 encoding even if they requested

This has the potential to break quite a lot of code. At very least it
breaks GHC's Unicode terminal detection logic, which attempts to catch
an invalid character when encoding a pair of smart-quotes. Of course,
this exception will never be thrown if a UTF-8 encoder is used.

Here we use the `char8` encoding to handle requests for ASCII encodings
in the event that we find iconv to be non-functional.

Fixes #10623.

Test Plan: Validate with T8959a

Reviewers: rwbarton, hvr, austin, hsyl20

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #10623

4 years agoDelete the WayPar way
Thomas Miedema [Wed, 8 Jul 2015 19:09:33 +0000 (21:09 +0200)] 
Delete the WayPar way

Also remove 't' and 's' from ALL_WAYS; they don't exist.

Differential Revision:

4 years agoImprove error message for fundeps
Simon Peyton Jones [Fri, 10 Jul 2015 15:24:46 +0000 (16:24 +0100)] 
Improve error message for fundeps

Improve error message fundeps, especially when PolyKinds means that
the un-determined variables are (invisible) kind variables.

See Trac #10570.

4 years agoUpdate .mailmap [skip ci]
Thomas Miedema [Fri, 10 Jul 2015 15:05:08 +0000 (17:05 +0200)] 
Update .mailmap [skip ci]

4 years agoBetter type wildcard errors
Simon Peyton Jones [Fri, 10 Jul 2015 11:53:53 +0000 (12:53 +0100)] 
Better type wildcard errors

Adopts sugggestion in Trac #10224, comment:3

4 years agoComments only
Simon Peyton Jones [Fri, 10 Jul 2015 11:52:50 +0000 (12:52 +0100)] 
Comments only

4 years agoMake mkQualPackage more robust when package key is bad.
Edward Z. Yang [Thu, 9 Jul 2015 17:21:51 +0000 (10:21 -0700)] 
Make mkQualPackage more robust when package key is bad.

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

Reviewers: bgamari, austin

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #10624

4 years agoAdd testcase for #10602
Ben Gamari [Thu, 9 Jul 2015 09:12:05 +0000 (05:12 -0400)] 
Add testcase for #10602

4 years agousers_guide: Fix errant "a" in RULES/class methods docs
Ben Gamari [Thu, 9 Jul 2015 12:08:20 +0000 (14:08 +0200)] 
users_guide: Fix errant "a" in RULES/class methods docs

4 years agoInfer types with flexible contexts
Simon Peyton Jones [Thu, 9 Jul 2015 12:03:34 +0000 (13:03 +0100)] 
Infer types with flexible contexts

Responding to Trac #10608 and Trac #10351, I've reverted
to making type inference infer structured constraint like
    f :: C [t] => t -> t
even if -XFlexibleContexts is not set.  That elicits an
error message suggesting the flag.  The result is more
helpful than the error message you get otherwise.

4 years agoWhite space only
Simon Peyton Jones [Thu, 9 Jul 2015 12:00:59 +0000 (13:00 +0100)] 
White space only

4 years agoDocument RULES and class methods
Simon Peyton Jones [Thu, 9 Jul 2015 11:46:58 +0000 (12:46 +0100)] 
Document RULES and class methods

Relates to Trac #10595

4 years agoBitmap: Fix thunk explosion
Ben Gamari [Thu, 9 Jul 2015 00:08:01 +0000 (02:08 +0200)] 
Bitmap: Fix thunk explosion

Previously we would build up another `map (-N)` thunk
for every word in the bitmap. Now we strictly accumulate the position
and carry out a single ``map (`subtract` accum)``.

`Bitmap.intsToBitmap` showed up in the profile while compiling a
testcase of #7450 (namely a program containing a record type with large
number of fields which derived `Read`). The culprit was
`CmmBuildInfoTables.procpointSRT.bitmap`. On the testcase (with 4096
fields), the profile previously looked like,

total time  =      307.94 secs   (307943 ticks @ 1000 us, 1
total alloc = 336,797,868,056 bytes  (excludes profiling

COST CENTRE              MODULE              %time %alloc

lintAnnots               CoreLint             17.2   25.8
procpointSRT.bitmap      CmmBuildInfoTables   11.3   25.2
FloatOutwards            SimplCore             7.5    1.6
flatten.lookup           CmmBuildInfoTables    4.0    3.9

After this fix it looks like,
total time  =      256.88 secs   (256876 ticks @ 1000 us, 1
total alloc = 255,033,667,448 bytes  (excludes profiling

COST CENTRE              MODULE              %time %alloc

lintAnnots               CoreLint             20.3   34.1
FloatOutwards            SimplCore             9.1    2.1
flatten.lookup           CmmBuildInfoTables    4.8    5.2
pprNativeCode            AsmCodeGen            3.7    4.3
simplLetUnfolding        Simplify              3.6    2.2
StgCmm                   HscMain               3.6    2.1

Signed-off-by: Ben Gamari <>
Test Plan: Validate

Reviewers: austin, simonpj

Reviewed By: simonpj

Subscribers: thomie

Differential Revision:

GHC Trac Issues: #7450

4 years agoFix Trac #10618 (out of scope operator)
Simon Peyton Jones [Wed, 8 Jul 2015 22:42:28 +0000 (23:42 +0100)] 
Fix Trac #10618 (out of scope operator)

Out of scope variables now generate HsUnboundVar,
and the fixity re-jigging wasn't taking this into

4 years agoComments only
Simon Peyton Jones [Wed, 8 Jul 2015 22:19:42 +0000 (23:19 +0100)] 
Comments only

4 years agoBroaden Outputable instance for Termination
Simon Peyton Jones [Thu, 2 Jul 2015 21:56:14 +0000 (22:56 +0100)] 
Broaden Outputable instance for Termination

4 years agoDelete duplicate "Note [Unpack equality predicates]"
Thomas Miedema [Wed, 8 Jul 2015 14:31:02 +0000 (16:31 +0200)] 
Delete duplicate "Note [Unpack equality predicates]"

The other one is MkId.hs.

4 years agoUnbreak Windows build: delete unusud throwIOIO
Thomas Miedema [Wed, 8 Jul 2015 13:30:30 +0000 (15:30 +0200)] 
Unbreak Windows build: delete unusud throwIOIO

Should have been part of 9aa0e4b23d074af44363236fb0f120f07c6e0067.

4 years agoholePackageKey and isHoleModule utility functions.
Edward Z. Yang [Tue, 23 Jun 2015 20:31:15 +0000 (13:31 -0700)] 
holePackageKey and isHoleModule utility functions.

Signed-off-by: Edward Z. Yang <>
4 years agoBackpack: Flesh out more Cabal details
Edward Z. Yang [Wed, 8 Jul 2015 02:49:32 +0000 (19:49 -0700)] 
Backpack: Flesh out more Cabal details

Signed-off-by: Edward Z. Yang <>
4 years agoExport more types from GHC.RTS.Flags (#9970)
RyanGlScott [Tue, 7 Jul 2015 19:20:07 +0000 (21:20 +0200)] 
Export more types from GHC.RTS.Flags (#9970)

Export the data types `GiveGCStats`, `DoCostCentres`, `DoHeapProfiles`,
and `DoTrace`, as well as the type synonyms `Time` and `RtsNat`. The
above data types appear as fields in the `-Stats` data types in
`GHC.RTS.Flags`, but since they only have `Show` instances, it is
practically impossible to due anything useful with the above types
unless they are exported.

Reviewers: hvr, ekmett, austin, ezyang, bgamari

Reviewed By: bgamari

Subscribers: thomie, bgamari

Differential Revision:

GHC Trac Issues: #9970