ghc.git
5 years agoSet VERSION=7.8.3, RELEASE=YES ghc-7.8.3-release
Austin Seipp [Thu, 10 Jul 2014 00:25:13 +0000 (19:25 -0500)] 
Set VERSION=7.8.3, RELEASE=YES

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: Fix #9003 with an annoying hack
Austin Seipp [Thu, 10 Jul 2014 00:08:26 +0000 (19:08 -0500)] 
rts: Fix #9003 with an annoying hack

The TL;DR is that by adding this, we can distinguish GHC 7.8.3 from
7.8.2, which had a buggy implementation. See the ticket for details.

Signed-off-by: Austin Seipp <austin@well-typed.com>
(cherry picked from commit bd5f3ef6585640f762d96426bb041d79a5038e8e)

5 years agoRelease note updates for 7.8.3
Austin Seipp [Fri, 4 Jul 2014 15:13:11 +0000 (10:13 -0500)] 
Release note updates for 7.8.3

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoFix windows breakage (fallout from 34f7e9a3c998)
Austin Seipp [Fri, 4 Jul 2014 14:40:25 +0000 (09:40 -0500)] 
Fix windows breakage (fallout from 34f7e9a3c998)

Signed-off-by: Austin Seipp <austin@well-typed.com>
(cherry picked from commit 0567a3133bfd3f2085d2fc0211e91eaed96a3e83)

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 <hvr@gnu.org>
(cherry picked from commit 913b3146541e203b2524e756b047b7f90be849b7)

Conflicts:
utils/ghc-pkg/ghc-pkg.cabal

5 years agoPartially fix #9003 by reverting bad numbering.
Edward Z. Yang [Tue, 1 Jul 2014 13:43:50 +0000 (14:43 +0100)] 
Partially fix #9003 by reverting bad numbering.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
(cherry picked from commit 5f3c5384df59717ca8013c5df8d1f65692867825)

5 years agoFix T7438 output
Austin Seipp [Thu, 3 Jul 2014 21:35:21 +0000 (16:35 -0500)] 
Fix T7438 output

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoAdd Note [Placeholder PatSyn kinds] in TcBinds
Simon Peyton Jones [Tue, 24 Jun 2014 12:24:36 +0000 (13:24 +0100)] 
Add Note [Placeholder PatSyn kinds] in TcBinds

This is just documentation for the fix to Trac #9161

(cherry picked from commit 0757831eaca96c8ebfd99fc51427560d3568cffa)

5 years agoAdd fake entries into the global kind environment for pattern synonyms.
Dr. ERDI Gergo [Sat, 21 Jun 2014 14:37:50 +0000 (22:37 +0800)] 
Add fake entries into the global kind environment for pattern synonyms.

This is needed to give meaningful error messages (instead of internal
panics) when a program tries to lift a pattern synonym into a kind.
(fixes T9161)

(cherry picked from commit aa3166f42361cb605e046f4a063be3f9e1f48015)

5 years agoTest Trac #9023
Simon Peyton Jones [Thu, 5 Jun 2014 11:26:24 +0000 (12:26 +0100)] 
Test Trac #9023

(cherry picked from commit 616f54bdc28ad699f903248a5fb18dc0e5b52a52)

5 years agoMake the matcher and wrapper Ids in PatSyn into LocalIds, not GlobalIds
Simon Peyton Jones [Fri, 6 Jun 2014 10:39:41 +0000 (11:39 +0100)] 
Make the matcher and wrapper Ids in PatSyn into LocalIds, not GlobalIds

This was a serious bug, exposed by Trac #9175.  The matcher and wrapper
must be LocalIds, like record selectors and dictionary functions, for
the reasons now documented in Note [Exported LocalIds] in Id.lhs

In fixing this I found
 - PatSyn should have an Id inside it (apart from the wrapper and matcher)
   It should be a Name.  Hence psId --> psName, with knock-on consequences

 - Tidying of PatSyns in TidyPgm was wrong

 - The keep-alive set in Desugar.deSugar (now) doesn't need pattern synonyms
   in it

I also cleaned up the interface to PatSyn a little, so there's a tiny knock-on
effect in Haddock; hence the haddock submodule update.

It's very hard to make a test for this bug, so I haven't.

(cherry picked from commit 7ac600d5fcd74db1f991555de6e415030970d5f3)

Conflicts:
utils/haddock

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.

(cherry picked from commit 2f3ea95285d0cccc2a999e7572d8fb78dc2ea441)

Conflicts:
testsuite/tests/ghci/scripts/ghci059.stdout
testsuite/tests/polykinds/T7438.stderr

