ghc.git
6 years agoUpdate `Cabal` to 1.18.1.2 (again)
Herbert Valerio Riedel [Thu, 14 Nov 2013 10:17:31 +0000 (11:17 +0100)] 
Update `Cabal` to 1.18.1.2 (again)

Cabal was already updated to 1.18.1.2. last month, but then got reverted
by accident by 06aac68dee100b21dc7d304fa90d9baa423507a0

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
6 years agoFix bug in LLVM code generator
Ben Lippmeier [Wed, 6 Nov 2013 02:05:52 +0000 (13:05 +1100)] 
Fix bug in LLVM code generator

The bitcast operation always needs a type for the source.

6 years agoMake the fields in NameCache strict
Patrick Palka [Sat, 9 Nov 2013 19:23:46 +0000 (14:23 -0500)] 
Make the fields in NameCache strict

We've already been making sure to strictly modify the global name cache
in order to avoid space leaks.  However, that does us little good if the
fields of the name cache are not made strict as well.

6 years agoTurn NameCacheUpdater into a newtype
Patrick Palka [Sat, 9 Nov 2013 19:23:15 +0000 (14:23 -0500)] 
Turn NameCacheUpdater into a newtype

6 years agoRemove unnecessary and deprecated inclusions of Typeable.h
Patrick Palka [Fri, 8 Nov 2013 22:27:50 +0000 (17:27 -0500)] 
Remove unnecessary and deprecated inclusions of Typeable.h

The build system would've complained loudly about these inclusions if it
weren't for #8527.

6 years agoRemove old workaround for containers <= 0.3
Patrick Palka [Fri, 8 Nov 2013 22:15:26 +0000 (17:15 -0500)] 
Remove old workaround for containers <= 0.3

6 years agoMake type-level evaluation work with :kind!
Iavor S. Diatchki [Wed, 13 Nov 2013 00:36:23 +0000 (16:36 -0800)] 
Make type-level evaluation work with :kind!

The main change is to add a case to `reduceTyFamApp_maybe` to evaluate
built-in type constructors (e.g., (+), (*), and friends).

To avoid problems with recursive modules, I moved the definition of
TcBuiltInSynFamily from `FamInst` to `FamInstEnv`.  I am still not sure if
this is the right place.

There is also a wibble that it'd be nice to fix:

when we evaluate a built-in type function, using`sfMatchFam`, we get
a `TcCoercion`.  However, `reduceTyFamApp_maybe` needs a `Corecion`.
I couldn't find a nice way to convert between the two, so I resorted to
a bit of hack (marked with `XXX`).

The hack is that we happen to know that the built-in constructors for
the type-nat functions always return coercions of shape `TcAxiomRuleCo`,
with no assumptions, so it easy to convert `TcCoercion` to `Coercion`
in this one case.  This is enough to make things work, but it is clearly
a cludge.

6 years agoFurther refactoring to the tuple-typechecking patch
Simon Peyton Jones [Tue, 12 Nov 2013 18:11:14 +0000 (18:11 +0000)] 
Further refactoring to the tuple-typechecking patch

