ghc.git
3 years agoMake demand analysis understand catch
Simon Peyton Jones [Wed, 6 Jan 2016 17:40:09 +0000 (17:40 +0000)] 
Make demand analysis understand catch

As Trac #11222, and #10712 note, the strictness analyser
needs to be rather careful about exceptions.  Previously
it treated them as identical to divergence, but that
won't quite do.

See Note [Exceptions and strictness] in Demand, which
explains the deal.

Getting more strictness in 'catch' and friends is a
very good thing.  Here is the nofib summary, keeping
only the big ones.

--------------------------------------------------------------------------------
        Program           Size    Allocs   Runtime   Elapsed  TotalMem
--------------------------------------------------------------------------------
          fasta          -0.1%     -6.9%     -3.0%     -3.0%     +0.0%
            hpg          -0.1%     -2.0%     -6.2%     -6.2%     +0.0%
       maillist          -0.1%     -0.3%      0.08      0.09     +1.2%
reverse-complem          -0.1%    -10.9%     -6.0%     -5.9%     +0.0%
         sphere          -0.1%     -4.3%      0.08      0.08     +0.0%
           x2n1          -0.1%     -0.0%      0.00      0.00     +0.0%
--------------------------------------------------------------------------------
            Min          -0.2%    -10.9%    -17.4%    -17.3%     +0.0%
            Max          -0.0%     +0.0%     +4.3%     +4.4%     +1.2%
 Geometric Mean          -0.1%     -0.3%     -2.9%     -3.0%     +0.0%

On the way I did quite a bit of refactoring in Demand.hs

3 years agoTurn AThing into ATcTyCon, in TcTyThing
Simon Peyton Jones [Wed, 6 Jan 2016 17:33:42 +0000 (17:33 +0000)] 
Turn AThing into ATcTyCon, in TcTyThing

This change tidies up and simplifies (a bit) the knot-tying
when kind-checking groups of type and class declarations.

