5 years agoTypos in comments
Gabor Greif [Fri, 23 May 2014 17:04:12 +0000 (19:04 +0200)] 
Typos in comments

5 years agoBump bytes-allocated for T3064
Simon Peyton Jones [Fri, 23 May 2014 08:41:27 +0000 (09:41 +0100)] 
Bump bytes-allocated for T3064

I'm not sure why this has increased, but it seems small

5 years agoWhite space only
Simon Peyton Jones [Fri, 23 May 2014 06:48:52 +0000 (07:48 +0100)] 
White space only

5 years agoMore debug info for failures in typeKind and kindFunResult
Simon Peyton Jones [Fri, 23 May 2014 06:48:40 +0000 (07:48 +0100)] 
More debug info for failures in typeKind and kindFunResult

5 years agoBetter pretty-printing for ClsInst
Simon Peyton Jones [Fri, 23 May 2014 06:48:06 +0000 (07:48 +0100)] 
Better pretty-printing for ClsInst

5 years agoMake the unifier a fixpoint even for the free kind vars of a tyvar
Simon Peyton Jones [Fri, 23 May 2014 06:47:17 +0000 (07:47 +0100)] 
Make the unifier a fixpoint even for the free kind vars of a tyvar

The (pure) unifier tcUnifyTys returns an idempotent substitution.
But previously the kinds of type variables free in the range of
the subst could have un-substituted kind variables.

This patch fixes that, fixing Trac #9106.

See Note [Finding the substitution fixpoint] in Unify

5 years agoSimple eta reduction in call to adjustMatchResults, just a tidy-up
Simon Peyton Jones [Mon, 19 May 2014 22:51:24 +0000 (23:51 +0100)] 
Simple eta reduction in call to adjustMatchResults, just a tidy-up

5 years agoTweaks to note; also fixed unicode quotes
Gabor Greif [Tue, 20 May 2014 09:04:54 +0000 (11:04 +0200)] 
Tweaks to note; also fixed unicode quotes

to regular ones.

5 years agoCoercible: Test case for now broken(?) corner case
Joachim Breitner [Tue, 20 May 2014 08:52:14 +0000 (10:52 +0200)] 
Coercible: Test case for now broken(?) corner case

involving a non-terminating newtype. This worked before 7e78faf03.
Probably not a problem, but still better to have a test case for it. See
ticket #9117.

5 years agoCoercible: Unwrap newtypes before coercing under tycons
Joachim Breitner [Tue, 20 May 2014 08:25:26 +0000 (10:25 +0200)] 
Coercible: Unwrap newtypes before coercing under tycons

This fixes parts of #9117.

5 years agoHarden imports in `DeriveConstants.hs` module
Herbert Valerio Riedel [Tue, 20 May 2014 07:40:36 +0000 (09:40 +0200)] 
Harden imports in `DeriveConstants.hs` module

