ghc.git
5 years agoRemove unnecessary LANGUAGE pragma
Jan Stolarek [Sat, 1 Feb 2014 14:39:09 +0000 (15:39 +0100)] 
Remove unnecessary LANGUAGE pragma

5 years agoLoopification jump between stack and heap checks
Jan Stolarek [Sat, 1 Feb 2014 10:32:25 +0000 (11:32 +0100)] 
Loopification jump between stack and heap checks

Fixes #8585

When emmiting label of a self-recursive tail call (ie. when
performing loopification optimization) we emit the loop header
label after a stack check but before the heap check. The reason is
that tail-recursive functions use constant amount of stack space
so we don't need to repeat the check in every loop. But they can
grow the heap so heap check must be repeated in every call.
See Note [Self-recursive tail calls] and [Self-recursive loop header].

5 years agoRemove some references to deprecated -fglasgow-exts in user's guide
Krzysztof Gogolewski [Sat, 1 Feb 2014 13:03:34 +0000 (14:03 +0100)] 
Remove some references to deprecated -fglasgow-exts in user's guide

5 years agoIndividual sdist-foo targets
Joachim Breitner [Fri, 31 Jan 2014 23:31:30 +0000 (23:31 +0000)] 
Individual sdist-foo targets

so that one can build a source distribution without downloading the
windows tarballs.

5 years agoNo need to remove testsuite/.git
Joachim Breitner [Fri, 31 Jan 2014 23:31:00 +0000 (23:31 +0000)] 
No need to remove testsuite/.git

as there is no testsuite/.git any more.

5 years agoUpdate to latest Cabal 1.18 branch tip
Herbert Valerio Riedel [Fri, 31 Jan 2014 21:30:00 +0000 (22:30 +0100)] 
Update to latest Cabal 1.18 branch tip

This update pulls in the fix for #8266