The trouble (shown by Trac #11356) was that we wanted an error message
(a kind-mismatch) that involved a type mentioned a (AThing k), which
blew up.

Since we now seem to have TcTyCons, I decided to use them here.
It's still not great, but it's easier to understand and more robust.

3 years agoUse an Implication in 'deriving' error
Simon Peyton Jones [Wed, 6 Jan 2016 17:22:02 +0000 (17:22 +0000)] 
Use an Implication in 'deriving' error

Trac #11437 showed that erroneous constraints from a 'deriving'
clause need to be wrapped in an Implication to properly scope
their skolems.

The main change is in TcDeriv.simplifyDeriv; the call to
buildImplicationFor is new.

3 years agoRefactor simpl_top
Simon Peyton Jones [Wed, 6 Jan 2016 17:17:11 +0000 (17:17 +0000)] 
Refactor simpl_top

simpl_top was being polluted with Safe Haskell stuff which was only
used in one of its four calls.  This moves the Safe Haskell stuff
to the place it is actually used

3 years agoInline solveTopConstraints
Simon Peyton Jones [Wed, 6 Jan 2016 17:15:47 +0000 (17:15 +0000)] 
Inline solveTopConstraints

It was only called in one place; easier to inline it

3 years agoComment wibble
Simon Peyton Jones [Wed, 6 Jan 2016 17:14:41 +0000 (17:14 +0000)] 
Comment wibble

3 years agoTidy up tidySkolemInfo
Simon Peyton Jones [Wed, 6 Jan 2016 17:11:34 +0000 (17:11 +0000)] 
Tidy up tidySkolemInfo

Previously tidySkolemInfo used tidyOpenType, and returned a new
TidyEnv.  But that's not needed any more, because all the skolems
should be in scope in the constraint tree.

I also removed a (now-unnecessary) field of UnifyForAllSkol

3 years agoSpelling in a comment
Simon Peyton Jones [Wed, 6 Jan 2016 17:04:47 +0000 (17:04 +0000)] 
Spelling in a comment

3 years agoTiny refactor
Simon Peyton Jones [Wed, 6 Jan 2016 08:17:01 +0000 (08:17 +0000)] 
Tiny refactor

3 years agoRemove unused export
Simon Peyton Jones [Wed, 6 Jan 2016 08:16:34 +0000 (08:16 +0000)] 
Remove unused export

3 years agousers guide: Tweak wording of RTS -Nmax description
Ben Gamari [Wed, 6 Jan 2016 23:08:52 +0000 (00:08 +0100)] 
users guide: Tweak wording of RTS -Nmax description

3 years agoRewrite announce file
Ben Gamari [Fri, 17 Jul 2015 17:47:56 +0000 (19:47 +0200)] 
Rewrite announce file

Incredibly enough this hasn't been touched since 6.10.1

3 years agousers guide: Add links to release notes
Ben Gamari [Wed, 6 Jan 2016 22:59:30 +0000 (23:59 +0100)] 
users guide: Add links to release notes

3 years agousers guide: Add documentation for custom compile-time errors
Ben Gamari [Wed, 6 Jan 2016 22:56:44 +0000 (23:56 +0100)] 
users guide: Add documentation for custom compile-time errors

3 years agoFall back on ghc-stage2 when using Windows' GHCi driver
RyanGlScott [Wed, 6 Jan 2016 22:10:54 +0000 (23:10 +0100)] 
Fall back on ghc-stage2 when using Windows' GHCi driver

Reviewers: austin, hvr, bgamari, thomie

Reviewed By: thomie

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

3 years agoAdd a note describing the protocol for adding a language extension
Ben Gamari [Wed, 6 Jan 2016 19:00:16 +0000 (20:00 +0100)] 
Add a note describing the protocol for adding a language extension

Reviewers: hvr, thomie, austin

Reviewed By: austin

Subscribers: duncan

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

GHC Trac Issues: #8176, #4437

3 years agoBump Cabal and Haddock to fix #11308
Ben Gamari [Wed, 6 Jan 2016 13:42:22 +0000 (14:42 +0100)] 
Bump Cabal and Haddock to fix #11308

Bump Cabal and Haddock submodules such that they both support GCC-style
response files on Windows.

3 years agoChange Template Haskell representation of GADTs.
Jan Stolarek [Tue, 5 Jan 2016 18:18:44 +0000 (19:18 +0100)] 
Change Template Haskell representation of GADTs.

Previous representation of GADTs in TH was not expressive enough
to express possible GADT return types. See #11341

Test Plan: ./validate

Reviewers: goldfire, austin, bgamari

Subscribers: thomie, RyanGlScott

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

GHC Trac Issues: #11341

3 years agoRestore old GHC generics behavior vis-à-vis Fixity
RyanGlScott [Wed, 6 Jan 2016 11:05:05 +0000 (12:05 +0100)] 
Restore old GHC generics behavior vis-à-vis Fixity

Phab:D493 accidentally changed the way GHC generics looks up `Fixity`
information when deriving `Generic` or `Generic1`. Before, a `Fixity` of
`Infix` would be given only if a data constructor was declared infix,
but now, `Infix` is given to any data constructor that has a fixity
declaration (not to be confused with being declared infix!). This commit
reverts back to the original behavior for consistency's sake.

Fixes #11358.

Test Plan: ./validate

Reviewers: kosmikus, dreixel, austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

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

GHC Trac Issues: #11358

3 years agorelnotes: Note dropped support for Windows XP and earlier
Ben Gamari [Wed, 6 Jan 2016 11:02:32 +0000 (12:02 +0100)] 
relnotes: Note dropped support for Windows XP and earlier

3 years agoExtend ghc environment file features
Duncan Coutts [Tue, 5 Jan 2016 21:13:26 +0000 (22:13 +0100)] 
Extend ghc environment file features

A set of changes to enable local ghc env files to be useful for tools
like cabal. Ultimately it will allow cabal to maintain a ghc env file so
that users can simple run ghc or ghci in a project directory and get the
expected environment of the project.

Change the name of .ghc.environment files to include the platform and
ghc version, e.g. .ghc.environment.x86_64-linux-7.6.3, since their
content is version specific. Strictly speaking this is not backwards
compatible, but we think this feature is not widely used yet.

"Look up" for a local env file, like the behaviour of git/darcs etc. So
you can be anywhere within a project and get the expected environment.

Don't look for local env files when -hide-all-packages is given.

Extend the syntax of env files to allow specifying package dbs too.

Test Plan:
Currently completely untested. Compiles, that is all.
Sorry, have to disappear for the hols.

Reviewers: hvr, ezyang, austin, bgamari

Reviewed By: ezyang, bgamari

Subscribers: thomie

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

GHC Trac Issues: #11268

3 years agoStgCmmForeign: Break up long line
Ben Gamari [Sat, 2 Jan 2016 16:22:11 +0000 (17:22 +0100)] 
StgCmmForeign: Break up long line

3 years agoStgCmmForeign: Push local register creation into code generation
Ben Gamari [Tue, 5 Jan 2016 21:10:28 +0000 (22:10 +0100)] 
StgCmmForeign: Push local register creation into code generation

The interfaces to {save,load}ThreadState were quite messy due to the
need to pass in local registers (produced with draws from a unique
supply) since they were used from both FCode and UniqSM.

This, however, is entirely unnecessary as we already have an
abstraction to capture this effect: MonadUnique. Use it.

This is part of an effort to properly represent stack unwinding
information
for foreign calls.

Test Plan: validate

Reviewers: austin, simonmar

Reviewed By: simonmar

Subscribers: thomie

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

3 years agoAdd Cabal synopses and descriptions
Ben Gamari [Tue, 5 Jan 2016 21:10:01 +0000 (22:10 +0100)] 
Add Cabal synopses and descriptions

Various people (myself included) have complained about the lack of
useful descriptions for the various packages included in GHC's source
tree. Fix this.

Test Plan: Validate

Reviewers: austin, thomie

Reviewed By: thomie

Subscribers: angerman, ezyang

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

3 years agoRemove -Wtoo-many-guards from default flags (fixes #11316)
George Karachalias [Tue, 5 Jan 2016 14:59:49 +0000 (15:59 +0100)] 
Remove -Wtoo-many-guards from default flags (fixes #11316)

Since #11316 indicates that having flag `-Wtoo-many-guards`
enabled by default causes issues, the simplest thing is to
remove it. This patch removes it from the default list, it
updates the docs and removes the suppression flags for
`T783` and `types/OptCoercion.hs`

Test Plan: validate

Reviewers: bgamari, austin, goldfire

Subscribers: thomie

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

GHC Trac Issues: #11316

3 years agoghc.mk: Add reference to Trac #5987
Ben Gamari [Tue, 5 Jan 2016 14:09:57 +0000 (15:09 +0100)] 
ghc.mk: Add reference to Trac #5987

3 years agoRelease notes: Mention remote GHCi
Ben Gamari [Tue, 5 Jan 2016 13:21:01 +0000 (14:21 +0100)] 
Release notes: Mention remote GHCi

3 years agoAdd (failing) test case for #11347
Joachim Breitner [Tue, 5 Jan 2016 09:56:47 +0000 (10:56 +0100)] 
Add (failing) test case for #11347

Unfortunately, I could not add the expected error message, so if someone
accidentally fixes this bug, this test will still be failing (no harm).
But maybe someone stumbles over it then and can update the expected
output.

3 years agoAvoid generating guards for CoPats if possible (Addresses #11276)
George Karachalias [Mon, 4 Jan 2016 20:02:26 +0000 (21:02 +0100)] 
Avoid generating guards for CoPats if possible (Addresses #11276)

When translating a `CoPat` to `PmPat` check whether the wrapper
is just a hole or a cast with refl. In these cases we can safely
drop the wrapper and generate less guard patterns. Fixes T11276.

Test Plan: validate

Reviewers: bgamari, austin

Subscribers: thomie

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

GHC Trac Issues: #11276

3 years agoBuild system: delete ghc-pwd
Thomas Miedema [Mon, 4 Jan 2016 17:29:49 +0000 (18:29 +0100)] 
Build system: delete ghc-pwd

On Windows, with msys2, `pwd` works (as can be seen by the use of `pwd`
that slipped into the validate script), so there is really no need for
`ghc-pwd` anymore.

Test Plan: try it

Reviewers: austin, bgamari, Phyx

Reviewed By: Phyx

Subscribers: Phyx, erikd

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

3 years agousers_guide: Add ghci-cmd directive
Ben Gamari [Mon, 4 Jan 2016 15:43:02 +0000 (16:43 +0100)] 
users_guide: Add ghci-cmd directive

Note only does this make the markup cleaner and more semantic, but it
clears up some warnings and enables proper hyperlinks. Yay Sphinx!

While I was at it I generally cleaned up the markup

Test Plan: Read it

Reviewers: hvr, thomie, austin

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

3 years agoRewrite Haddocks for GHC.Base.const
Ben Gamari [Mon, 4 Jan 2016 15:42:08 +0000 (16:42 +0100)] 
Rewrite Haddocks for GHC.Base.const

Test Plan: Read it

Reviewers: austin, hvr, #core_libraries_committee

Subscribers: thomie

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

GHC Trac Issues: #11314

3 years agoLinker: Move helpers to #ifdef
Ben Gamari [Mon, 4 Jan 2016 15:36:33 +0000 (16:36 +0100)] 
Linker: Move helpers to #ifdef

Otherwise Clang seems to complain about unused static definitions.

3 years agoUpdate .mailmap [skip ci]
Thomas Miedema [Sat, 19 Dec 2015 10:41:44 +0000 (11:41 +0100)] 
Update .mailmap [skip ci]

3 years agoLinker: ARM: Don't change to BLX if jump needed veneer
Ben Gamari [Mon, 4 Jan 2016 00:39:39 +0000 (01:39 +0100)] 
Linker: ARM: Don't change to BLX if jump needed veneer

Since we produce ARM veneer.

3 years agoAdd test for #10379
Thomas Miedema [Sun, 3 Jan 2016 18:57:42 +0000 (19:57 +0100)] 
Add test for #10379

3 years agoOmit TEST=T10697_decided_3 WAY=ghci
Thomas Miedema [Fri, 1 Jan 2016 11:46:37 +0000 (12:46 +0100)] 
Omit TEST=T10697_decided_3 WAY=ghci

3 years agoLinker: Use contiguous mmapping on ARM
Ben Gamari [Sun, 3 Jan 2016 12:21:39 +0000 (13:21 +0100)] 
Linker: Use contiguous mmapping on ARM

ARM has a 24-bit relative jump offset just like PowerPC. Ensure that
symbols don't get too far from their symbol extras.

See #11340.

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

3 years agoLinker: Make debugging output a bit more readable
Ben Gamari [Sun, 3 Jan 2016 12:31:20 +0000 (13:31 +0100)] 
Linker: Make debugging output a bit more readable

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

3 years agoLinker: ARM: Refactor relocation handling
Ben Gamari [Sun, 3 Jan 2016 12:27:58 +0000 (13:27 +0100)] 
Linker: ARM: Refactor relocation handling

This refactors handling of R_ARM_CALL, R_ARM_JUMP24, R_ARM_MOVW_NC, and
R_ARM_MOVT relocations to follow the LLVM LLD implementation. The "ELF
for ARM"  specification is (like most documents of this type, sadly) a
bit vague in some areas, so it seems safest to follow the behavior of a
trusted implementation like LLD, which is remarkable in its clarity..

Moreover, we now throw a proper error message when a jump to a symbol
extra is out of range. This is great improvement over the previous
behavior, which ended in a segfault.

See #11340.

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

3 years agoLinker: ARM: Ensure that cache flush covers all symbol extras
Ben Gamari [Sun, 3 Jan 2016 12:25:37 +0000 (13:25 +0100)] 
Linker: ARM: Ensure that cache flush covers all symbol extras

Previously part of the last symbol extra wasn't covered.

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

3 years agoTest Trac #11336
Simon Peyton Jones [Sat, 2 Jan 2016 22:09:21 +0000 (22:09 +0000)] 
Test Trac #11336

3 years agoAnnDotDot missing for Pattern Synonym export
Alan Zimmerman [Sat, 2 Jan 2016 10:16:20 +0000 (12:16 +0200)] 
AnnDotDot missing for Pattern Synonym export

For the following code fragment

    {-# LANGUAGE PatternSynonyms #-}

    module ExportSyntax ( A(.., NoA), Q(F,..), G(T,..,U)) where

The second and third .. are missing AnnDotdot annotations.

Closes #11332

3 years agomk/config.mk.in: drop unused CONF_CC_OPTS for ia64
Sergei Trofimovich [Fri, 1 Jan 2016 22:43:18 +0000 (22:43 +0000)] 
mk/config.mk.in: drop unused CONF_CC_OPTS for ia64

There is CONF_CC_OPTS_STAGE$(N) but not CONF_CC_OPTS
thus option does not work for a while.

Signed-off-by: Sergei Trofimovich <siarheit@google.com>
3 years agoAPI Annotations: AnnTilde missing
Alan Zimmerman [Fri, 1 Jan 2016 16:59:52 +0000 (18:59 +0200)] 
API Annotations: AnnTilde missing

In T10689a.hs, the fragment

    data instance Sing (z :: [a])
      = z ~ '[] =>
        SNil
      | forall (m :: a)
               (n :: [a]). z ~ (:) m n =>
        SCons (Sing m) (Sing n)

ends up with the AnnTilde annotations for the two tildes not attached to
the final AST.

This patch moves the AnnTilde to the right place.

Closes #11321

3 years agoAdd strictness for runRW#
Simon Peyton Jones [Thu, 31 Dec 2015 22:25:31 +0000 (22:25 +0000)] 
Add strictness for runRW#

runRW# isn't inlined until CorePrep, so it's good to expose its
strictness.  Moreover, if we don't we can get obscure failures
in coreToStg; see Note [runRW arg] in CorePrep.

This fixes Trac #11291, and makes DfltProb1 compile with -O
always in order to expose it more vigorously

3 years agoUpdate Cabal submodule, Fixes #11326
Alan Zimmerman [Fri, 1 Jan 2016 09:11:57 +0000 (11:11 +0200)] 
Update Cabal submodule, Fixes #11326

Troublesome commit in Cabal was reverted.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reviewers: austin, goldfire, bgamari

Subscribers: goldfire, thomie, erikd

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

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

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

  -D  name[=value]

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

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

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

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

A use like

   #if __GLASGOW_HASKELL_TH__==YES
   {-# LANGUAGE TemplateHaskell #-}
   #endif

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

   #if __GLASGOW_HASKELL_TH__
   {-# LANGUAGE TemplateHaskell #-}
   #endif

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

`__GLASGOW_HASKELL_TH__ was originally introduced via D396 / #9734.

Fixes #11322

Reviewed By: austin

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

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

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

So there's no need to define it twice.

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

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

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

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

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

Observed failure on ia64 as:

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

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

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

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

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

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

Test Plan: validate

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

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

GHC Trac Issues: #11245

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

This updates the haddock submodule

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

Detected by sphinx as:
    ERROR: Unexpected indentation.

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

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

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

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

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

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

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

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

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

As suggested by @thomie.

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

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

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

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

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

Reviewers: austin, bgamari, hvr

Subscribers: thomie

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

GHC Trac Issues: #11305

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

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

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

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

https://git.haskell.org/packages/Cabal.git/commitdiff/5d20551e44e565bad6335fa213fc4ad592db7225

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

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

Test Plan: Validate

Reviewers: austin

Subscribers: thomie

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

GHC Trac Issues: #11303

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

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

Test Plan: Validate

Reviewers: austin, thomie

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

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

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

Test Plan: validate

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

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

GHC Trac Issues: #11303

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

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

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

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

This patch also fixes T10728 under Windows.

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

Reviewed By: #ghc_windows_task_force, Phyx, bgamari

Subscribers: Phyx, thomie

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

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

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

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

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

Fixes #11292.

Test Plan: Validate with T11292

Reviewers: thomie, austin, bgamari

Reviewed By: bgamari

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

GHC Trac Issues: #11292

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

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

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: hvr, thomie

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

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

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

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

Reviewers: mpickering, austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

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

GHC Trac Issues: #11283

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

Test Plan: Validate

Reviewers: austin, hvr

Reviewed By: hvr

Subscribers: thomie

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

GHC Trac Issues: #9614

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

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

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

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

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

Reviewers: austin, thomie, erikd, bgamari

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

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

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

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

/cc @ndmitchell

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

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

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

and update changelog.md

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

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

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

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

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

Reviewers: simonmar, bgamari, austin, thomie, ezyang

Reviewed By: bgamari, thomie, ezyang

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

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

Test Plan: Validate with T12299

Reviewers: hsyl20, austin, erikd

Subscribers: thomie

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

GHC Trac Issues: #11299

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

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

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

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

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

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

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

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

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

Test Plan: validate

Reviewers: simonmar, erikd, austin, bgamari

Reviewed By: austin, bgamari

Subscribers: thomie

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

GHC Trac Issues: #11269

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

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

Expected behaviour:

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

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

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

    - Issue a warning about the simplification that happened.

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

Test Plan: validate

Reviewers: goldfire, austin, hvr, bgamari

Reviewed By: bgamari

Subscribers: mpickering, thomie

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

GHC Trac Issues: #11195