This was generated by applying `-ddump-minimal-imports` and addresses
the current compile failure (see #9016) with GHC HEAD due to the new
`die` being exported by `System.Exit`

Signed-off-by: Herbert Valerio Riedel <>
5 years agoFix below warning by including "unistd.h" also
Gabor Greif [Mon, 19 May 2014 20:50:41 +0000 (22:50 +0200)] 
Fix below warning by including "unistd.h" also

exec_signals_prepare.c:26:5: warning: implicit declaration of function 'execv' is invalid in C99
    execv(argv[1], argv+1);
1 warning generated.

5 years agoCatch some typos
Gabor Greif [Mon, 19 May 2014 17:42:07 +0000 (19:42 +0200)] 
Catch some typos

5 years agoProvide deprecated backward compatible implementation to 'equalP'
Gabor Greif [Fri, 16 May 2014 17:41:34 +0000 (19:41 +0200)] 
Provide deprecated backward compatible implementation to 'equalP'

5 years agoRe-add 'classP' with a compatible implementation and a deprecation notice
Gabor Greif [Wed, 14 May 2014 21:41:50 +0000 (23:41 +0200)] 
Re-add 'classP' with a compatible implementation and a deprecation notice

5 years agoRemove the bit about External Core from flags.xml
Simon Peyton Jones [Fri, 16 May 2014 07:35:25 +0000 (08:35 +0100)] 
Remove the bit about External Core from flags.xml

This is a lefover vestige from Austin's removal of External Core

5 years agoTighten up wording in the section on let-generalisation and MonoLocalBinds
Simon Peyton Jones [Fri, 16 May 2014 07:34:44 +0000 (08:34 +0100)] 
Tighten up wording in the section on let-generalisation and MonoLocalBinds

5 years agoExtract derived constants from nm output for various OSes differently.
Christian Maeder [Thu, 3 Apr 2014 08:00:07 +0000 (10:00 +0200)] 
Extract derived constants from nm output for various OSes differently.

Fixes #8783.

In order to avoid querying the nm version that does not work on Mac OS X
we use the "nm -P" output that is supposed to produce (more portable)
POSIX output and works on all tested OSes (MinGW, Mac OS X, Solaris and
Linux using GNU nm) although slightly different (as documented). The "nm
-P" output is actually only needed to recognize the output of a non-GNU
Solaris nm (all other OSes produce sane outut using "nm" only).

Signed-off-by: Austin Seipp <>
5 years agointeger-gmp: do not confuse ./configure (#8783)
Christian Maeder [Mon, 19 May 2014 02:36:40 +0000 (21:36 -0500)] 
integer-gmp: do not confuse ./configure (#8783)

Signed-off-by: Austin Seipp <>
5 years agorts: remove stable-names from hashtable upon free
Edward Z. Yang [Mon, 19 May 2014 02:32:10 +0000 (21:32 -0500)] 
rts: remove stable-names from hashtable upon free

This fixes #9078.

Signed-off-by: Austin Seipp <>
5 years agobase: Document Foreign.ForeignPtr (#8475)
Chris Heller [Mon, 19 May 2014 02:31:14 +0000 (21:31 -0500)] 
base: Document Foreign.ForeignPtr (#8475)

Signed-off-by: Austin Seipp <>
5 years agoghc: Update containers submodule
Austin Seipp [Sun, 18 May 2014 21:58:46 +0000 (16:58 -0500)] 
ghc: Update containers submodule

Also update a few tests, since containers now has IsList instances.

Signed-off-by: Austin Seipp <>
5 years agoOnly uninstall signal handlers if they were actually installed (#9068)
Simon Marlow [Wed, 14 May 2014 20:10:06 +0000 (21:10 +0100)] 
Only uninstall signal handlers if they were actually installed (#9068)

Submitted by: tomgr

5 years agoRefactoring around TyCon.isSynTyCon
Simon Peyton Jones [Thu, 15 May 2014 15:07:04 +0000 (16:07 +0100)] 
Refactoring around TyCon.isSynTyCon

* Document isSynTyCon better
* Add isTypeSyonymTyCon for regular H98 type synonyms
* Use isTypeSynonymTyCon rather than isSynTyCon where
  the former is really intended

All arose as part of a bug I introduced when fixing Trac #9102,
thinking that isSynTyCon meant H98 type syononyms.

5 years agoExpress OPTIONS_GHC as LANGUAGE pragmas
Herbert Valerio Riedel [Thu, 15 May 2014 11:52:14 +0000 (13:52 +0200)] 
Express OPTIONS_GHC as LANGUAGE pragmas

These two instances were missed previously for some unknown reason

Signed-off-by: Herbert Valerio Riedel <>
5 years agoAdd LANGUAGE pragmas to compiler/ source files
Herbert Valerio Riedel [Wed, 14 May 2014 17:46:28 +0000 (19:46 +0200)] 
Add LANGUAGE pragmas to compiler/ source files

In some cases, the layout of the LANGUAGE/OPTIONS_GHC lines has been
reorganized, while following the convention, to

- place `{-# LANGUAGE #-}` pragmas at the top of the source file, before
  any `{-# OPTIONS_GHC #-}`-lines.

- Moreover, if the list of language extensions fit into a single
  `{-# LANGUAGE ... -#}`-line (shorter than 80 characters), keep it on one
  line. Otherwise split into `{-# LANGUAGE ... -#}`-lines for each
  individual language extension. In both cases, try to keep the
  enumeration alphabetically ordered.
  (The latter layout is preferable as it's more diff-friendly)

While at it, this also replaces obsolete `{-# OPTIONS ... #-}` pragma
occurences by `{-# OPTIONS_GHC ... #-}` pragmas.

5 years agoAvoid trivial cases of NondecreasingIndentation
Herbert Valerio Riedel [Thu, 15 May 2014 07:51:51 +0000 (09:51 +0200)] 
Avoid trivial cases of NondecreasingIndentation

This cleanup allows the following refactoring commit to avoid adding a
few `{-# LANGUAGE NondecreasingIndentation #-}` pragmas.

Signed-off-by: Herbert Valerio Riedel <>
5 years agoConvert `ghc-bin.cabal` to use others-extensions
Herbert Valerio Riedel [Wed, 14 May 2014 10:41:21 +0000 (12:41 +0200)] 
Convert `ghc-bin.cabal` to use others-extensions

This replaces the previous `default-extensions` by per-file declared
`{-# LANGUAGE ... #-}` pragmas.

Signed-off-by: Herbert Valerio Riedel <>
5 years agoDrop default-extensions:CPP in hpc-bin.cabal
Herbert Valerio Riedel [Wed, 14 May 2014 10:37:25 +0000 (12:37 +0200)] 
Drop default-extensions:CPP in hpc-bin.cabal

The utils/hpc/*.hs code doesn't use any CPP statements anyway, so this
extensions was redundantly enabled to begin with.

Signed-off-by: Herbert Valerio Riedel <>
5 years agoDrop use of CPP in `bin-package-db`
Herbert Valerio Riedel [Wed, 14 May 2014 10:33:31 +0000 (12:33 +0200)] 
Drop use of CPP in `bin-package-db`

This also removes the redundant `default-extensions` field in
`bin-package-db.cabal` and adds an `other-extensions` field instead.

Signed-off-by: Herbert Valerio Riedel <>
5 years agoAvoid NondecreasingIndentation syntax in ghc-pkg
Herbert Valerio Riedel [Wed, 14 May 2014 10:16:13 +0000 (12:16 +0200)] 
Avoid NondecreasingIndentation syntax in ghc-pkg

This also makes ghc-pkg.cabal `default-extensions`-free

NB: Printing this commit via `git show --ignore-all-spaces` shows the
    only non-whitespaces changes are in `ghc-pkg.cabal`

Signed-off-by: Herbert Valerio Riedel <>
5 years agoAdd missing stack checks to stg_ap_* functions (#9001)
Simon Marlow [Wed, 14 May 2014 11:25:08 +0000 (12:25 +0100)] 
Add missing stack checks to stg_ap_* functions (#9001)

5 years agoRemove LANGUAGE pragrams implied by Haskell2010
Herbert Valerio Riedel [Wed, 14 May 2014 07:31:57 +0000 (09:31 +0200)] 
Remove LANGUAGE pragrams implied by Haskell2010

Haskell2010 implies (at least) EmptyDataDecls, ForeignFunctionInterface,
PatternGuards, DoAndIfThenElse, and RelaxedPolyRec.

This is a follow-up to dd92e2179e3171a0630834b773c08d416101980d

Signed-off-by: Herbert Valerio Riedel <>
5 years agoSet cabal files to default-language:Haskell2010
Herbert Valerio Riedel [Wed, 14 May 2014 07:24:10 +0000 (09:24 +0200)] 
Set cabal files to default-language:Haskell2010

This is a first step towards eliminating `default-extensions` in favour of
per-file declared `{-# LANGUAGE ... #-}` pragmas.

Signed-off-by: Herbert Valerio Riedel <>
5 years agoAdd strict ver. of (<$>): (<$!>) to Control.Monad
Alexander Berntsen [Tue, 13 May 2014 08:50:30 +0000 (10:50 +0200)] 
Add strict ver. of (<$>): (<$!>) to Control.Monad

A strict (<$>) has been proposed numerous times. The first time
around[1] by Johan Tibell, and the last time around[2] by David
Luposchainsky. David's thread was able to avoid The Bikeshed Monster,
and his (<$!>) proposal received unanimous +1s all around.

This addresses #9099.


Authored-by: Alexander Berntsen <>
Signed-off-by: Herbert Valerio Riedel <>
5 years agoUpdate Haddock submodule.
Mateusz Kowalczyk [Wed, 14 May 2014 00:32:42 +0000 (02:32 +0200)] 
Update Haddock submodule.

This splits up Haddock up a bit to allow use of its parser (and in the
future perhaps more) without GHC dependency. It should build fine with
the regular work-flow but if you get problems with building Haddock then
please revert this and let me know.

5 years agoWibble to 4cfc1fae
Simon Peyton Jones [Tue, 13 May 2014 23:15:48 +0000 (00:15 +0100)] 
Wibble to 4cfc1fae

isSynTyCon is true of type *family* TyCons, which *are* allowed
in TyConAppCo

5 years agoFix globalRegMaybe for unregisterised build.
Peter Trommler [Wed, 30 Apr 2014 09:41:51 +0000 (11:41 +0200)] 
Fix globalRegMaybe for unregisterised build.

In commit 83a003f globalRegMaybe will be called but panics
for unregisterised compilers.

In an unregisterised compiler there are no global registers
so always return `Nothing`.

Fixes #9055.

5 years agoFix invariant in mkAppCoFlexible
Simon Peyton Jones [Tue, 13 May 2014 12:17:19 +0000 (13:17 +0100)] 
Fix invariant in mkAppCoFlexible

mkAppCoFlexible was breaking the invariant that the head of a TyConAppCo cannot
be a type synonym.  This small patch fixes it.

5 years agoLint should check that TyConAppCo doesn't have a synonym in the tycon position
Simon Peyton Jones [Tue, 13 May 2014 12:15:45 +0000 (13:15 +0100)] 
Lint should check that TyConAppCo doesn't have a synonym in the tycon position

That is why Lint didn't nail Trac #9102

5 years agoTypo in note
Gabor Greif [Mon, 12 May 2014 22:49:30 +0000 (00:49 +0200)] 
Typo in note

5 years agoTypo in comment
Gabor Greif [Mon, 12 May 2014 22:38:19 +0000 (00:38 +0200)] 
Typo in comment

5 years agoImprove desugaring of lazy pattern match
Simon Peyton Jones [Mon, 12 May 2014 15:03:48 +0000 (16:03 +0100)] 
Improve desugaring of lazy pattern match

This patch implements a simpler, and nicer, desugaring for
lazy pattern matching, fixing Trac #9098

5 years agoIn splitHsFunType, take account of prefix (->)
Simon Peyton Jones [Mon, 12 May 2014 15:02:36 +0000 (16:02 +0100)] 
In splitHsFunType, take account of prefix (->)

This fixes Trac #9096

5 years agoComments only, on inert_fsks and inert_no_eqs
Simon Peyton Jones [Fri, 9 May 2014 09:40:50 +0000 (10:40 +0100)] 
Comments only, on inert_fsks and inert_no_eqs

I wrote these when studying Trac #9090

5 years agoRevert output of T5979
Joachim Breitner [Sat, 10 May 2014 16:28:44 +0000 (18:28 +0200)] 
Revert output of T5979

this reverts 12332f1. The error message changes when there are two
versions of transformers in the database, one of them hidden. That might
be a bug of its own, but for now lets make the test case succeed after a
fresh build. Affected developers should probably
$ ./inplace/bin/ghc-pkg unregister transformers-

5 years agoRequire transformers for T5979
Joachim Breitner [Sat, 10 May 2014 09:38:49 +0000 (11:38 +0200)] 
Require transformers for T5979

in order to get a reliable error message
(although the error message could be improved anyways to mention the
explicit package the module is imported with.)

5 years agotestsuite: fix cc004
Austin Seipp [Sat, 10 May 2014 02:50:52 +0000 (21:50 -0500)] 
testsuite: fix cc004

Signed-off-by: Austin Seipp <>
5 years agotestsuite: fix cgrun051 exit code
Austin Seipp [Sat, 10 May 2014 01:58:06 +0000 (20:58 -0500)] 
testsuite: fix cgrun051 exit code

Signed-off-by: Austin Seipp <>
5 years agoUpdate .gitignore
Austin Seipp [Sat, 3 May 2014 22:35:04 +0000 (17:35 -0500)] 
Update .gitignore

Signed-off-by: Austin Seipp <>
5 years agoError message wibble, presumably due to recent changes in transformers
Simon Peyton Jones [Thu, 8 May 2014 12:06:05 +0000 (13:06 +0100)] 
Error message wibble, presumably due to recent changes in transformers

5 years agoBetter error message in vectoriser
Simon Peyton Jones [Thu, 8 May 2014 09:39:21 +0000 (10:39 +0100)] 
Better error message in vectoriser

5 years agoPreserve evaluated-ness in CoreTidy
Simon Peyton Jones [Thu, 8 May 2014 09:38:52 +0000 (10:38 +0100)] 
Preserve evaluated-ness in CoreTidy

The main effect of this patch is to preserve the evaluated-ness of
case binders and suchlike, to avoid spurious Lint complaints after
tidying.  See Note [Preserve evaluatedness] in CoreTidy.

Plus a bit of associated refactoring of tidyIdBndr, tidyLetBndr.

5 years agoMark evaluated arguments in dataConInstPat
Simon Peyton Jones [Thu, 8 May 2014 09:33:17 +0000 (10:33 +0100)] 
Mark evaluated arguments in dataConInstPat

See Note [Mark evaluated arguments] in CoreUtils.

This is not a significant change, but avoids a spurious Lint complaint.

5 years agoRefactor buildClass and mkDictSelId a bit, to avoid the no_unf argument
Simon Peyton Jones [Thu, 8 May 2014 09:31:53 +0000 (10:31 +0100)] 
Refactor buildClass and mkDictSelId a bit, to avoid the no_unf argument

No change in functionality, just a cleaner story, with the RHS for
dictionary selectors being treated less specially than before.

5 years agoImprove tracing in Simplifier
Simon Peyton Jones [Mon, 7 Apr 2014 14:41:45 +0000 (15:41 +0100)] 
Improve tracing in Simplifier

5 years agoUpdate transformers submodule to new v0.4 rel
Herbert Valerio Riedel [Tue, 6 May 2014 20:46:27 +0000 (22:46 +0200)] 
Update transformers submodule to new v0.4 rel

This also updates the haskeline to upstream master to
accomodate the new transformers version

5 years agoAdding missing test files for #9071
Simon Peyton Jones [Tue, 6 May 2014 08:46:14 +0000 (09:46 +0100)] 
Adding missing test files for #9071

5 years agoAdd a bit more typechecker tracing
Simon Peyton Jones [Tue, 6 May 2014 07:23:26 +0000 (08:23 +0100)] 
Add a bit more typechecker tracing

This is in pursuit of Trac #9063

5 years agoFix Trac #9071, an egregious bug in TcDeriv.inferConstraints
Simon Peyton Jones [Tue, 6 May 2014 07:22:37 +0000 (08:22 +0100)] 
Fix Trac #9071, an egregious bug in TcDeriv.inferConstraints

The constraints for Functor don't line up 1-1 with the arguments
(they are fetched out from sub-terms of the type), but the surrounding
code was mistakenly assuming they were in 1-1 association.

5 years agoSecond go at fixing #9061
Simon Peyton Jones [Tue, 6 May 2014 07:20:28 +0000 (08:20 +0100)] 
Second go at fixing #9061

My first attempt introduce a bug in -fprint-minimal-imports, but
fortunately a regression test caught it.

5 years agoModularise pretty-printing for foralls
Simon Peyton Jones [Tue, 6 May 2014 07:19:01 +0000 (08:19 +0100)] 
Modularise pretty-printing for foralls

See TypeRep.pprUserForAll.  This just makes forall-printing a bit more
consistent.  In particular, I wasn't seeing the kind foralls when
displaying a CoAxiom or CoAxBranch

The output on T7939 is just possible a bit too verbose now, but even if so
that's an error in the right direction.

5 years agoImprove comments and tracing in SpecConstr
Simon Peyton Jones [Mon, 5 May 2014 07:50:51 +0000 (08:50 +0100)] 
Improve comments and tracing in SpecConstr

5 years agoChanged profiling output is fine (according to Simon Marlow)
Simon Peyton Jones [Fri, 2 May 2014 11:10:42 +0000 (12:10 +0100)] 
Changed profiling output is fine (according to Simon Marlow)

5 years agoAdd -fno-full-laziness to get consistent profiling output
Simon Peyton Jones [Fri, 2 May 2014 11:10:26 +0000 (12:10 +0100)] 
Add -fno-full-laziness to get consistent profiling output

5 years agoFix over-zealous unused-import warning
Simon Peyton Jones [Fri, 2 May 2014 11:09:52 +0000 (12:09 +0100)] 
Fix over-zealous unused-import warning

See Note [Un-warnable import decls] in RnNames.

Fixes Trac #9061.

5 years agoRevert "Per-thread allocation counters and limits"
Simon Marlow [Sun, 4 May 2014 19:27:42 +0000 (20:27 +0100)] 
Revert "Per-thread allocation counters and limits"

Problems were found on 32-bit platforms, I'll commit again when I have a fix.

This reverts the following commits:

5 years agoImprove docs for array indexing primops
Johan Tibell [Sun, 4 May 2014 09:32:15 +0000 (11:32 +0200)] 
Improve docs for array indexing primops

5 years agoUpdate comment now that we have per-gen weak pointer lists.
Edward Z. Yang [Sun, 4 May 2014 08:18:54 +0000 (01:18 -0700)] 
Update comment now that we have per-gen weak pointer lists.

Signed-off-by: Edward Z. Yang <>
5 years agofix rts exported symbols base_GHCziIOziException_allocationLimitExceeded_closure
Sergei Trofimovich [Sat, 3 May 2014 19:29:14 +0000 (22:29 +0300)] 
fix rts exported symbols base_GHCziIOziException_allocationLimitExceeded_closure

Commit  b0534f78a73f972e279eed4447a5687bd6a8308e added new exported rts symbols,
but slightly misspelled them.

Observer on first compiled program:
> Linking dist/build/haskell-updater/haskell-updater ...
> /usr/lib64/ghc-7.9.20140503/rts-1.0/libHSrts.a(Schedule.o): In function `scheduleWaitThread':
> (.text+0xc4c): undefined reference to `base_GHCziIOziException_allocationLimitExceeded_closure'
> /usr/lib64/ghc-7.9.20140503/rts-1.0/libHSrts.a(RtsStartup.o): In function `hs_init_ghc':
> (.text+0x2fa): undefined reference to `base_GHCziIOziException_allocationLimitExceeded_closure'
> collect2: error: ld returned 1 exit status

CC: Simon Marlow <>
Signed-off-by: Sergei Trofimovich <>
5 years agoRemove external core
Austin Seipp [Mon, 28 Apr 2014 02:11:23 +0000 (21:11 -0500)] 
Remove external core

Signed-off-by: Austin Seipp <>
5 years agoUpdate Haddock submodule ref. Fixes `cabal test'.
Mateusz Kowalczyk [Sat, 3 May 2014 13:43:00 +0000 (15:43 +0200)] 
Update Haddock submodule ref. Fixes `cabal test'.

5 years agoPer-thread allocation counters and limits
Simon Marlow [Mon, 28 Apr 2014 15:55:47 +0000 (16:55 +0100)] 
Per-thread allocation counters and limits

This tracks the amount of memory allocation by each thread in a
counter stored in the TSO.  Optionally, when the counter drops below
zero (it counts down), the thread can be sent an asynchronous
exception: AllocationLimitExceeded.  When this happens, given a small
additional limit so that it can handle the exception.  See
documentation in GHC.Conc for more details.

Allocation limits are similar to timeouts, but

  - timeouts use real time, not CPU time.  Allocation limits do not
    count anything while the thread is blocked or in foreign code.

  - timeouts don't re-trigger if the thread catches the exception,
    allocation limits do.

  - timeouts can catch non-allocating loops, if you use
    -fno-omit-yields.  This doesn't work for allocation limits.

I couldn't measure any impact on benchmarks with these changes, even
for nofib/smp.

5 years agoReplace all #!/usr/bin/perl with #!/usr/bin/env perl
Joachim Breitner [Wed, 30 Apr 2014 09:22:32 +0000 (11:22 +0200)] 
Replace all #!/usr/bin/perl with #!/usr/bin/env perl

As suggested in #9057.

5 years agoDon't inline non-register GlobalRegs
Simon Marlow [Tue, 29 Apr 2014 19:32:50 +0000 (20:32 +0100)] 
Don't inline non-register GlobalRegs

5 years agoRts: Reuse scavenge_small_bitmap (#8742)
Arash Rouhani [Thu, 6 Feb 2014 08:10:03 +0000 (09:10 +0100)] 
Rts: Reuse scavenge_small_bitmap (#8742)

The function was inlined at two places already. And the function is
having the STATIC_INLINE annotation, so the assembly output should.
be the same.

To convince myself, I did diff the output of the object files before
and after the patch and they matched on my 64-bit Ubuntu 13.10 machine,
running gcc 4.8.1-10ubuntu9.

Also, I had to move scavenge_small_bitmap up a bit since it's not in any

While I was at it, I also applied the analogous patch for Compact.c.
Though I had to write `thread_small_bitmap` instead of just moving it.

5 years agoRts: Consistently use StgWord for sizes of bitmaps
Arash Rouhani [Thu, 13 Feb 2014 14:28:11 +0000 (15:28 +0100)] 
Rts: Consistently use StgWord for sizes of bitmaps

A long debate is in issue #8742, but the main motivation is that this
allows for applying a patch to reuse the function scavenge_small_bitmap
without changing the .o-file output.

Similarly, I changed the types in rts/sm/Compact.c, so I can create
a STATIC_INLINE function for the redundant code block:

        while (size > 0) {
            if ((bitmap & 1) == 0) {
                thread((StgClosure **)p);
            bitmap = bitmap >> 1;

5 years agorts: Fix memory leak when loading ELF objects
Austin Seipp [Tue, 29 Apr 2014 14:09:25 +0000 (09:09 -0500)] 
rts: Fix memory leak when loading ELF objects

Issue discovered by Coverity Scan, CID 43168.

Signed-off-by: Austin Seipp <>
5 years agorts: Fix leak of file archive handle
Austin Seipp [Tue, 29 Apr 2014 14:05:38 +0000 (09:05 -0500)] 
rts: Fix leak of file archive handle

Issue discovered by Coverity Scan, CID 43171.

Signed-off-by: Austin Seipp <>
5 years agorts: Add an initial Coverity model
Austin Seipp [Tue, 29 Apr 2014 15:07:50 +0000 (10:07 -0500)] 
rts: Add an initial Coverity model

Signed-off-by: Austin Seipp <>
5 years agoAdd Note [Role twiddling functions] to Coercion.
Richard Eisenberg [Tue, 29 Apr 2014 15:55:56 +0000 (11:55 -0400)] 
Add Note [Role twiddling functions] to Coercion.

This commit also makes better names for several of these functions,
and removes one that went unused.

5 years agoRevert "rts: Add an initial Coverity model"
Austin Seipp [Tue, 29 Apr 2014 14:59:01 +0000 (09:59 -0500)] 
Revert "rts: Add an initial Coverity model"

This reverts commit 4539400a72ded7fa69149b28cfa9c84464f4739d.

5 years agorts: Add an initial Coverity model
Austin Seipp [Tue, 29 Apr 2014 13:48:57 +0000 (08:48 -0500)] 
rts: Add an initial Coverity model

Signed-off-by: Austin Seipp <>
5 years agoTypo in comment
Gabor Greif [Tue, 29 Apr 2014 13:38:29 +0000 (15:38 +0200)] 
Typo in comment

5 years agoTypo in comments
Gabor Greif [Tue, 29 Apr 2014 13:34:29 +0000 (15:34 +0200)] 
Typo in comments

5 years agoFix scavenge_stack crash (#9045)
Simon Marlow [Mon, 28 Apr 2014 15:36:29 +0000 (16:36 +0100)] 
Fix scavenge_stack crash (#9045)

The new stg_gc_prim_p_ll stack frame was missing an info table.  This
is a regression since 7.6, because this stuff was part of a cleanup
that happened in 7.7.

5 years agoImprove implementation of unSubCo_maybe.
Richard Eisenberg [Mon, 28 Apr 2014 17:33:13 +0000 (13:33 -0400)] 
Improve implementation of unSubCo_maybe.

This is the result of an email conversation (off list) with
Conal Elliott, who needed a stronger unSubCo_maybe. This
commit adds cases to upgrade the role of a coercion when
recursion is necessary to do say (for example, for a use of
TransCo). As a side effect, more coercion optimizations are
now possible.

This was not done previously because unSubCo_maybe was used
only during coercion optimization, and the recursive cases
looked to be unlikely. However, adding them can cause no harm.

unSubCo_maybe is now also exported from Coercion, for use
cases like Conal's.

5 years agoannth_make, annth_compunits: Only run these tests if have_dynamic()
Joachim Breitner [Mon, 28 Apr 2014 14:14:10 +0000 (16:14 +0200)] 
annth_make, annth_compunits: Only run these tests if have_dynamic()

5 years agoPrint for-alls more often (Trac #9018)
Simon Peyton Jones [Mon, 28 Apr 2014 13:49:21 +0000 (14:49 +0100)] 
Print for-alls more often (Trac #9018)

We now display the foralls of a type if any of the type variables
is polykinded.  This put kind polymorphism "in your face" a bit more
often, but eliminates a lot of head scratching.

The user manual reflects the new behaviour.

5 years agotcrun045 should fail (implicit parameter as superclass)
Simon Peyton Jones [Mon, 28 Apr 2014 09:31:15 +0000 (10:31 +0100)] 
tcrun045 should fail (implicit parameter as superclass)

5 years agoAdd a comprehensive test for using Annotations from TH
Gergely Risko [Fri, 25 Apr 2014 13:39:26 +0000 (15:39 +0200)] 
Add a comprehensive test for using Annotations from TH

The provided tests test both annotation generation and reification
from Template Haskell.  Both --make and compilation via separate
units (ghc -c) are tested.

Signed-off-by: Austin Seipp <>
5 years agoFix annotation reification for home package modules
Gergely Risko [Fri, 25 Apr 2014 13:35:58 +0000 (15:35 +0200)] 
Fix annotation reification for home package modules

The reifyAnnotation method of the Q monad correctly gathered annotations
from TCG and EPS.  Unfortunately it didn't look into the Home Package
Table.  This resulted in annotations not being found if they are in the
same package as the splice that is reifying and ghc --make is used for
compilation management.  Fix this by using the already existing
prepareAnnotations method from HscTypes.lhs that correctly searches
in HPT and EPS both.

Signed-off-by: Austin Seipp <>
5 years agoStart on 7.10.1 release notes
Austin Seipp [Mon, 28 Apr 2014 09:31:14 +0000 (04:31 -0500)] 
Start on 7.10.1 release notes

Signed-off-by: Austin Seipp <>
5 years agoUpdate 32-bit perf numbers
Simon Peyton Jones [Thu, 24 Apr 2014 23:07:20 +0000 (00:07 +0100)] 
Update 32-bit perf numbers

Many of these have never been initialised, I think.  They
were simply guesses from the 64-bit version.

5 years agoRemove the definition of die, which is now provided by System.Exit
Simon Peyton Jones [Thu, 24 Apr 2014 23:06:08 +0000 (00:06 +0100)] 
Remove the definition of die, which is now provided by System.Exit

5 years agoDo type-class defaulting even if there are insoluble constraints
Simon Peyton Jones [Thu, 24 Apr 2014 23:04:45 +0000 (00:04 +0100)] 
Do type-class defaulting even if there are insoluble constraints

The argument in Trac #9033 is very compelling: we should not report 20
errors, fix one, and have the other 19 disappear.  They were spurious
in the first place.

The fix was easy; do type-class defaulting uncondionally, rather than
only if there are no insoluble constraints.

See Note [When to do type-class defaulting] in TcSimplify.

Error messages generally improve, especially tc211 which actually
had an example of precisely this phenomenon.

5 years agorm -rf ./docs/comm
Austin Seipp [Mon, 28 Apr 2014 09:13:07 +0000 (04:13 -0500)] 
rm -rf ./docs/comm

The Commentary is now on the wiki and far more complete. This copy will
of course live on in the annals of history, but there's no reason to
keep it around still.

Signed-off-by: Austin Seipp <>
5 years agoTest Trac #9036
Simon Peyton Jones [Mon, 28 Apr 2014 07:55:32 +0000 (08:55 +0100)] 
Test Trac #9036

5 years agoDon't require mk/ for all cleanup targets
Herbert Valerio Riedel [Sun, 27 Apr 2014 17:15:16 +0000 (19:15 +0200)] 
Don't require mk/ for all cleanup targets

`make clean` did already ignore a missing mk/,
but `make distclean` and `make maintainer-clean` didn't.
This commit rectifies this oversight.

Signed-off-by: Herbert Valerio Riedel <>
5 years agoFix memleak in hp2ps
Nicolas Trangez [Wed, 23 Apr 2014 19:14:23 +0000 (21:14 +0200)] 
Fix memleak in hp2ps

Issue discovered by Coverity scan, CID 43167.

Signed-off-by: Austin Seipp <>