(recommended add-on reading for those interested in OSX linker peculiarities:
https://github.com/haskell/cabal/issues/1660#issuecomment-33701508 )

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
5 years agoFix some edge cases in 8f8bd88c (#7134)
Kyrill Briantsev [Thu, 30 Jan 2014 22:49:57 +0000 (16:49 -0600)] 
Fix some edge cases in 8f8bd88c (#7134)

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoRemove Coercible documentation from compiler/prelude/primops.txt.pp
Joachim Breitner [Thu, 30 Jan 2014 16:28:00 +0000 (16:28 +0000)] 
Remove Coercible documentation from compiler/prelude/primops.txt.pp

We want it to show up in GHC.Exts, so we need to put the documentation
in GHC.Types, where the datatype Coercible is defined.

5 years agoBump win32 version number in release notes
Austin Seipp [Thu, 30 Jan 2014 13:20:37 +0000 (07:20 -0600)] 
Bump win32 version number in release notes

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoAdd a perf-cross build setting.
Luke Iannini [Thu, 30 Jan 2014 13:07:44 +0000 (07:07 -0600)] 
Add a perf-cross build setting.

This is for building performance-optimized cross compilers (e.g. the iOS
target.)

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoFix iOS build (fallout from 28b031c506)
Austin Seipp [Thu, 30 Jan 2014 13:03:29 +0000 (07:03 -0600)] 
Fix iOS build (fallout from 28b031c506)

As Luke Iannini reported, the Clang iOS cross compiler apparently
doesn't support __thread for some bizarre reason, so unfortunately they
too must fall back to pthread_{get,set}specific.

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoFix glitch in core-spec pdf
Jan Stolarek [Wed, 29 Jan 2014 17:41:07 +0000 (18:41 +0100)] 
Fix glitch in core-spec pdf

5 years agoUpdate Win32 submodule to pull in version bump
Herbert Valerio Riedel [Wed, 29 Jan 2014 16:00:08 +0000 (17:00 +0100)] 
Update Win32 submodule to pull in version bump

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
5 years agoBump version: 7.7 -> 7.9 ghc-7.9-start
Austin Seipp [Wed, 29 Jan 2014 09:20:17 +0000 (03:20 -0600)] 
Bump version: 7.7 -> 7.9

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoRemove a TODO FIXME in the release notes.
Austin Seipp [Wed, 29 Jan 2014 09:09:38 +0000 (03:09 -0600)] 
Remove a TODO FIXME in the release notes.

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoWin64 linker: fix loading foreign imports (#2283)
Kyrill Briantsev [Tue, 28 Jan 2014 14:42:40 +0000 (08:42 -0600)] 
Win64 linker: fix loading foreign imports (#2283)

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoFix inplace dynamic linking on OS X (#8266)
Christiaan Baaj [Tue, 28 Jan 2014 14:24:55 +0000 (08:24 -0600)] 
Fix inplace dynamic linking on OS X (#8266)

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoDocument a Haddock/Mavericks bug.
Austin Seipp [Tue, 28 Jan 2014 14:17:50 +0000 (08:17 -0600)] 
Document a Haddock/Mavericks bug.

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoRefactor GCTDecl.h, and mitigate #7602 a bit
Austin Seipp [Tue, 28 Jan 2014 12:15:19 +0000 (06:15 -0600)] 
Refactor GCTDecl.h, and mitigate #7602 a bit

This basically cleans a lot of GCTDecl up - I found it quite hard to
read and a bit confusing. The changes are mostly cosmetic: better
delineation between the alternative cases and light touchups, and tries
to make every branch as consistent as possible.

However, this patch does have one significant effect: it will ensure
that any LLVM-based compilers will use __thread if they support it.
Before, they would simply always use pthread_getspecific and
pthread_setspecific, which are almost surely even *more* inefficient.

The details are a bit too long and boring to go into here; see #7602.
After talking with Simon, we decided to play it safe - __thread can at
least be optimized by future clang releases even further on OS X if they
choose, and it's safer until we can investigate the pthread
implementation further on Mavericks.

For Linux, the story isn't so bleak if you use Clang (for whatever
reason) - Linux directly writes to `%fs` for __thread slots (while OS X
will perform a load followed by an indirect call.) So it should still be
fairly competitive, speed-wise.

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoCheck for __thread in ./configure.ac
Austin Seipp [Tue, 28 Jan 2014 11:44:44 +0000 (05:44 -0600)] 
Check for __thread in ./configure.ac

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoUpdate some mingw32 perf numbers.
Austin Seipp [Tue, 28 Jan 2014 11:24:40 +0000 (05:24 -0600)] 
Update some mingw32 perf numbers.

I forgot to push these from my win32 machine. A lot of them actually
look like a result of Herbert doing his GMP work, which might slightly
affect allocations on platforms like Windows (where we always use
in-tree GMP - but presumably Windows allocations could fluxuate slightly
due to minute details in the GMP implementation, too.)

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoFix ./validate failure due to unused result.
Austin Seipp [Tue, 28 Jan 2014 04:22:03 +0000 (22:22 -0600)] 
Fix ./validate failure due to unused result.

Fallout from 4ade9627608ea0a88450506222bb9afbbcff4294

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoAbort when binutils ld is used with dynamic linking on ARM
Ben Gamari [Sat, 25 Jan 2014 18:02:36 +0000 (13:02 -0500)] 
Abort when binutils ld is used with dynamic linking on ARM

The binutils linker on ARM emits unnecessary R_ARM_COPY relocations
which breaks tables-next-to-code in dynamically linked modules. This
check should be more selective but there is currently no released
version where this bug is fixed.  See
https://sourceware.org/bugzilla/show_bug.cgi?id=16177 and
https://ghc.haskell.org/trac/ghc/ticket/4210#comment:29 for details.

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoAdd short blurb about LLVM dynamic linking to release notes
Ben Gamari [Wed, 22 Jan 2014 00:26:12 +0000 (19:26 -0500)] 
Add short blurb about LLVM dynamic linking to release notes

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agobuild.mk.sample: Don't disable dynamic linking for LLVM flavours
Ben Gamari [Sun, 19 Jan 2014 15:35:50 +0000 (10:35 -0500)] 
build.mk.sample: Don't disable dynamic linking for LLVM flavours

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoFix the Win64 RTS linker & disable .ctors
Kyrill Briantsev [Mon, 27 Jan 2014 23:23:45 +0000 (17:23 -0600)] 
Fix the Win64 RTS linker & disable .ctors

This fixes #7134

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoMention #3202 (no monomorphism restriction in GHCi) in release notes
Krzysztof Gogolewski [Sun, 26 Jan 2014 22:39:46 +0000 (23:39 +0100)] 
Mention #3202 (no monomorphism restriction in GHCi) in release notes

This change seems worth mentioning

5 years agoTweak the example
Gabor Greif [Sun, 26 Jan 2014 13:33:18 +0000 (14:33 +0100)] 
Tweak the example

5 years agoSquash some spelling issues
Gabor Greif [Sun, 26 Jan 2014 12:39:00 +0000 (13:39 +0100)] 
Squash some spelling issues

5 years agoUser documentation for pattern synonyms
Dr. ERDI Gergo [Sun, 26 Jan 2014 04:10:10 +0000 (12:10 +0800)] 
User documentation for pattern synonyms

5 years agoSome typos in comments
Gabor Greif [Thu, 23 Jan 2014 21:33:46 +0000 (22:33 +0100)] 
Some typos in comments

5 years agoSome polishing of the demand analyser.
Joachim Breitner [Thu, 23 Jan 2014 15:13:30 +0000 (15:13 +0000)] 
Some polishing of the demand analyser.

I did some refactoring of the demand analyser, because I was smelling
some minor code smell. Most of my changes I had to undo, though,
adding notes and testcases on why the existing code was correct after
all.

Especially the semantics of the DmdResult is confusing, as it differs in
a DmdType and a StrictSig.

I got to imrpove the readability of the code for lubDmdType, though.

Also, dmdAnalRhs was a bit fishy in how it removed the demand on
further arguments of the body, but used the DmdResult. This would be
wrong if a body would return a demand type of "<L>m" (which currently
does not happen).  This is now treated better in removeDmdTyArgs.

5 years agoMore demand analyser test cases
Joachim Breitner [Thu, 23 Jan 2014 16:40:10 +0000 (16:40 +0000)] 
More demand analyser test cases

catching mistakes that I had during my refactoring, and which I do not
want to do again.

5 years agoFix spelling of language pragma
Gabor Greif [Thu, 23 Jan 2014 06:42:14 +0000 (07:42 +0100)] 
Fix spelling of language pragma

5 years agoOne more fix (T3064)
Austin Seipp [Thu, 23 Jan 2014 04:27:12 +0000 (22:27 -0600)] 
One more fix (T3064)

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoFix 32bit numbers (again)
Austin Seipp [Thu, 23 Jan 2014 04:24:33 +0000 (22:24 -0600)] 
Fix 32bit numbers (again)

My build settings were wrong last time.

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoRevert "Fix more 32 bit performance fallout."
Austin Seipp [Thu, 23 Jan 2014 04:15:20 +0000 (22:15 -0600)] 
Revert "Fix more 32 bit performance fallout."

This reverts commit c5088e299a66109346057afc151c33e47b850b92.

5 years agoAnd don't forget FreeBSD
Austin Seipp [Thu, 23 Jan 2014 00:21:16 +0000 (18:21 -0600)] 
And don't forget FreeBSD

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoRelease notes: mention Mavericks and some bugs
Austin Seipp [Thu, 23 Jan 2014 00:16:03 +0000 (18:16 -0600)] 
Release notes: mention Mavericks and some bugs

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoWibble.
Austin Seipp [Wed, 22 Jan 2014 23:38:15 +0000 (17:38 -0600)] 
Wibble.

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoFix more 32 bit performance fallout.
Austin Seipp [Wed, 22 Jan 2014 23:30:54 +0000 (17:30 -0600)] 
Fix more 32 bit performance fallout.

Some of these are actually worse than I thought upon inspection, but
after a little digging I haven't found exactly what has caused them.
Some were certainly bitrotted, but others seem updated more recently, so
something has slipped.

I'll be filing a ticket about these.

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoMore tweaks.
Austin Seipp [Wed, 22 Jan 2014 23:12:26 +0000 (17:12 -0600)] 
More tweaks.

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoMore release note touchups.
Austin Seipp [Wed, 22 Jan 2014 23:04:41 +0000 (17:04 -0600)] 
More release note touchups.

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoAlso mention Pattern Synonyms (but with a FIXME)
Austin Seipp [Wed, 22 Jan 2014 22:24:32 +0000 (16:24 -0600)] 
Also mention Pattern Synonyms (but with a FIXME)

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoClean up the release notes.
Austin Seipp [Wed, 22 Jan 2014 22:21:07 +0000 (16:21 -0600)] 
Clean up the release notes.

In particular, spell out the current dynamic situation, clean up the
FIXMEs and xrefs, and don't forget to mention InterruptibleFFI.

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoFix another failure.
Austin Seipp [Wed, 22 Jan 2014 20:24:13 +0000 (14:24 -0600)] 
Fix another failure.

Rather hilarious (and my fault.)

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoFix some of the 32bit perf numbers.
Austin Seipp [Wed, 22 Jan 2014 20:20:36 +0000 (14:20 -0600)] 
Fix some of the 32bit perf numbers.

A few appear to have bitrotted a little. There are others we are
actually doing better on, but that will come in the next commit.

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoFix #8677 (fallout from #8180)
Austin Seipp [Tue, 21 Jan 2014 20:05:49 +0000 (14:05 -0600)] 
Fix #8677 (fallout from #8180)

When using TemplateHaskell and -prof, we *do not* want -dynamic-too, because
we're going to *expect* that you compiled the vanilla/dyn way already,
and are compiling profiling the second time (i.e. so GHCi can just load
the normal, non-profiled object files.)

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoT7336 is expected to be broken because of a regression introduced by pattern synonym...
Dr. ERDI Gergo [Mon, 13 Jan 2014 12:37:39 +0000 (20:37 +0800)] 
T7336 is expected to be broken because of a regression introduced by pattern synonym implementation

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoImplement pattern synonyms
Dr. ERDI Gergo [Mon, 13 Jan 2014 12:12:34 +0000 (20:12 +0800)] 
Implement pattern synonyms

This patch implements Pattern Synonyms (enabled by -XPatternSynonyms),
allowing y ou to assign names to a pattern and abstract over it.

The rundown is this:

  * Named patterns are introduced by the new 'pattern' keyword, and can
    be either *unidirectional* or *bidirectional*. A unidirectional
    pattern is, in the simplest sense, simply an 'alias' for a pattern,
    where the LHS may mention variables to occur in the RHS. A
    bidirectional pattern synonym occurs when a pattern may also be used
    in expression context.

  * Unidirectional patterns are declared like thus:

        pattern P x <- x:_

    The synonym 'P' may only occur in a pattern context:

        foo :: [Int] -> Maybe Int
        foo (P x) = Just x
        foo _     = Nothing

  * Bidirectional patterns are declared like thus:

        pattern P x y = [x, y]

    Here, P may not only occur as a pattern, but also as an expression
    when given values for 'x' and 'y', i.e.

        bar :: Int -> [Int]
        bar x = P x 10

  * Patterns can't yet have their own type signatures; signatures are inferred.

  * Pattern synonyms may not be recursive, c.f. type synonyms.

  * Pattern synonyms are also exported/imported using the 'pattern'
    keyword in an import/export decl, i.e.

        module Foo (pattern Bar) where ...

    Note that pattern synonyms share the namespace of constructors, so
    this disambiguation is required as a there may also be a 'Bar'
    type in scope as well as the 'Bar' pattern.

  * The semantics of a pattern synonym differ slightly from a typical
    pattern: when using a synonym, the pattern itself is matched,
    followed by all the arguments. This means that the strictness
    differs slightly:

        pattern P x y <- [x, y]

        f (P True True) = True
        f _             = False

        g [True, True] = True
        g _            = False

    In the example, while `g (False:undefined)` evaluates to False,
    `f (False:undefined)` results in undefined as both `x` and `y`
    arguments are matched to `True`.

For more information, see the wiki:

    https://ghc.haskell.org/trac/ghc/wiki/PatternSynonyms
    https://ghc.haskell.org/trac/ghc/wiki/PatternSynonyms/Implementation

Reviewed-by: Simon Peyton Jones <simonpj@microsoft.com>
Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoExplain why TcAxiomInstCo carries [TcCoercion], and not [TcType]
Joachim Breitner [Mon, 20 Jan 2014 15:16:06 +0000 (15:16 +0000)] 
Explain why TcAxiomInstCo carries [TcCoercion], and not [TcType]

5 years agoTest case for #T7619
Joachim Breitner [Mon, 20 Jan 2014 10:31:45 +0000 (10:31 +0000)] 
Test case for #T7619

(artificial test cases are so nice: 90.7% improvement!)

5 years agoSimplify doCorePass
Joachim Breitner [Mon, 20 Jan 2014 10:26:13 +0000 (10:26 +0000)] 
Simplify doCorePass

5 years agoMake worker-wrapper unbox data families
Joachim Breitner [Fri, 17 Jan 2014 17:31:53 +0000 (17:31 +0000)] 
Make worker-wrapper unbox data families

by passing the FamInstEnvs all the way down. This closes #7619.

5 years agoMake `#include "Rts.h"` C++-compatible again (re #8676)
Herbert Valerio Riedel [Sun, 19 Jan 2014 13:37:05 +0000 (14:37 +0100)] 
Make `#include "Rts.h"` C++-compatible again (re #8676)

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
5 years agoFix #8451
Gabor Pali [Sat, 18 Jan 2014 02:02:21 +0000 (03:02 +0100)] 
Fix #8451

On FreeBSD, /usr/lib has to be added to the library path on linking when
libthr is needed but -nostdlib is used (which is the case when the -prof
and -threaded flags are combined).

5 years agoRe-enable DYNAMIC_GHC_PROGRAMS for FreeBSD.
Gabor Pali [Fri, 17 Jan 2014 19:24:00 +0000 (20:24 +0100)] 
Re-enable DYNAMIC_GHC_PROGRAMS for FreeBSD.

All actively supported releases (8.4-RELEASE, 9.2-RELEASE and the
upcoming 10.0-RELEASE) now support resolution of $ORIGIN properly.

5 years agoAllow "amd64" to be recognized as an x86_64 platform.
Gabor Pali [Fri, 17 Jan 2014 19:15:35 +0000 (20:15 +0100)] 
Allow "amd64" to be recognized as an x86_64 platform.

5 years agoEnable LLVM-based code generation for FreeBSD/amd64.
Gabor Pali [Fri, 17 Jan 2014 19:13:02 +0000 (20:13 +0100)] 
Enable LLVM-based code generation for FreeBSD/amd64.

5 years agoFix #8675
Austin Seipp [Fri, 17 Jan 2014 16:49:21 +0000 (10:49 -0600)] 
Fix #8675

Haddock no longer has a generated parser, so we don't need it in the
sdist and we certainly don't want to check for it in the ./configure
script (as that would be bogus.)

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoAdd testcase for #4267
Joachim Breitner [Fri, 17 Jan 2014 15:03:39 +0000 (15:03 +0000)] 
Add testcase for #4267

5 years agoAdd a test case for #5949
Joachim Breitner [Fri, 17 Jan 2014 14:08:30 +0000 (14:08 +0000)] 
Add a test case for #5949

5 years agoDon't print roles for data instances
Simon Peyton Jones [Fri, 17 Jan 2014 14:06:02 +0000 (14:06 +0000)] 
Don't print roles for data instances

See Trac #8672

5 years agoEta expand data family instances before printing them
Simon Peyton Jones [Fri, 17 Jan 2014 14:05:35 +0000 (14:05 +0000)] 
Eta expand data family instances before printing them

Fixes Trac #8674

5 years agoTidy up Outputable.printDoc, and add printDoc_
Simon Peyton Jones [Fri, 17 Jan 2014 10:40:58 +0000 (10:40 +0000)] 
Tidy up Outputable.printDoc, and add printDoc_

The former adds a newline at the end (restoring the previous behaviour)
while the latter does not (which previously happened by turning the
thuing into a string and only then printing it).

5 years agoAdd an expect-broken test for Trac #8566
Simon Peyton Jones [Thu, 16 Jan 2014 18:12:49 +0000 (18:12 +0000)] 
Add an expect-broken test for Trac #8566

5 years agoTypos in comments
Krzysztof Gogolewski [Thu, 16 Jan 2014 19:22:11 +0000 (20:22 +0100)] 
Typos in comments

5 years ago...and clean up the imports
Joachim Breitner [Thu, 16 Jan 2014 18:01:13 +0000 (18:01 +0000)] 
...and clean up the imports

5 years agoRemove unused returnsCPR
Joachim Breitner [Thu, 16 Jan 2014 16:55:07 +0000 (16:55 +0000)] 
Remove unused returnsCPR

5 years agoRefactor WorkWrap, get rid of worthSplittingArgDmd
Joachim Breitner [Thu, 16 Jan 2014 14:42:31 +0000 (14:42 +0000)] 
Refactor WorkWrap, get rid of worthSplittingArgDmd

Instead of first checking whether splitting is useful, and then firing
up the worker-wrapper-machinery, which will do the same checks again, we
now simply generate a worker and wrapper, and while doing so keep track
of whether what we did was in any way useful.

So now there is only one place left where we decide whether we want to
do w/w, and that place has access to more information, in particular the
actual types at hand.

5 years agoReplace worthSplittingThunkDmd by worthSplittingArgDmd
Joachim Breitner [Thu, 16 Jan 2014 13:59:31 +0000 (13:59 +0000)] 
Replace worthSplittingThunkDmd by worthSplittingArgDmd

these functions were almost equal, and neither validate nor nofib show
any difference replacing one by the other. So lets simplify this.
(This also prepares for a refactoring that will get rid of
worthSplittingArgDmd completely.)

5 years agoUpdate to current Cabal 1.18 branch tip
Herbert Valerio Riedel [Thu, 16 Jan 2014 15:20:44 +0000 (16:20 +0100)] 
Update to current Cabal 1.18 branch tip

This should contain a fix that addresses the Solaris build breakage
(see #8670)

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
5 years agoAllow the argument to 'reserve' to be a compile-time expression
Simon Marlow [Thu, 16 Jan 2014 15:14:49 +0000 (15:14 +0000)] 
Allow the argument to 'reserve' to be a compile-time expression

By using the constant-folder to reduce it to an integer.

5 years agoAdd a way to reserve temporary stack space in high-level Cmm
Simon Marlow [Thu, 16 Jan 2014 11:55:25 +0000 (11:55 +0000)] 
Add a way to reserve temporary stack space in high-level Cmm

We occasionally need to reserve some temporary memory in a primop for
passing to a foreign function.  We've been using the stack for this,
but when we moved to high-level Cmm it became quite fragile because
primops are in high-level Cmm and the stack is supposed to be under
the control of the Cmm pipeline.

So this change puts things on a firmer footing by adding a new Cmm
construct 'reserve'.  e.g. in decodeFloat_Int#:

    reserve 2 = tmp {

      mp_tmp1  = tmp + WDS(1);
      mp_tmp_w = tmp;

      /* Perform the operation */
      ccall __decodeFloat_Int(mp_tmp1 "ptr", mp_tmp_w "ptr", arg);

      r1 = W_[mp_tmp1];
      r2 = W_[mp_tmp_w];
    }

reserve is described in CmmParse.y.

Unfortunately the argument to reserve must be a compile-time constant.
We might have to extend the parser to allow expressions with
arithmetic operators if this is too restrictive.

Note also that the return instruction for the procedure must be
outside the scope of the reserved stack area, so we have to extract
the values from the reserved area before we close the scope.  This
means some more local variables (r1, r2 in the example above).  The
generated code is more or less identical to what we had before though.

5 years agoTypo in comment
Gabor Greif [Thu, 16 Jan 2014 12:06:29 +0000 (13:06 +0100)] 
Typo in comment

5 years agobump bounds for T6048
Simon Marlow [Thu, 16 Jan 2014 11:10:01 +0000 (11:10 +0000)] 
bump bounds for T6048

Presumably broken by an earlier change, anyone know which one?

5 years agoDocumentation on the stack layout algorithm
Simon Marlow [Mon, 13 Jan 2014 20:36:48 +0000 (20:36 +0000)] 
Documentation on the stack layout algorithm

5 years agoDisable -fregs-graph (#7679, #8657)
Simon Marlow [Mon, 13 Jan 2014 20:07:19 +0000 (20:07 +0000)] 
Disable -fregs-graph (#7679, #8657)

5 years agotype-rep is only broken when debugging is on
Joachim Breitner [Thu, 16 Jan 2014 09:22:04 +0000 (10:22 +0100)] 
type-rep is only broken when debugging is on

in which case it is a wontfix (see #8569)

5 years agoUpdate to `containers-0.5.4.0`
Herbert Valerio Riedel [Thu, 16 Jan 2014 07:16:52 +0000 (08:16 +0100)] 
Update to `containers-0.5.4.0`

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
5 years agoFix ghciprog004 when built with Clang
Austin Seipp [Thu, 16 Jan 2014 01:11:42 +0000 (19:11 -0600)] 
Fix ghciprog004 when built with Clang

Clang warns about implicit return values by default.

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoDon't pass -nodefaultlibs to Clang
Austin Seipp [Thu, 16 Jan 2014 00:56:55 +0000 (18:56 -0600)] 
Don't pass -nodefaultlibs to Clang

This fixes a large majority of the testsuite failures on Mavericks with
Clang.

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoCache compiler info in DynFlags
Austin Seipp [Thu, 16 Jan 2014 00:56:44 +0000 (18:56 -0600)] 
Cache compiler info in DynFlags

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoPLT Redex definition of an STG-like language, as-per the fast curry paper.
Edward Z. Yang [Wed, 15 Jan 2014 21:29:53 +0000 (13:29 -0800)] 
PLT Redex definition of an STG-like language, as-per the fast curry paper.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
5 years agoIn rts/Printer.c, print exact UPDATE_FRAME type
Arash Rouhani [Thu, 26 Dec 2013 13:57:35 +0000 (14:57 +0100)] 
In rts/Printer.c, print exact UPDATE_FRAME type

When printing an update frame in printClosure(), it will not print
the unspecific UPDATE_FRAME, instead it prints BH_UPDATE_FRAME,
NORMAL_UPDATE_FRAME or MARKED_UPDATE_FRAME.

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agos/warn-type-holes/warn-typed-holes/g
Austin Seipp [Wed, 15 Jan 2014 14:35:37 +0000 (08:35 -0600)] 
s/warn-type-holes/warn-typed-holes/g

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoUpdate to `terminfo-0.4.0.0`/`haskeline-0.7.1.2`
Herbert Valerio Riedel [Wed, 15 Jan 2014 08:30:00 +0000 (09:30 +0100)] 
Update to `terminfo-0.4.0.0`/`haskeline-0.7.1.2`

These new versions get rid of AMP warnings

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
5 years agoTurn -XTypeHoles into a (on by default) warning
Austin Seipp [Wed, 15 Jan 2014 02:16:26 +0000 (20:16 -0600)] 
Turn -XTypeHoles into a (on by default) warning

After some discussion on ghc-devs@ and elsewhere, it seemed favorable to
make this change as type holes don't let any invalid programs though,
they merely change what the compiler reports in case of certain errors
(namely unbound occurrences, or _ appearing on a LHS.)

Now, the warning mechanism is controlled by -f[no-]warn-type-errors,
just like any other regular warning. Again, on by default.

The documentation and tests have been updated accordingly.

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoTypo in comment
Gabor Greif [Tue, 14 Jan 2014 12:01:11 +0000 (13:01 +0100)] 
Typo in comment

5 years agoFix Windows binary-dist target
Austin Seipp [Tue, 14 Jan 2014 08:31:31 +0000 (02:31 -0600)] 
Fix Windows binary-dist target

I'm not entirely sure what the intention of this code was, but it was
quite old, and the binary distribution for Windows seems to work OK
nonetheless.

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoFix TyCon import
Austin Seipp [Tue, 14 Jan 2014 01:20:58 +0000 (19:20 -0600)] 
Fix TyCon import

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoFix ./validate failure due to -Werror
Austin Seipp [Tue, 14 Jan 2014 01:15:51 +0000 (19:15 -0600)] 
Fix ./validate failure due to -Werror

This occurs when doing bootstraps with the 7.7 compiler.

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoAnother AMP fix for Stream
Austin Seipp [Tue, 14 Jan 2014 01:00:47 +0000 (19:00 -0600)] 
Another AMP fix for Stream

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoFix AMP warnings for MaybeT/MaybeErr
Austin Seipp [Tue, 14 Jan 2014 00:39:10 +0000 (18:39 -0600)] 
Fix AMP warnings for MaybeT/MaybeErr

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agogenprimopcode: Applicative instance for ParserM
Austin Seipp [Mon, 13 Jan 2014 23:57:47 +0000 (17:57 -0600)] 
genprimopcode: Applicative instance for ParserM

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoFix binary linking errors on Solaris
Karel Gardas [Mon, 13 Jan 2014 23:00:18 +0000 (17:00 -0600)] 
Fix binary linking errors on Solaris

The -u option must be placed before libraries which define the necessary
symbols.

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoAdd Solaris linker support to SysTools
Karel Gardas [Mon, 13 Jan 2014 22:59:47 +0000 (16:59 -0600)] 
Add Solaris linker support to SysTools

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoMark T8602 as expect_fail on Windows
Austin Seipp [Mon, 13 Jan 2014 18:23:05 +0000 (12:23 -0600)] 
Mark T8602 as expect_fail on Windows

Windows runs the preprocessor using runInteractiveProcess and can't
properly run the generated shell script as a result, since it can't
recognize e.g. a shebang or anything.

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoFix T8526 on Windows
Austin Seipp [Mon, 13 Jan 2014 18:02:32 +0000 (12:02 -0600)] 
Fix T8526 on Windows

The shell interpretes the quotes incorrectly.

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoFix T7859 mingw32 output
Austin Seipp [Mon, 13 Jan 2014 15:20:47 +0000 (09:20 -0600)] 
Fix T7859 mingw32 output

Signed-off-by: Austin Seipp <austin@well-typed.com>