5 years agoFix egregious instantiation bug in matchOneConLike (fixing Trac #9023)
Simon Peyton Jones [Thu, 5 Jun 2014 10:03:45 +0000 (11:03 +0100)] 
Fix egregious instantiation bug in matchOneConLike (fixing Trac #9023)

We simply weren't giving anything like the right instantiating types
to patSynInstArgTys in matchOneConLike.

To get these instantiating types would have involved matching the
result type of the pattern synonym with the pattern type, which is
tiresome.  So instead I changed ConPatOut so that instead of recording
the type of the *whole* pattern (in old field pat_ty), it not records
the *instantiating* types (in new field pat_arg_tys).  Then we canuse
TcHsSyn.conLikeResTy to get the pattern type when needed.

There are lots of knock-on incidental effects, but they mostly made
the code simpler, so I'm happy.

(cherry picked from commit 0a55a3cada2fea37586b1a270c1511ed9957dbd4)

5 years agoImprove tracing slightly
Simon Peyton Jones [Tue, 8 Apr 2014 08:41:20 +0000 (09:41 +0100)] 
Improve tracing slightly

(cherry picked from commit cbe59d89f2f1cc41147fabb4a4c58126152bef7f)

5 years agoStore IfExtNames for PatSyn matchers and wrappers in interface file.
Dr. ERDI Gergo [Tue, 27 May 2014 13:16:41 +0000 (21:16 +0800)] 
Store IfExtNames for PatSyn matchers and wrappers in interface file.
This way, the Ids for the matchers/wrappers are reused by importing
modules, and thus unfoldings are kept.

Also updates haddock submodule to accomodate tweaks in PatSyn representation

(cherry picked from commit ac2796e6ddbd54c5762c53e2fcf29f20ea162fd5)

Conflicts:
utils/haddock

5 years agoInstead of tracking Origin in LHsBindsLR, track it in MatchGroup
Dr. ERDI Gergo [Sat, 12 Apr 2014 11:36:31 +0000 (19:36 +0800)] 
Instead of tracking Origin in LHsBindsLR, track it in MatchGroup

(cherry picked from commit eeaea2df3fa585db503034f419c6e4331a4d8a84)

5 years agoExpected output of as-pattern test
Dr. ERDI Gergo [Sat, 12 Apr 2014 09:52:26 +0000 (17:52 +0800)] 
Expected output of as-pattern test

(cherry picked from commit 7233638ba6e82179cc4bd1b981eff5292b18e118)

5 years agoAdd source file for new test that checks that as-patterns are rejected
Dr. ERDI Gergo [Sat, 12 Apr 2014 08:35:44 +0000 (16:35 +0800)] 
Add source file for new test that checks that as-patterns are rejected
in pattern synonym definitions

(cherry picked from commit dd3a6d270f827a59f7a33f32facc506cb35af1fa)

5 years agoRemove unused variable binding to fix validate
Dr. ERDI Gergo [Sat, 12 Apr 2014 00:57:27 +0000 (08:57 +0800)] 
Remove unused variable binding to fix validate

(cherry picked from commit b7f51d60093ea13d0854bd7e1d4ecf58d12628a1)

5 years agoSplit off pattern synonym definition checking from pattern inversion
Dr. ERDI Gergo [Thu, 10 Apr 2014 14:13:00 +0000 (22:13 +0800)] 
Split off pattern synonym definition checking from pattern inversion

(cherry picked from commit c269b7e85524f4a8be3cd0f00e107207ab9197af)

5 years agoAdd comments & notes explaining the typing of pattern synonym definitions
Dr. ERDI Gergo [Tue, 8 Apr 2014 14:29:23 +0000 (22:29 +0800)] 
Add comments & notes explaining the typing of pattern synonym definitions

(cherry picked from commit d2c4f9758ca735f294033401efef225699c292f8)

5 years agoUpdate documentation
Jan Stolarek [Thu, 3 Jul 2014 06:16:28 +0000 (08:16 +0200)] 
Update documentation

  * fix links to the User's Guide in ghc and ghci --help messages
  * fix default stack size info in RTS help message

(cherry picked from commit 311c55d132a65e657771e5f58b12a205e0a4af99)

5 years agoMark HPC ticks labels as dynamic
Reid Barton [Tue, 1 Jul 2014 05:04:18 +0000 (01:04 -0400)] 
Mark HPC ticks labels as dynamic

This enables GHC's PIC machinery for accessing tickboxes of other
packages correctly when building dynamic libraries. Previously
GHC was doing strange and wrong things in that situation. See #9012.

(cherry picked from commit 3285a3d5bc7419464f5d2e6cef7c3adb9bca65c3)

5 years agoAdd missing test file T7269
Simon Peyton Jones [Mon, 26 May 2014 16:03:23 +0000 (17:03 +0100)] 
Add missing test file T7269

(cherry picked from commit db869e7521387db0513d1dc2b49641ce32688cdd)

5 years agoFix yet another bug in 'deriving' for polykinded classes (Trac #7269)
Simon Peyton Jones [Wed, 2 Jul 2014 17:47:11 +0000 (12:47 -0500)] 
Fix yet another bug in 'deriving' for polykinded classes (Trac #7269)

This patch makes the code a bit simpler if anything.

(cherry picked from commit b1436f55da2b0e005ac09be6651a2c4d934027ec)

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

(cherry picked from commit 3fd7f543efe977de6f3cce9fcdfdad8b6825f948)

5 years agoRefactoring around TyCon.isSynTyCon
Simon Peyton Jones [Wed, 2 Jul 2014 17:18:41 +0000 (12:18 -0500)] 
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.

(cherry picked from commit 022f8750edf6f413fba31293435dcc62600eab77)

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.

(cherry picked from commit 21f17d06aa5c33e639f1b0d37b4bf888b494c441)

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

(cherry picked from commit 4cfc1fae11ec9a5c4b34ac747f0ce50f52423eba)

5 years agoComment the expect_broken for Trac #9208
Simon Peyton Jones [Mon, 23 Jun 2014 16:37:56 +0000 (17:37 +0100)] 
Comment the expect_broken for Trac #9208

(cherry picked from commit 8a0aa198f78cac1ca8d0695bd711778e8ad086aa)

5 years agoMark T9208 as broken when debugging is on
Joachim Breitner [Mon, 23 Jun 2014 15:50:47 +0000 (08:50 -0700)] 
Mark T9208 as broken when debugging is on

this seems to be expected, as explained by SPJ in comment 7 of #9208.

(cherry picked from commit 518ada5cda08d3256826ed0383888111f8096de5)

5 years agoTest #9085.
Richard Eisenberg [Wed, 11 Jun 2014 12:29:27 +0000 (08:29 -0400)] 
Test #9085.

(cherry picked from commit f502617065c8716a062c83fc923c3b3a2395c4a8)

5 years agoFix #9085.
Richard Eisenberg [Tue, 10 Jun 2014 19:25:36 +0000 (15:25 -0400)] 
Fix #9085.

Inaccessible equations in a closed type family now leads to a
warning, not an error. This echoes what happens at the term level.

(cherry picked from commit 6a1d7f9736098d47463a71323d28ece792a59e52)

5 years agoCheck for integer overflow in allocate() (#9172)
Reid Barton [Tue, 1 Jul 2014 14:20:31 +0000 (10:20 -0400)] 
Check for integer overflow in allocate() (#9172)

Summary: Check for integer overflow in allocate() (#9172)

Test Plan: validate

Reviewers: austin

Reviewed By: austin

Subscribers: simonmar, relrod, carter

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

(cherry picked from commit db64180896b395283f443d66a308048c605b217d)

Conflicts:
testsuite/.gitignore

5 years agoTest Trac #9222
Simon Peyton Jones [Tue, 1 Jul 2014 14:23:30 +0000 (15:23 +0100)] 
Test Trac #9222

(cherry picked from commit 127c45ea30eaee6b5244b3f30aaa701d0ad327ac)

Conflicts:
testsuite/tests/polykinds/all.T

5 years agoIn TcValidity.checkAmbiguity, skolemise kind vars that appear free in the kinds of...
Simon Peyton Jones [Tue, 24 Jun 2014 21:23:29 +0000 (22:23 +0100)] 
In TcValidity.checkAmbiguity, skolemise kind vars that appear free in the kinds of type variables

This was shown up by Trac #9222.

(cherry picked from commit 2be99d2309471bc75ddb9cb47acda9ccbcb7ab63)

5 years agoFix demand analyser for unboxed types
Simon Peyton Jones [Tue, 1 Jul 2014 12:31:18 +0000 (13:31 +0100)] 
Fix demand analyser for unboxed types

This is a tricky case exposed by Trac #9254.  I'm surprised it hasn't
shown up before, because it's happens when you use unsafePerformIO in
the right way.

Anyway, fixed now.  See Note [Analysing with absent demand]
in Demand.lhs

(cherry picked from commit d6ee82b29598dcc1028773dd987b7a2fb17519b7)

5 years agoRemove extraneous debugging output (#9071)
Reid Barton [Mon, 30 Jun 2014 21:27:14 +0000 (17:27 -0400)] 
Remove extraneous debugging output (#9071)

(cherry picked from commit c44da48c6d19b3d8cc0ba34328576683410f8ec2)

5 years agoControl CPP through settings file (#8683)
Carter Tazio Schonwald [Wed, 2 Jul 2014 13:52:53 +0000 (08:52 -0500)] 
Control CPP through settings file (#8683)

Summary:
Allow the CPP program and flag choices for GHC
be configured via the the ghc settings file

Test Plan: ran validate yesterday

Reviewers: hvr, austin, mzero, simonmar

Reviewed By: austin, mzero, simonmar

Subscribers: mzero, simonmar, relrod, carter

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

(cherry picked from commit 34f7e9a3c99850859901ca74370f55f1d4e2279a)

5 years agoFix T9160 under ./validate
Austin Seipp [Wed, 2 Jul 2014 15:27:16 +0000 (10:27 -0500)] 
Fix T9160 under ./validate

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoFix merge fallout, killing validate
Austin Seipp [Mon, 30 Jun 2014 13:42:15 +0000 (08:42 -0500)] 
Fix merge fallout, killing validate

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoFix elemLocalRdrEnv (Trac #9160)
Simon Peyton Jones [Thu, 12 Jun 2014 15:42:37 +0000 (16:42 +0100)] 
Fix elemLocalRdrEnv (Trac #9160)

This was pretty obscure.  elemLocalRdrEnv was utterly wrong (replied
False when it should reply True) when given an Exact Name. That
doesn't happen often, but it does happen in the result of a TH splice.
The result was that an associated type didn't get a type variable that
lined up with its parent class (elemLocalRdrEnv is used in
RnTypes.bindHsTyVars), and that messed up the singletons package.

I've made a completely different test case to show up the bug:
indexed_types/should_fail/T9160

I also refactored RdrName.LocalRdrEnv to be a record with named
fields, which makes the code more robust and easy to understand.

(cherry picked from commit b637585dcbfc1ba53aa49bcb9b730cd08fea4b59)

Conflicts:
testsuite/tests/indexed-types/should_fail/all.T

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

(cherry picked from commit 59b4e6d0ba504b33cc7064d489b8ec485a7703f4)

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.

(cherry picked from commit 13a330e87cf459311a7f164e1e57baf877741da6)

Conflicts:
compiler/typecheck/TcDeriv.lhs

5 years agoLine up kind and type variables correctly when desugaring TH brackets
Simon Peyton Jones [Thu, 12 Jun 2014 15:36:59 +0000 (16:36 +0100)] 
Line up kind and type variables correctly when desugaring TH brackets

This bug was causing Trac #9199

(cherry picked from commit 571f0adccda687098d59f63524357f4ac98e72fb)

Conflicts:
testsuite/tests/th/all.T

5 years agoBetter debug printing
Simon Peyton Jones [Thu, 12 Jun 2014 15:35:37 +0000 (16:35 +0100)] 
Better debug printing

(cherry picked from commit b60df0fa017eac8800a3848650dbad09acb6f1b8)

5 years agoMake splitStrProdDmd (and similarly Use) more robust
Simon Peyton Jones [Mon, 30 Jun 2014 12:55:59 +0000 (07:55 -0500)] 
Make splitStrProdDmd (and similarly Use) more robust

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoRevert "Store IfExtNames for PatSyn matchers and wrappers in interface file."
Austin Seipp [Mon, 23 Jun 2014 09:26:01 +0000 (04:26 -0500)] 
Revert "Store IfExtNames for PatSyn matchers and wrappers in interface file."

This reverts commit e40bd13b5b509b76d61ae66247ded145d4af93ea.

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoRevert "Fix egregious instantiation bug in matchOneConLike (fixing Trac #9023)"
Austin Seipp [Mon, 23 Jun 2014 09:25:55 +0000 (04:25 -0500)] 
Revert "Fix egregious instantiation bug in matchOneConLike (fixing Trac #9023)"

This reverts commit d1c2a2784ffc120bdd8f1fccc9cc61933c0cc5d0.

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoRevert "Test Trac #9023"
Austin Seipp [Mon, 23 Jun 2014 09:25:46 +0000 (04:25 -0500)] 
Revert "Test Trac #9023"

This reverts commit f6e494231b2ad00fa073fc6623a876ffe40e900e.

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoTest Trac #9023
Simon Peyton Jones [Thu, 5 Jun 2014 11:26:24 +0000 (12:26 +0100)] 
Test Trac #9023

(cherry picked from commit 1b45c6b4959762209dbcabf3290feb8673a60b23)

5 years agoFix egregious instantiation bug in matchOneConLike (fixing Trac #9023)
Simon Peyton Jones [Thu, 5 Jun 2014 10:03:45 +0000 (11:03 +0100)] 
Fix egregious instantiation bug in matchOneConLike (fixing Trac #9023)

We simply weren't giving anything like the right instantiating types
to patSynInstArgTys in matchOneConLike.

To get these instantiating types would have involved matching the
result type of the pattern synonym with the pattern type, which is
tiresome.  So instead I changed ConPatOut so that instead of recording
the type of the *whole* pattern (in old field pat_ty), it not records
the *instantiating* types (in new field pat_arg_tys).  Then we canuse
TcHsSyn.conLikeResTy to get the pattern type when needed.

There are lots of knock-on incidental effects, but they mostly made
the code simpler, so I'm happy.

Conflicts:
compiler/typecheck/TcPat.lhs

(cherry picked from commit 1fc4f6b973a4fb14b2b15143b2774ec597b4da0f)

5 years agoStore IfExtNames for PatSyn matchers and wrappers in interface file.
Dr. ERDI Gergo [Tue, 27 May 2014 13:16:41 +0000 (21:16 +0800)] 
Store IfExtNames for PatSyn matchers and wrappers in interface file.
This way, the Ids for the matchers/wrappers are reused by importing
modules, and thus unfoldings are kept.

Also updates haddock submodule to accomodate tweaks in PatSyn representation

Conflicts:
compiler/typecheck/TcPatSyn.lhs
utils/haddock

(cherry picked from commit e0fbf1e3bc062b7ce3f1c515a135fd9f3d49e2ee)

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

(cherry picked from commit d8d97113c24e7216be36c9cdfc58e91f26528f06)

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

(cherry picked from commit 770e16fceee60db0c2f79e3b77f6fc619bc1d864)

5 years agoFix a serious, but rare, strictness analyser bug (Trac #9128)
Simon Peyton Jones [Wed, 11 Jun 2014 18:53:06 +0000 (19:53 +0100)] 
Fix a serious, but rare, strictness analyser bug (Trac #9128)

In a special case for trivial RHSs (see DmdAnal.unpackTrivial),
I'd forgotten to include a demand for the RHS itself.
See Note [Remember to demand the function itself].

Thanks to David Terei for guiding me to the bug,
at PLDI in Edinburgh.

(cherry picked from commit 7d9feb264a4fc3c15d1e5f88f2e7a04202ed9743)

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.

(cherry picked from commit 5b73dc5fda1941d51827ea72614782c10a355a3d)

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.

(cherry picked from commit 9f3e39d5f8686e511ffca406a6e056dec4095e53)

5 years agoFix up b84748121e777d
Austin Seipp [Mon, 23 Jun 2014 06:31:15 +0000 (01:31 -0500)] 
Fix up b84748121e777d

I forgot to amend this to my last commit.

Signed-off-by: Austin Seipp <austin@well-typed.com>
(cherry picked from commit 95f95ed6281adf9616d87b97470d68fb54c0b7f3)

5 years agoFix #9047
Austin Seipp [Mon, 23 Jun 2014 05:07:10 +0000 (00:07 -0500)] 
Fix #9047

Signed-off-by: Austin Seipp <austin@well-typed.com>
(cherry picked from commit b84748121e777d098198f2583d11a9424c1b1650)

5 years agoRevert "Fix obscure problem with using the system linker (#8935)"
Austin Seipp [Tue, 17 Jun 2014 22:09:02 +0000 (17:09 -0500)] 
Revert "Fix obscure problem with using the system linker (#8935)"

This reverts commit 72bd832eb87975c504654a65f9c88daaa478f677.

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoRelease notes
Austin Seipp [Mon, 9 Jun 2014 16:08:01 +0000 (11:08 -0500)] 
Release notes

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoShip xhtml, terminfo, haskeline (#8919)
Jens Petersen [Mon, 9 Jun 2014 13:41:36 +0000 (08:41 -0500)] 
Ship xhtml, terminfo, haskeline (#8919)

Signed-off-by: Austin Seipp <austin@well-typed.com>
(cherry picked from commit 4caadb7cbee5c176abb99df25c4cc1657ae57f40)

5 years ago7.8.3 release notes.
Austin Seipp [Mon, 9 Jun 2014 12:31:40 +0000 (07:31 -0500)] 
7.8.3 release notes.

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoFix obscure problem with using the system linker (#8935)
Simon Marlow [Sun, 8 Jun 2014 08:46:20 +0000 (09:46 +0100)] 
Fix obscure problem with using the system linker (#8935)

See Note [RTLD_LOCAL] for a summary of the problem and solution, and

(cherry picked from commit 2f8b4c9330b455d4cb31c186c747a7db12a69251)

5 years agoEmit error in case of duplicate GRE; fixes #7241
Yuras Shumovich [Thu, 5 Jun 2014 12:56:05 +0000 (07:56 -0500)] 
Emit error in case of duplicate GRE; fixes #7241

Signed-off-by: Austin Seipp <austin@well-typed.com>
(cherry picked from commit c226d25fef519db663d0c9efe7845637423f1dca)

Conflicts:
testsuite/tests/th/all.T

5 years agoFix compilation of cmm files with -outputdir (Trac #9050)
Yuras Shumovich [Thu, 1 May 2014 21:11:58 +0000 (00:11 +0300)] 
Fix compilation of cmm files with -outputdir (Trac #9050)

(cherry picked from commit 2a463ebeba4dff6793ae16707712f1e9245225e8)

5 years agoFix discarding of unreachable code in the register allocator (#9155)
Simon Marlow [Fri, 6 Jun 2014 08:52:13 +0000 (09:52 +0100)] 
Fix discarding of unreachable code in the register allocator (#9155)

A previous fix to this was wrong: f5879acd018494b84233f26fba828ce376d0f81d
and left some unreachable code behind.  So rather than try to be clever and
do this at the same time as the strongly-connected-component analysis, I'm
doing a separate reachability pass first.

(cherry picked from commit e577a52363ee7ee8a07f1d863988332ae8fbf2e4)

5 years agoAdd ".text.unlikely" to recognized code sections on Windows.
Niklas Larsson [Sun, 25 May 2014 09:54:13 +0000 (11:54 +0200)] 
Add ".text.unlikely" to recognized code sections on Windows.

Fixes #9080

Signed-off-by: Austin Seipp <austin@well-typed.com>
(cherry picked from commit 56ea745c3dd00c87ad86b80f91a31ced5e86e488)

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 agoFix missing unlockClosure() call in tryReadMVar (#9148)
Simon Marlow [Fri, 30 May 2014 07:47:26 +0000 (08:47 +0100)] 
Fix missing unlockClosure() call in tryReadMVar (#9148)

(cherry picked from commit 96a95f0513de785a185fd8a46c7ed2643f698295)

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 <austin@well-typed.com>
(cherry picked from commit b75d126e779e8690c675be84e8972dc023e04b9b)

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

(cherry picked from commit bc7d49a658a516679cc264502e72560c1d2c2314)

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)

(cherry picked from commit fc0ed8a7309e7cc863b8155fae6b57cb23331c44)

Conflicts:
testsuite/tests/codeGen/should_run/all.T

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 <austin@well-typed.com>
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 <austin@well-typed.com>
(cherry picked from commit b7278d3d7bbe384eee7538b1e50bb741e99fb01d)

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 <austin@well-typed.com>
(cherry picked from commit e597f5feb065c075c86715e24bf0ebd341fa8b9e)

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 <austin@well-typed.com>
(cherry picked from commit 5f5e326c3c310c4bceb2b0bce291d3a0a3fc30d6)

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 <austin@well-typed.com>
(cherry picked from commit 48e475e45f517896c6618d38a09b8d223f3d7585)

5 years agoTest Trac #8963
Simon Peyton Jones [Tue, 8 Apr 2014 15:28:56 +0000 (16:28 +0100)] 
Test Trac #8963

(cherry picked from commit cc3ccf9f47c7f4684cdd2b08d0e2acf50b69bc18)

Conflicts:
testsuite/tests/deriving/should_compile/all.T

5 years agoAllow a longer demand signature than arity
Simon Peyton Jones [Tue, 8 Apr 2014 15:20:11 +0000 (16:20 +0100)] 
Allow a longer demand signature than arity

See Note [Demand analysis for trivial right-hand sides] in DmdAnal.
This allows a function with arity 2 to have a DmdSig with 3 args;
which in turn had a knock-on effect, which showed up in the test for
Trac #8963.

In fact it seems entirely reasonable, so this patch removes the
WARN and CoreLint checks that were complaining.

(cherry picked from commit 848f595266268f578480ceb4ab1ce4938611c97e)

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.

(cherry picked from commit ab8bb4893be1896303f30d0f1adff8ea9c2470f6)

5 years agoMention TH pattern splices in 7.8.1 release notes
Christiaan Baaij [Mon, 28 Apr 2014 10:13:11 +0000 (12:13 +0200)] 
Mention TH pattern splices in 7.8.1 release notes

5 years agoStart 7.8.3 release notes
Austin Seipp [Mon, 28 Apr 2014 09:33:07 +0000 (04:33 -0500)] 
Start 7.8.3 release notes

There are already quite a few bugfixes, I'll fill them out shortly.

Signed-off-by: Austin Seipp <austin@well-typed.com>
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 <austin@well-typed.com>
(cherry picked from commit f17dcf09a5797bbefe22aef7d4c508d1672484df)

5 years agoCheck correct variable for NULL
Nicolas Trangez [Wed, 23 Apr 2014 18:37:51 +0000 (20:37 +0200)] 
Check correct variable for NULL

Issue discovered by Coverity scan, CID 43163. This should fix CID 43172 as a
side-effect as well.

Signed-off-by: Austin Seipp <austin@well-typed.com>
(cherry picked from commit 6ed7123dcc24c343a1ece85c7aa72ac1c34e6aff)

5 years agoFix potential out-of-bound memory access
Nicolas Trangez [Wed, 23 Apr 2014 18:27:04 +0000 (20:27 +0200)] 
Fix potential out-of-bound memory access

Issue discovered by Coverity scan, CID 43165.

Signed-off-by: Austin Seipp <austin@well-typed.com>
(cherry picked from commit fa0cbd297ba12e02273efcaa5f52fe76e10b7126)

5 years agoCheck return value of sigaction
Nicolas Trangez [Wed, 23 Apr 2014 18:06:15 +0000 (20:06 +0200)] 
Check return value of sigaction

Issue discovered by Coverity scan, CID 43142.

Signed-off-by: Austin Seipp <austin@well-typed.com>
(cherry picked from commit f2595fd9d03803874df792072292d792a2c03bce)

5 years agorts: Fix possible int overflow in resize_nursery
Austin Seipp [Wed, 23 Apr 2014 08:41:44 +0000 (03:41 -0500)] 
rts: Fix possible int overflow in resize_nursery

n_capabilities is declared as unsigned int (32bit), and so multiplication
is 32-bit before being stored in a 64bit integer (StgWord).

Instead, cast n_capabilities to StgWord before multiplying.

Discovered by Coverity. CID 43164.

Signed-off-by: Austin Seipp <austin@well-typed.com>
(cherry picked from commit 111b8454cc1b64da5b9816b89d79f44a8ae24355)

5 years agorts: Fix potential memory leak in ProfHeap.c
Austin Seipp [Wed, 23 Apr 2014 07:14:15 +0000 (02:14 -0500)] 
rts: Fix potential memory leak in ProfHeap.c

Discovered by Coverity. CID 43166.

Signed-off-by: Austin Seipp <austin@well-typed.com>
(cherry picked from commit 95da409719bab6f92229dc1a632c471e248d2fdd)

5 years agoTest Trac #8985
Simon Peyton Jones [Mon, 14 Apr 2014 12:06:22 +0000 (13:06 +0100)] 
Test Trac #8985

(cherry picked from commit ff9f9a7f2e227fcda7b8a2f52ec8be66de2e76cd)

5 years agoHonour the untouchability of kind variables
Simon Peyton Jones [Mon, 14 Apr 2014 12:03:40 +0000 (13:03 +0100)] 
Honour the untouchability of kind variables

Trac #8985 showed up a major shortcoming in the kind unifier: it was
ignoring untoucability.  This has unpredictably-bad consequences;
notably, the skolem-escape check can fail.

There were two things wrong
 * TcRnMonad.isTouchableTcM was returning a constant value for kind variables
   (wrong), and even worse the constant was back-to-front (it was always False).

 * We weren't even calling isTouchableTcM in TcType.unifyKindX.

I'm not sure how this ever worked.

Merge to 7.8.3 in due course.

(cherry picked from commit e7f0ae7ff4f2199abe42f20bac825a7802bff466)

5 years agoSimplify and tidy up the handling of tuple names
Simon Peyton Jones [Fri, 4 Apr 2014 07:41:35 +0000 (08:41 +0100)] 
Simplify and tidy up the handling of tuple names

This fixes Trac #8954.

There were actually three places where tuple occ-names
were parsed:
  - IfaceEnv.lookupOrigNameCache
  - Convert.isBuiltInOcc
  - OccName.isTupleOcc_maybe

I combined all three into TysWiredIn.isBuiltInOcc_maybe
Much nicer.

(cherry picked from commit 750271e61bdbaad50c19176406512e79abe404a8)

Conflicts:
testsuite/tests/th/all.T

5 years agoZonk the existential type variables in tcPatSynDecl
Simon Peyton Jones [Tue, 8 Apr 2014 08:42:51 +0000 (09:42 +0100)] 
Zonk the existential type variables in tcPatSynDecl

This was just an omission, which showed up as Trac #8966

(cherry picked from commit 4dc9f9869bfc82fdb8bd61864859007873ebcc27)

5 years agoKill whitespace after cpp's `-I` flag
Herbert Valerio Riedel [Mon, 21 Apr 2014 14:55:11 +0000 (16:55 +0200)] 
Kill whitespace after cpp's `-I` flag

This clean-up is in a similiar spirit as 574ef4293b8676.

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
(cherry picked from commit 4ab8fc55eb6119dbba2f487c5a01d30a7c6ae113)

5 years agoghc: Do not add a space in '-U __PIC__'
Austin Seipp [Mon, 21 Apr 2014 12:22:50 +0000 (07:22 -0500)] 
ghc: Do not add a space in '-U __PIC__'

GHC previously introduced a space here. However, this can in some cases
be interpreted as "-U __PIC__" - note that in shell, the -U would still
be recognized with an argument, but the argument would be " __PIC__",
with a space in front, as opposed to the single string '__PIC__'.

In practice most tools seem to handle this OK. But the Coverity Scan
analysis tool does not: it errors on the fact that ' __PIC__' is an
invalid CPP name to undefine.

With this, it seems the Coverity analysis tool can easily analyze the
entire GHC build.

Signed-off-by: Austin Seipp <austin@well-typed.com>
(cherry picked from commit 574ef4293b867609f2d28d85747e01f3ac0d052d)

5 years agoAdd the powerpc64le architecture
Colin Watson [Sat, 12 Apr 2014 01:13:48 +0000 (02:13 +0100)] 
Add the powerpc64le architecture

This is ArchUnknown for now, as it requires some porting work over and
above powerpc64 due to such things as the different function calling
sequence in the ELFv2 ABI.  For now, an unregisterised port is better
than nothing.

Signed-off-by: Colin Watson <cjwatson@debian.org>
Signed-off-by: Austin Seipp <austin@well-typed.com>
(cherry picked from commit 8586f600613a6a99fee8fe707b00adab1a340641)

5 years agoBe less untruthful about the prototypes of external functions
Colin Watson [Sat, 12 Apr 2014 00:55:07 +0000 (01:55 +0100)] 
Be less untruthful about the prototypes of external functions

GHC's generated C code uses dummy prototypes for foreign imports.  At the
moment these all claim to be (void), i.e. functions of zero arguments.  On
most platforms this doesn't matter very much: calls to these functions put
the parameters in the usual places anyway, and (with the exception of
varargs) things just work.

However, the ELFv2 ABI on ppc64 optimises stack allocation
(http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01149.html): a call to a
function that has a prototype, is not varargs, and receives all parameters
in registers rather than on the stack does not require the caller to
allocate an argument save area.  The incorrect prototypes cause GCC to
believe that all functions declared this way can be called without an
argument save area, but if the callee has sufficiently many arguments then
it will expect that area to be present, and will thus corrupt the caller's
stack.  This happens in particular with calls to runInteractiveProcess in
libraries/process/cbits/runProcess.c.

The simplest fix appears to be to declare these external functions with an
unspecified argument list rather than a void argument list.  This is no
worse for platforms that don't care either way, and allows a successful
bootstrap of GHC 7.8 on little-endian Linux ppc64 (which uses the ELFv2
ABI).

Fixes #8965

Signed-off-by: Colin Watson <cjwatson@debian.org>
Signed-off-by: Austin Seipp <austin@well-typed.com>
(cherry picked from commit 5a31f231eebfb8140f9b519b166094d9d4fc2d79)

5 years agoSmall issue with signatures in a TH splice (fixes Trac #8932)
Simon Peyton Jones [Mon, 7 Apr 2014 14:22:11 +0000 (15:22 +0100)] 
Small issue with signatures in a TH splice (fixes Trac #8932)

(cherry picked from commit d8d798b1b33ab0593ed03f193360b8725ba2c2ba)

Conflicts:
testsuite/tests/th/all.T

5 years agoFix #8641, creating directories when we have stubs.
Edward Z. Yang [Fri, 11 Apr 2014 01:28:11 +0000 (18:28 -0700)] 
Fix #8641, creating directories when we have stubs.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
(cherry picked from commit c7498bbdaa74dadd976c75c4e303c2050aa78277)