6 years agoMake exprType work correctly in the presnce of type bindings (Trac #8522)
Simon Peyton Jones [Tue, 12 Nov 2013 15:10:01 +0000 (15:10 +0000)] 
Make exprType work correctly in the presnce of type bindings (Trac #8522)

6 years agoImprove typechecking of tuples (Trac #8514)
Simon Peyton Jones [Tue, 12 Nov 2013 15:09:15 +0000 (15:09 +0000)] 
Improve typechecking of tuples (Trac #8514)

6 years agoImprove eta expansion (again)
Simon Peyton Jones [Tue, 12 Nov 2013 13:12:16 +0000 (13:12 +0000)] 
Improve eta expansion (again)

The presenting issue was that we were never eta-expanding

    f (\x -> case x of (a,b) -> \s -> blah)

and that meant we were allocating two lambdas instead of one.
See Note [Eta expanding lambdas] in SimplUtils.

However I didn't want to eta expand the lambda, and then try all over
again for tryEtaExpandRhs.  Yet the latter is important in the context
of a let-binding it can do simple arity analysis.  So I ended up
refactoring CallCtxt so that it tells when we are on the RHS of a let.

I also moved findRhsArity from SimplUtils to CoreArity.

Performance increases nicely. Here are the ones where allocation improved
by more than 0.5%. Notice the nice decrease in binary size too.

--------------------------------------------------------------------------------
        Program           Size    Allocs   Runtime   Elapsed  TotalMem
--------------------------------------------------------------------------------
           ansi          -2.3%     -0.9%      0.00      0.00     +0.0%
           bspt          -2.1%     -9.7%      0.01      0.01    -33.3%
          fasta          -1.8%    -11.7%     -3.4%     -3.6%     +0.0%
            fft          -1.9%     -1.3%      0.06      0.06    +11.1%
reverse-complem          -1.9%    -18.1%     -1.9%     -2.8%     +0.0%
         sphere          -1.8%     -4.5%      0.09      0.09     +0.0%
      transform          -1.8%     -2.3%     -4.6%     -3.1%     +0.0%
--------------------------------------------------------------------------------
            Min          -3.0%    -18.1%    -13.9%    -14.6%    -35.7%
            Max          -1.3%     +0.0%     +7.7%     +7.7%    +50.0%
 Geometric Mean          -1.9%     -0.6%     -2.1%     -2.1%     -0.2%

6 years agoFix egregious omission in CSE (Trac #5996)
Simon Peyton Jones [Tue, 12 Nov 2013 12:59:15 +0000 (12:59 +0000)] 
Fix egregious omission in CSE (Trac #5996)

This patch fixes a bad omission in CSE, thanks to 'michaelt' for spotting
it, and correctly identifying the fix (in cseRhs).  The trouble was with
   x1 = C a b
   x2 = C x1 b
   y1 = C a b
   y2 = C y1 b
we were not commoning up y2=x2, because we failed to substitute y1:=x1,
so y2's RHS looked different to x2's

I also refactoring, so taht the cs_map in a CSEnv map is
       cs_map    :: CoreMap (OutExpr, Id)
instead of
       cs_map    :: CoreMap (OutExpr, OutExpr)
Much nicer!

This doesn't make much difference to allocation, but it gives a surprisingly
big benefit to binary size.

--------------------------------------------------------------------------------
        Program           Size    Allocs   Runtime   Elapsed  TotalMem
--------------------------------------------------------------------------------
           ansi          -1.7%     -0.8%      0.00      0.00     +0.0%
           bspt          -1.6%     -1.5%      0.01      0.01     +0.0%
      cacheprof          -1.8%     -0.2%     +1.6%     +1.9%     +2.7%
            fft          -1.4%     -1.3%      0.06      0.06    +11.1%
            ida          -1.4%     -1.0%      0.12      0.12     +0.0%
           rfib          -1.4%     -0.1%      0.03      0.03     +0.0%
            scs          -1.6%     -0.1%     +1.5%     +1.5%     +0.0%
  spectral-norm          -1.3%     -0.1%     -0.2%     -0.2%     +0.0%
            tak          -1.4%     -0.1%      0.02      0.02     +0.0%
        veritas          -1.4%     -0.1%      0.00      0.00     +0.0%
--------------------------------------------------------------------------------
            Min          -2.5%     -1.5%    -11.8%    -11.8%     -8.0%
            Max          -1.0%     +0.0%     +2.7%     +2.5%    +11.1%
 Geometric Mean          -1.3%     -0.1%     -2.6%     -2.6%     +0.0%

6 years agoWarn if you use ANN annotations with a stage-1 compiler (Trac #4268)
Simon Peyton Jones [Mon, 11 Nov 2013 08:52:51 +0000 (08:52 +0000)] 
Warn if you use ANN annotations with a stage-1 compiler (Trac #4268)

This makes us give a civilised warning when we hit an
  {-# ANN f foo #-}
pragma in a stage-1 compiler.

We decided that, since it's a pragma, it does not need a language
extension flag to enable it.

6 years agoMake -XTemplateHaskell an error in a stage-1 compiler (except with -M)
Simon Peyton Jones [Mon, 11 Nov 2013 08:51:05 +0000 (08:51 +0000)] 
Make -XTemplateHaskell an error in a stage-1 compiler (except with -M)

Fixes Trac #8519

6 years agoTypos in note
Gabor Greif [Tue, 12 Nov 2013 00:50:05 +0000 (01:50 +0100)] 
Typos in note

6 years agoSysTools.getTempDir: don't retry after catching a does-not-exist error
Patrick Palka [Fri, 8 Nov 2013 14:41:24 +0000 (09:41 -0500)] 
SysTools.getTempDir: don't retry after catching a does-not-exist error

Previously, a command like

$ ghc -tmpdir blah Foo

where the directory blah/ does not exist, would loop forever: getTempDir
would repeatedly try to create a temporary subdirectory inside blah/,
catching the does-not-exist error thrown by createDirectory and
retrying, in vain, with another suffix.

Now instead the above compiler invocation will fail with an error:

blah/ghc25781_0: createDirectory: does not exist (No such file or directory)

6 years agoMake worker/wrapper robust to bogus unsafeCorece
Simon Peyton Jones [Fri, 8 Nov 2013 10:51:20 +0000 (10:51 +0000)] 
Make worker/wrapper robust to bogus unsafeCorece

Fixes Trac #8037

6 years agoUpdate aux files `config.{guess,sub}` and `install-sh`
Herbert Valerio Riedel [Thu, 7 Nov 2013 23:39:28 +0000 (00:39 +0100)] 
Update aux files `config.{guess,sub}` and `install-sh`

This updates the files to the versions bundled with GNU automake 1.13.3

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
6 years agoAdd docs for #8305
Austin Seipp [Thu, 7 Nov 2013 13:55:26 +0000 (07:55 -0600)] 
Add docs for #8305

Signed-off-by: Austin Seipp <austin@well-typed.com>
6 years agoFix typo in User's Guide
Pedro Rodrigues [Tue, 5 Nov 2013 10:57:29 +0000 (10:57 +0000)] 
Fix typo in User's Guide

Signed-off-by: Austin Seipp <austin@well-typed.com>
6 years agoFix oversight in comverting tuples from TH to HsSyn (Trac #8507)
Simon Peyton Jones [Thu, 7 Nov 2013 13:25:47 +0000 (13:25 +0000)] 
Fix oversight in comverting tuples from TH to HsSyn (Trac #8507)

6 years agoAllow optional 'family' and 'instance' keywords in associated type instances
Simon Peyton Jones [Thu, 7 Nov 2013 13:24:51 +0000 (13:24 +0000)] 
Allow optional 'family' and 'instance' keywords in associated type instances

This is to allow

   class C a where
      type family F a
      type instance F a = Bool

   instance C Int where
      type instance F Int = Char

Plus minor improvements relating to Trac #8506

6 years agoImprove printing of errors when the tycons look the same
Simon Peyton Jones [Wed, 6 Nov 2013 13:37:09 +0000 (13:37 +0000)] 
Improve printing of errors when the tycons look the same

See Trac #8278.  Example new message:

    Couldn't match expected type ‛T8278a.Maybe’
                with actual type ‛Maybe a0’
    NB: ‛T8278a.Maybe’ is defined in ‛T8278a’
        ‛Maybe’ is defined in ‛Data.Maybe’ in package ‛base’
    In the first argument of ‛f’, namely ‛Nothing’

The "NB" is the new bit

6 years agoWibbles to 'Tidy up the error messages we get from TH'
Simon Peyton Jones [Wed, 6 Nov 2013 16:39:46 +0000 (16:39 +0000)] 
Wibbles to 'Tidy up the error messages we get from TH'

6 years agoTidy up the error messages we get from TH in stage1 (Trac #8312)
Simon Peyton Jones [Wed, 6 Nov 2013 16:21:05 +0000 (16:21 +0000)] 
Tidy up the error messages we get from TH in stage1 (Trac #8312)

Instead of panic-ing we now give a sensible message.
There is quite a bit of refactoring here too, removing
several #ifdef GHCI things

6 years agoWarn if you use -XTemplateHaskell in stage1
Simon Peyton Jones [Wed, 6 Nov 2013 16:19:34 +0000 (16:19 +0000)] 
Warn if you use -XTemplateHaskell in stage1

This should really be an error, but we'll just warn for now

6 years agoImprove a parser error message (Trac #8506)
Simon Peyton Jones [Wed, 6 Nov 2013 09:30:40 +0000 (09:30 +0000)] 
Improve a parser error message (Trac #8506)

6 years agoZonk the type in reifyInstances (fixes Trac #7477)
Simon Peyton Jones [Wed, 6 Nov 2013 09:30:20 +0000 (09:30 +0000)] 
Zonk the type in reifyInstances (fixes Trac #7477)

A simple oversight, but crucial!  tcLHsType was returning
    F k Int
where k is a unification variable that has been unified with *

6 years agoUntabify and whitespace
Simon Peyton Jones [Tue, 5 Nov 2013 12:41:25 +0000 (12:41 +0000)] 
Untabify and whitespace

6 years agoRefactor the constraint solver (again!)
Simon Peyton Jones [Tue, 5 Nov 2013 12:38:33 +0000 (12:38 +0000)] 
Refactor the constraint solver (again!)

There are three core changes here:

a) In the constraint-solver pipeline.
   Given a work-item 'wi', the old scheme was:
      let relevant = getRelevantInerts wi
      interact 'wi' with each constraint in 'relevant'
   Bu now we have a single step
      interact 'wi' with the inert-set

   This turns out to avoid duplication, between getRelevantInerts
   (which needs to know which are relevant) and the interact step.
   Simpler, cleaner.

   This in turn made it sensible to combine the 'spontaneous solve'
   stage into the 'interact with inerts' stage.

b) Wanteds are no longer used to rewrite wanteds.  See Trac #8450.
   This in turn means that the inert set may have
     - many CFunEqCans with the same LHS
     - many CTyEqCans  with the same LHS
   Hence the EqualCtList in teh domain of inert_eqs and inert_funeqs

c) Some refactoring of the representation of the inert set,
   Notably inert_dicts and inert_funeqs are indexed by Class and TyCon
   respectively, so we can easily get all the constraints relevant to
   that class or tycon

There are many knock on effects!  This started as a small job but I
ended up doing qite a lot.  Some error messages in the test suite
really did improve as a result of (b)

6 years agoUntabify and whitespace
Simon Peyton Jones [Tue, 5 Nov 2013 12:19:10 +0000 (12:19 +0000)] 
Untabify and whitespace

6 years agoAdd filterVarEnv
Simon Peyton Jones [Tue, 5 Nov 2013 12:17:57 +0000 (12:17 +0000)] 
Add filterVarEnv

6 years agoMake -ddump-tc-trace imply -ddump-cs-trace
Simon Peyton Jones [Tue, 5 Nov 2013 12:17:27 +0000 (12:17 +0000)] 
Make -ddump-tc-trace imply -ddump-cs-trace

6 years agoComments and reorg only
Simon Peyton Jones [Wed, 6 Nov 2013 08:30:12 +0000 (08:30 +0000)] 
Comments and reorg only

6 years agoMore comments on Usage and Dependencies
Simon Peyton Jones [Tue, 5 Nov 2013 15:17:22 +0000 (15:17 +0000)] 
More comments on Usage and Dependencies

6 years agoFix checking of shadowed names (fixes Trac #8499)
Simon Peyton Jones [Tue, 5 Nov 2013 14:58:51 +0000 (14:58 +0000)] 
Fix checking of shadowed names (fixes Trac #8499)

6 years agoComments on mi_usages
Simon Peyton Jones [Tue, 5 Nov 2013 14:58:24 +0000 (14:58 +0000)] 
Comments on mi_usages

6 years agoFix marshalling of IfaceAt to and from interface files
Simon Peyton Jones [Tue, 5 Nov 2013 14:58:10 +0000 (14:58 +0000)] 
Fix marshalling of IfaceAt to and from interface files

I had forgotten about Note [CoAxBranch type variables] in CoAxiom

This patch fixes Trac #8500

6 years agoImprove pretty printing of IfaceAT in interface files
Simon Peyton Jones [Tue, 5 Nov 2013 14:55:44 +0000 (14:55 +0000)] 
Improve pretty printing of IfaceAT in interface files

6 years agoMention some new instances in release notes
Krzysztof Gogolewski [Mon, 4 Nov 2013 13:37:51 +0000 (14:37 +0100)] 
Mention some new instances in release notes

6 years agoTweak lookup semantics for GHCi macros
Herbert Valerio Riedel [Sat, 2 Nov 2013 10:58:09 +0000 (11:58 +0100)] 
Tweak lookup semantics for GHCi macros

This changes the prefix-based lookup to prefer macros over builtins only if
the macro name matches an existing builtin name. See #8305 for more details.

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
6 years agoFix obsolete mention of `darcs-all` script
Herbert Valerio Riedel [Sun, 3 Nov 2013 11:32:15 +0000 (12:32 +0100)] 
Fix obsolete mention of `darcs-all` script

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
6 years agoUpdate obsolete URLs in documentation
Herbert Valerio Riedel [Sun, 3 Nov 2013 11:33:11 +0000 (12:33 +0100)] 
Update obsolete URLs in documentation

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
6 years agoUpdate documentation concerning prefetch ops
Carter Tazio Schonwald [Sat, 2 Nov 2013 23:12:53 +0000 (19:12 -0400)] 
Update documentation concerning prefetch ops

Also remove can_fail=True since it's likely unnecessary upon discussion
(see #8256.)

Signed-off-by: Austin Seipp <austin@well-typed.com>
6 years agoSilence two AMP warnings
Herbert Valerio Riedel [Sun, 3 Nov 2013 08:41:43 +0000 (09:41 +0100)] 
Silence two AMP warnings

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
6 years agoBump all version numbers in release notes.
Austin Seipp [Sat, 2 Nov 2013 21:41:21 +0000 (16:41 -0500)] 
Bump all version numbers in release notes.

Signed-off-by: Austin Seipp <austin@well-typed.com>
6 years agoNuke trailing whitespace.
Austin Seipp [Sat, 2 Nov 2013 03:43:06 +0000 (22:43 -0500)] 
Nuke trailing whitespace.

Signed-off-by: Austin Seipp <austin@well-typed.com>
6 years agoadding further documentation and explanation to the prefetch primops
Carter Tazio Schonwald [Mon, 28 Oct 2013 19:16:18 +0000 (15:16 -0400)] 
adding further documentation and explanation to the prefetch primops

Signed-off-by: Carter Tazio Schonwald <carter.schonwald@gmail.com>
Signed-off-by: Austin Seipp <austin@well-typed.com>
6 years agoRemove superfluous #ifdef from Takano's patch.
Austin Seipp [Sat, 2 Nov 2013 03:40:49 +0000 (22:40 -0500)] 
Remove superfluous #ifdef from Takano's patch.

Signed-off-by: Austin Seipp <austin@well-typed.com>
6 years agorts_apply uses CCS_MAIN rather than CCS_SYSTEM (#7753)
Takano Akio [Mon, 30 Sep 2013 22:40:35 +0000 (07:40 +0900)] 
rts_apply uses CCS_MAIN rather than CCS_SYSTEM (#7753)

Signed-off-by: Austin Seipp <austin@well-typed.com>
6 years agoFix loop on 64bit Big-Endian platforms (#8134)
Austin Seipp [Sat, 2 Nov 2013 03:17:01 +0000 (22:17 -0500)] 
Fix loop on 64bit Big-Endian platforms (#8134)

This is a fun one.

In the RTS, `cas` expects a pointer to StgWord which will translate to
unsigned long (8 bytes under LP64.) But we had previously declared
token_locked as *StgBool* - which evaluates to 'int' (4 bytes under
LP64.) That means we fail to provide enough storage for the cas
primitive, causing it to corrupt memory on a 64bit platform.

Hilariously, this somehow did not affect little-endian platforms (ARM,
x86, etc) before. That's because to clear our lock token, we would say:

    token_locked = 0;

But because token_locked is 32bits technically, this only writes to
half of the 64bit quantity. On a Big-Endian machine, this won't do
anything. That is, token_locked starts as 0:

 / token_locked
 |
 v
 0x00000000

and the first cas modifies the memory to:

 / valid    / corrupted
 |          |
 v          v
 0x00000000 0x00000001

We then clear token_locked, but this doesn't change the corrupted 4
bytes of memory. And then we try to lock the token again, spinning until
it is released - clearly a deadlock.

Related: Windows (amd64) doesn't follow LP64, but LLP64, where both
int and long are 4 bytes, so this shouldn't change anything on these
platforms.

Thanks to Reid Barton for helping the diagnosis. Also, thanks to Jens
Peterson who confirmed this also fixes building GHC on Fedora/ppc64 and
Fedora/s390x.

Authored-by: Gustavo Luiz Duarte <gustavold@linux.vnet.ibm.com>
Signed-off-by: Austin Seipp <austin@well-typed.com>
6 years agoFix a race condition when PROFILING (#8453)
Takano Akio [Thu, 17 Oct 2013 13:50:43 +0000 (22:50 +0900)] 
Fix a race condition when PROFILING (#8453)

Signed-off-by: Austin Seipp <austin@well-typed.com>
6 years agoAdd support for module reification (#1480)
Austin Seipp [Sat, 2 Nov 2013 03:15:53 +0000 (22:15 -0500)] 
Add support for module reification (#1480)

Authored-by: Gergely Risko <gergely@risko.hu>
Signed-off-by: Austin Seipp <austin@well-typed.com>
6 years agoLoad all modules before reporting errors (#8322)
Joachim Breitner [Tue, 17 Sep 2013 21:37:02 +0000 (23:37 +0200)] 
Load all modules before reporting errors (#8322)

Instead of reporting only one "module not found"" error.

Signed-off-by: Austin Seipp <austin@well-typed.com>
6 years agoSync up to `haskeline` upstream's HEAD
Herbert Valerio Riedel [Fri, 1 Nov 2013 23:17:16 +0000 (00:17 +0100)] 
Sync up to `haskeline` upstream's HEAD

This contains the Haskeline commit fixing #7768

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
6 years agoMinor typos (fixes #8496)
Kirill Boltaev [Fri, 1 Nov 2013 15:13:39 +0000 (19:13 +0400)] 
Minor typos (fixes #8496)

6 years agoRemove debugging output (#8356)
Krzysztof Gogolewski [Fri, 1 Nov 2013 11:36:28 +0000 (12:36 +0100)] 
Remove debugging output (#8356)

6 years agoRemove remains of _scc_ (#8170)
Krzysztof Gogolewski [Fri, 1 Nov 2013 11:26:47 +0000 (12:26 +0100)] 
Remove remains of _scc_ (#8170)

6 years agoUpdate `terminfo` to version 0.3.2.6
Herbert Valerio Riedel [Thu, 31 Oct 2013 14:24:05 +0000 (15:24 +0100)] 
Update `terminfo` to version 0.3.2.6

Thus GHC's in-tree version corresponds exactly to
[hackage:terminfo-0.3.2.6]. Morever, `terminfo` has moved
to GitHub as well (https://github.com/judah/terminfo) so
the upstream repo URL in `packages` is updated as well.

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
6 years agoUpdate upstream repo url for `haskeline`
Herbert Valerio Riedel [Thu, 31 Oct 2013 08:08:58 +0000 (09:08 +0100)] 
Update upstream repo url for `haskeline`

[hackage:haskeline] has now an official GitHub repo at
https://github.com/judah/haskeline.git

Consequently, there remain only 3 repos which are Darcs hosted
(and thus still require darcs2git mirroring), namely
[hackage:time], [hackage:terminfo], and [hackage:transformers].

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
6 years agoFix Trac #8485.
Richard Eisenberg [Tue, 29 Oct 2013 15:13:52 +0000 (11:13 -0400)] 
Fix Trac #8485.

The problem was that the renamer treated role annotations by looking
up the annotated type in the module being compiled. If this check
succeeded, it was assumed that the annotated type was being compiled
at the same time. But this assumption is false! In GHCi (and Template
Haskell), sometimes compilation within one module can be staged. So,
now there is a more intricate check for orphan role annotations. This
also has the benefit of producing better error messages.

6 years agorts: Add casts to prevent compiler warnings in printfs.
Erik de Castro Lopo [Sat, 26 Oct 2013 00:11:54 +0000 (11:11 +1100)] 
rts: Add casts to prevent compiler warnings in printfs.

6 years agoUpdate `pretty` to 1.1.1.1 release
Herbert Valerio Riedel [Sun, 27 Oct 2013 20:59:49 +0000 (21:59 +0100)] 
Update `pretty` to 1.1.1.1 release

6 years agoAdd GitHub upstream repo for `libraries/random`
Herbert Valerio Riedel [Sun, 27 Oct 2013 12:37:14 +0000 (13:37 +0100)] 
Add GitHub upstream repo for `libraries/random`

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
6 years agoAdd more missing `{-# LANGUAGE #-}`s to `genprimopcode` output
Herbert Valerio Riedel [Sun, 27 Oct 2013 09:37:28 +0000 (10:37 +0100)] 
Add more missing `{-# LANGUAGE #-}`s to `genprimopcode` output

This is a follow-up to 0620241a0f09d1ff865fa575eadb61aa59d2fe4f
which addressed only the `Prim.hs` output; this commit adds the missing
`LANGUAGE` pragmas for the generated `PrimopWrappers.hs` output as well.

While at it, the redundant `CPP` pragma is removed from the generated
`Prim.hs` file.

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
6 years agoAdd `{-# LANGUAGE MagicHash #-}` in output of `genprimopcode`
Herbert Valerio Riedel [Sun, 27 Oct 2013 08:59:48 +0000 (09:59 +0100)] 
Add `{-# LANGUAGE MagicHash #-}` in output of `genprimopcode`

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
6 years agoAnother release note fix.
Austin Seipp [Sun, 27 Oct 2013 02:27:59 +0000 (21:27 -0500)] 
Another release note fix.

Signed-off-by: Austin Seipp <austin@well-typed.com>
6 years agoFix bad grammar.
Austin Seipp [Sun, 27 Oct 2013 01:22:45 +0000 (20:22 -0500)] 
Fix bad grammar.

Signed-off-by: Austin Seipp <austin@well-typed.com>
6 years agoRelease note blurb for stack size changes.
Austin Seipp [Sun, 27 Oct 2013 01:21:35 +0000 (20:21 -0500)] 
Release note blurb for stack size changes.

Signed-off-by: Austin Seipp <austin@well-typed.com>
6 years agoUntabify and delete trailing whitespace.
Austin Seipp [Sun, 27 Oct 2013 01:15:54 +0000 (20:15 -0500)] 
Untabify and delete trailing whitespace.

Signed-off-by: Austin Seipp <austin@well-typed.com>
6 years agoFix Windows build.
Austin Seipp [Sun, 27 Oct 2013 01:13:55 +0000 (20:13 -0500)] 
Fix Windows build.

GlobalMemoryStatusEx actually requires _WIN32_WINNT to be defined as
0x0501 (Windows XP) for availability.

For completeness, I bumped WIN32_WINNT in Ticker and OSThreads as well.

Signed-off-by: Austin Seipp <austin@well-typed.com>
6 years agoUpdate `Cabal` to 1.18.1.2
Herbert Valerio Riedel [Sat, 26 Oct 2013 21:58:14 +0000 (23:58 +0200)] 
Update `Cabal` to 1.18.1.2

6 years agoFix getPhysicalMemorySize on OS X (#8481)
Austin Seipp [Sat, 26 Oct 2013 17:50:16 +0000 (12:50 -0500)] 
Fix getPhysicalMemorySize on OS X (#8481)

Darwin doesn't support _SC_PHYS_PAGES, but we can get the exact number
of bytes of physical memory via 'hw.memsize', so we use that instead.

Signed-off-by: Austin Seipp <austin@well-typed.com>
6 years agoRevert "Implement shortcuts for slow calls that would require PAPs (#6084)"
Austin Seipp [Sat, 26 Oct 2013 03:33:56 +0000 (22:33 -0500)] 
Revert "Implement shortcuts for slow calls that would require PAPs (#6084)"

This reverts commit 2f5db98e90cf0cff1a11971c85f108a7480528ed.

6 years agoRevert "comments"
Austin Seipp [Sat, 26 Oct 2013 03:33:52 +0000 (22:33 -0500)] 
Revert "comments"

This reverts commit 9026c77a07533bda3773c3c3f3df1c6592bc80c7.

6 years agoChange type of `errMsgSpans` field of `ErrMsg` to `SrcSpan`
Joachim Breitner [Wed, 23 Oct 2013 09:24:24 +0000 (11:24 +0200)] 
Change type of `errMsgSpans` field of `ErrMsg` to `SrcSpan`

It was `[SrcSpan]`, but never ever contained more than one span.

6 years agoRelease note blurb about ELF weak symbols.
Austin Seipp [Sat, 26 Oct 2013 01:08:28 +0000 (20:08 -0500)] 
Release note blurb about ELF weak symbols.

Signed-off-by: Austin Seipp <austin@well-typed.com>
6 years agoRelease note wibble.
Austin Seipp [Fri, 25 Oct 2013 17:33:26 +0000 (12:33 -0500)] 
Release note wibble.

Signed-off-by: Austin Seipp <austin@well-typed.com>
6 years agoRelease note blurbs for directory.
Austin Seipp [Fri, 25 Oct 2013 17:28:34 +0000 (12:28 -0500)] 
Release note blurbs for directory.

Signed-off-by: Austin Seipp <austin@well-typed.com>
6 years agoUpdate documentation regarding SpecConstr.
Austin Seipp [Fri, 25 Oct 2013 16:49:09 +0000 (11:49 -0500)] 
Update documentation regarding SpecConstr.

 * Note new SPEC type in release notes.
 * Document SPEC in the users guide under the documentation for
   -fspec-constr.
 * Clean up comments in SpecConstr regarding the forcing of
   specialisation (see Note [Forcing specialisation].)

Signed-off-by: Austin Seipp <austin@well-typed.com>
6 years agoUntabify RtsFlags.c
Austin Seipp [Fri, 25 Oct 2013 14:17:01 +0000 (09:17 -0500)] 
Untabify RtsFlags.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
6 years agoUntabify Linker.c
Austin Seipp [Fri, 25 Oct 2013 14:15:34 +0000 (09:15 -0500)] 
Untabify Linker.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
6 years agoMake sure to #include Stable.h in Linker.c
Austin Seipp [Fri, 25 Oct 2013 13:37:42 +0000 (08:37 -0500)] 
Make sure to #include Stable.h in Linker.c

It needs freeStablePtr, which tripped my validate build, due to an
implicit declaration warning. I'm quite surprised this somehow did not
trip the build before.

Signed-off-by: Austin Seipp <austin@well-typed.com>
6 years agoLinker.c: add dso_handle to the symbol table
Takano Akio [Sun, 6 Jan 2013 08:51:19 +0000 (17:51 +0900)] 
Linker.c: add dso_handle to the symbol table

Signed-off-by: Austin Seipp <austin@well-typed.com>
6 years agoghci: add support for ELF weak symbols
Takano Akio [Sat, 29 Dec 2012 02:59:34 +0000 (11:59 +0900)] 
ghci: add support for ELF weak symbols

Signed-off-by: Austin Seipp <austin@well-typed.com>
6 years agoLinker.c: remove stablehash, which is no longer used
Takano Akio [Sat, 29 Dec 2012 02:47:22 +0000 (11:47 +0900)] 
Linker.c: remove stablehash, which is no longer used

Signed-off-by: Austin Seipp <austin@well-typed.com>
6 years agoMake SpecConstr also check for GHC.Types.SPEC
Austin Seipp [Fri, 25 Oct 2013 11:13:27 +0000 (06:13 -0500)] 
Make SpecConstr also check for GHC.Types.SPEC

SpecConstr has for a while now looked for types with the built
in ForceSpecConstr annotation, in order to know where to be particularly
aggressive.

Unfortunately using an annotation has a number of downsides, the most
prominent two being:

  A) ForceSpecConstr is vital for efficiency (even if it's
     a hack), but it means users of it must have GHCI - even though
     stage2 features are not required for anything but the annotation.

  B) Any user who might need it (read: vector) has to duplicate the same
     piece of code. In general there are few people actually doing this,
     but it's unclear why they should have to.

This patch makes SpecConstr look for functions applied to the new
GHC.Types.SPEC type - a copy of the already-extant 'SPEC' type - as well
as look for annotations, in the stage2 compiler.

In particular, this means `vector` can now be built with a stage1
compiler, since it no longer depends on stage2 for anything else. This
is particularly important for e.g. iOS cross-compilers.

This also means we should be able to build `vector` earlier in the build
process too, but this patch doesn't address that.

This requires an accompanying bump in ghc-prim.

Signed-off-by: Austin Seipp <austin@well-typed.com>
6 years agoAdd build.mk.sample entry for Cross Compilation
Austin Seipp [Fri, 25 Oct 2013 08:42:42 +0000 (03:42 -0500)] 
Add build.mk.sample entry for Cross Compilation

This is suitable e.g. for iOS.

Authored-by: Authored-by: Luke Iannini <lukexi@me.com>
Signed-off-by: Austin Seipp <austin@well-typed.com>
6 years agoPlacate clang (#8444, #8445)
Austin Seipp [Fri, 25 Oct 2013 08:39:19 +0000 (03:39 -0500)] 
Placate clang (#8444, #8445)

Once again the whitespace rules (and the rules concerning expansion of
tokens) have bitten us.

Authored-by: Authored-by: Luke Iannini <lukexi@me.com>
Signed-off-by: Austin Seipp <austin@well-typed.com>
6 years agoCorrectly set relative rpath for OS X (#8266)
Austin Seipp [Fri, 25 Oct 2013 08:26:23 +0000 (03:26 -0500)] 
Correctly set relative rpath for OS X (#8266)

This includes both executables (by correcly setting the rpath to the
topDir) and libffi, and GHC itself, so that everything works with no
build tree.

Authored-by: Christiaan Baaj <christiaan.baaij@gmail.com>
Signed-off-by: Austin Seipp <austin@well-typed.com>
6 years agousers_guide: Update default maximum stack size
Ben Gamari [Fri, 13 Sep 2013 03:28:20 +0000 (23:28 -0400)] 
users_guide: Update default maximum stack size

6 years agorts: Set default maximum stack size to 80% of physical memory
Ben Gamari [Fri, 13 Sep 2013 03:20:06 +0000 (23:20 -0400)] 
rts: Set default maximum stack size to 80% of physical memory

6 years agousers_guide: Document zero stack size limit
Ben Gamari [Tue, 22 Oct 2013 14:45:38 +0000 (10:45 -0400)] 
users_guide: Document zero stack size limit

6 years agorts: Allow for infinite stack size
Ben Gamari [Sat, 7 Sep 2013 02:48:52 +0000 (22:48 -0400)] 
rts: Allow for infinite stack size

This is encoded as RtsFlags.GcFlags.maxStkSize == 0.

6 years agorts: Fix typo in comment
Ben Gamari [Sat, 7 Sep 2013 22:00:40 +0000 (18:00 -0400)] 
rts: Fix typo in comment

6 years agorts: Print correct stack size on stack overflow
Ben Gamari [Sat, 7 Sep 2013 21:53:34 +0000 (17:53 -0400)] 
rts: Print correct stack size on stack overflow

This requires that stackOverflow() in RtsUtils.c be passed a reference
to the current TSO. This requires a small change in libraries/base.

6 years agorts: Add getPhysicalMemorySize
Ben Gamari [Fri, 13 Sep 2013 03:04:10 +0000 (23:04 -0400)] 
rts: Add getPhysicalMemorySize

6 years agoUntabify and remove trailing whitespace
Simon Peyton Jones [Fri, 25 Oct 2013 13:43:25 +0000 (14:43 +0100)] 
Untabify and remove trailing whitespace

... plus a couple of unused variables in TcSMonad

6 years agoRemove canSolve in favour of canRewrite
Simon Peyton Jones [Fri, 25 Oct 2013 13:36:37 +0000 (14:36 +0100)] 
Remove canSolve in favour of canRewrite

There was no useful distinction; a simple refactoring.

6 years agoBe more careful when iterating the constraint-simpifier loop (fixes Trac #8474)
Simon Peyton Jones [Fri, 25 Oct 2013 13:35:37 +0000 (14:35 +0100)] 
Be more careful when iterating the constraint-simpifier loop (fixes Trac #8474)

We were (uselessly) iterating the simplification loop an exponential
number of times.  Lovely simple test case showed this up.

See Note [Cutting off simpl_loop] in TcSimplify