ghc-hetmet.git
18 years ago[project @ 2005-07-26 14:42:53 by simonmar]
simonmar [Tue, 26 Jul 2005 14:42:53 +0000 (14:42 +0000)]
[project @ 2005-07-26 14:42:53 by simonmar]
add missing case for MUT_ARR_PTRS_FROZEN0 (might fix some cases of
"internal error: heapCensus" in the HEAD)

18 years ago[project @ 2005-07-26 14:38:42 by simonmar]
simonmar [Tue, 26 Jul 2005 14:38:42 +0000 (14:38 +0000)]
[project @ 2005-07-26 14:38:42 by simonmar]
oops, fix heavy-handed C-k in prev commit

18 years ago[project @ 2005-07-26 13:13:20 by simonmar]
simonmar [Tue, 26 Jul 2005 13:14:14 +0000 (13:14 +0000)]
[project @ 2005-07-26 13:13:20 by simonmar]
some small optimisations

18 years ago[project @ 2005-07-26 12:15:54 by simonmar]
simonmar [Tue, 26 Jul 2005 12:15:54 +0000 (12:15 +0000)]
[project @ 2005-07-26 12:15:54 by simonmar]
printing C: use the quick printForC rather than the slow (but
prettier) printForUser.  This has been a ToDo for a while.

18 years ago[project @ 2005-07-26 12:14:03 by simonmar]
simonmar [Tue, 26 Jul 2005 12:14:03 +0000 (12:14 +0000)]
[project @ 2005-07-26 12:14:03 by simonmar]
Add a layer of write buffering over Handle when dumping the output:
this saves a lot of time because we're doing a lot of small writes,
and Handle operations have a non-trivial constant overhead due to the
thread-safety, exception-safety etc.

This improvement results in about a 10% reduction in compile time for
non-optimised, somewhat less for optimised compilation.

18 years ago[project @ 2005-07-26 10:11:37 by simonmar]
simonmar [Tue, 26 Jul 2005 10:11:37 +0000 (10:11 +0000)]
[project @ 2005-07-26 10:11:37 by simonmar]
Fix to previous tweaks

18 years ago[project @ 2005-07-26 08:31:21 by simonpj]
simonpj [Tue, 26 Jul 2005 08:31:21 +0000 (08:31 +0000)]
[project @ 2005-07-26 08:31:21 by simonpj]
When trimming type constructors for export, no need to trim enumerations,
because they don't give rise to any further exported things.

(Minor improvement: no need to merge)

18 years ago[project @ 2005-07-26 08:29:44 by simonpj]
simonpj [Tue, 26 Jul 2005 08:29:44 +0000 (08:29 +0000)]
[project @ 2005-07-26 08:29:44 by simonpj]
MERGE TO STABLE

Fix a TH bug.  When a type constructor was exported abstractly (which happens
when you don't have -O), and then reified in an importing module, the
reification crashed.

Now it just gives a TyCon with no constructors.

18 years ago[project @ 2005-07-26 08:16:24 by simonpj]
simonpj [Tue, 26 Jul 2005 08:16:24 +0000 (08:16 +0000)]
[project @ 2005-07-26 08:16:24 by simonpj]
Comments

18 years ago[project @ 2005-07-26 07:30:37 by simonpj]
simonpj [Tue, 26 Jul 2005 07:30:37 +0000 (07:30 +0000)]
[project @ 2005-07-26 07:30:37 by simonpj]
Revert accidental commit

18 years ago[project @ 2005-07-25 15:48:18 by simonmar]
simonmar [Mon, 25 Jul 2005 15:48:18 +0000 (15:48 +0000)]
[project @ 2005-07-25 15:48:18 by simonmar]
Make various -fvia-C options conditional on GHC < 6.4, since the
native code generator is a bit more robust/complete these days.

18 years ago[project @ 2005-07-25 14:12:48 by simonmar]
simonmar [Mon, 25 Jul 2005 14:12:51 +0000 (14:12 +0000)]
[project @ 2005-07-25 14:12:48 by simonmar]
Remove the ForeignObj# type, and all its PrimOps.  The new efficient
representation of ForeignPtr doesn't use ForeignObj# underneath, and
there seems no need to keep it.

18 years ago[project @ 2005-07-25 14:04:02 by simonmar]
simonmar [Mon, 25 Jul 2005 14:04:02 +0000 (14:04 +0000)]
[project @ 2005-07-25 14:04:02 by simonmar]
Compile GC.c with -O3 (unrolls some important loops)

18 years ago[project @ 2005-07-25 14:03:06 by simonmar]
simonmar [Mon, 25 Jul 2005 14:03:06 +0000 (14:03 +0000)]
[project @ 2005-07-25 14:03:06 by simonmar]
GC tweaks

18 years ago[project @ 2005-07-25 14:01:42 by simonmar]
simonmar [Mon, 25 Jul 2005 14:01:42 +0000 (14:01 +0000)]
[project @ 2005-07-25 14:01:42 by simonmar]
catching up with GC tweaks.

18 years ago[project @ 2005-07-25 14:00:22 by simonmar]
simonmar [Mon, 25 Jul 2005 14:00:22 +0000 (14:00 +0000)]
[project @ 2005-07-25 14:00:22 by simonmar]
catching up with GC tweaks

18 years ago[project @ 2005-07-25 13:59:09 by simonmar]
simonmar [Mon, 25 Jul 2005 13:59:10 +0000 (13:59 +0000)]
[project @ 2005-07-25 13:59:09 by simonmar]
Tweaks to the GC to improve perforrmance.  Might be as much as 10% on
some programs.

18 years ago[project @ 2005-07-25 11:43:09 by simonpj]
simonpj [Mon, 25 Jul 2005 11:43:09 +0000 (11:43 +0000)]
[project @ 2005-07-25 11:43:09 by simonpj]
Print occ info in Core

18 years ago[project @ 2005-07-25 11:42:24 by simonpj]
simonpj [Mon, 25 Jul 2005 11:42:25 +0000 (11:42 +0000)]
[project @ 2005-07-25 11:42:24 by simonpj]
Comments

18 years ago[project @ 2005-07-25 11:29:36 by simonpj]
simonpj [Mon, 25 Jul 2005 11:29:36 +0000 (11:29 +0000)]
[project @ 2005-07-25 11:29:36 by simonpj]
Wibble to dup-sig reporting

18 years ago[project @ 2005-07-25 11:24:24 by simonpj]
simonpj [Mon, 25 Jul 2005 11:24:24 +0000 (11:24 +0000)]
[project @ 2005-07-25 11:24:24 by simonpj]
Better error recovery for type signatures

18 years ago[project @ 2005-07-25 11:11:36 by simonpj]
simonpj [Mon, 25 Jul 2005 11:11:36 +0000 (11:11 +0000)]
[project @ 2005-07-25 11:11:36 by simonpj]
Wibble to TH docs; MERGE to STABLE

18 years ago[project @ 2005-07-25 11:10:33 by simonpj]
simonpj [Mon, 25 Jul 2005 11:10:34 +0000 (11:10 +0000)]
[project @ 2005-07-25 11:10:33 by simonpj]
Wibbles to the big HsBinds reorg

18 years ago[project @ 2005-07-25 11:10:01 by simonpj]
simonpj [Mon, 25 Jul 2005 11:10:01 +0000 (11:10 +0000)]
[project @ 2005-07-25 11:10:01 by simonpj]
Comments

18 years ago[project @ 2005-07-25 11:08:26 by simonpj]
simonpj [Mon, 25 Jul 2005 11:08:27 +0000 (11:08 +0000)]
[project @ 2005-07-25 11:08:26 by simonpj]
MERGE TO STABLE if poss

Make the "root main" Id :Main.main into an *implicit* Id, whose parent is
Main.main.  What that means is that the "root main" Id won't be emitted
into the interface file.  Which has not been causing a problem in practice
but is clearly wrong -- there were two 'main's in the interface file.

18 years ago[project @ 2005-07-22 14:00:34 by simonpj]
simonpj [Fri, 22 Jul 2005 14:00:35 +0000 (14:00 +0000)]
[project @ 2005-07-22 14:00:34 by simonpj]
MERGE TO STABLE

Fix a long-standing bug in dependency tracking.
If you have

import M( x )

then you must recompile if M's export list changes, because it might
no longer export x.  Until now we have only done that if the import was

import M

I can't think why this bug has lasted so long.  Thanks to Ian Lynagh
for pointing it out.

18 years ago[project @ 2005-07-22 13:58:46 by simonpj]
simonpj [Fri, 22 Jul 2005 13:58:46 +0000 (13:58 +0000)]
[project @ 2005-07-22 13:58:46 by simonpj]
Do refined dependency analysis in typechecking only with -fglasgow-exts

18 years ago[project @ 2005-07-22 13:58:17 by simonpj]
simonpj [Fri, 22 Jul 2005 13:58:17 +0000 (13:58 +0000)]
[project @ 2005-07-22 13:58:17 by simonpj]
Import trimming

18 years ago[project @ 2005-07-22 10:05:11 by simonpj]
simonpj [Fri, 22 Jul 2005 10:05:11 +0000 (10:05 +0000)]
[project @ 2005-07-22 10:05:11 by simonpj]
Document refined dependency analysis

18 years ago[project @ 2005-07-22 08:57:58 by simonpj]
simonpj [Fri, 22 Jul 2005 08:57:58 +0000 (08:57 +0000)]
[project @ 2005-07-22 08:57:58 by simonpj]
Docs on SPECIALISE pragma

18 years ago[project @ 2005-07-22 08:44:43 by simonpj]
simonpj [Fri, 22 Jul 2005 08:44:43 +0000 (08:44 +0000)]
[project @ 2005-07-22 08:44:43 by simonpj]
Wibble to SPECIALISE fix

18 years ago[project @ 2005-07-21 14:46:04 by simonmar]
simonmar [Thu, 21 Jul 2005 14:46:04 +0000 (14:46 +0000)]
[project @ 2005-07-21 14:46:04 by simonmar]
Fix CPP symbols

18 years ago[project @ 2005-07-21 11:05:26 by simonpj]
simonpj [Thu, 21 Jul 2005 11:05:27 +0000 (11:05 +0000)]
[project @ 2005-07-21 11:05:26 by simonpj]
Arrange that a 'deriving' clause works for a GADT-syntax
data type delaration, provided it declares a Haskell-98-style
data type (i.e. no existentials or GADT stuff).

This just allows you to use a different syntax for data type
declarations without losing 'deriving'. A couple of people requested
this, and it's really easy to do.

18 years ago[project @ 2005-07-21 10:46:12 by simonmar]
simonmar [Thu, 21 Jul 2005 10:46:13 +0000 (10:46 +0000)]
[project @ 2005-07-21 10:46:12 by simonmar]
Sparc updates from Peter A Jonsson <pj at ludd.ltu.se>

18 years ago[project @ 2005-07-21 09:57:23 by simonmar]
simonmar [Thu, 21 Jul 2005 09:57:23 +0000 (09:57 +0000)]
[project @ 2005-07-21 09:57:23 by simonmar]
Remove -fnumbers-strict; it doesn't exist any more

18 years ago[project @ 2005-07-21 09:56:26 by simonmar]
simonmar [Thu, 21 Jul 2005 09:56:26 +0000 (09:56 +0000)]
[project @ 2005-07-21 09:56:26 by simonmar]
Update notes on Perl

18 years ago[project @ 2005-07-21 09:27:34 by simonmar]
simonmar [Thu, 21 Jul 2005 09:27:34 +0000 (09:27 +0000)]
[project @ 2005-07-21 09:27:34 by simonmar]
Require Perl >= 5.6

18 years ago[project @ 2005-07-21 08:41:23 by panne]
panne [Thu, 21 Jul 2005 08:41:23 +0000 (08:41 +0000)]
[project @ 2005-07-21 08:41:23 by panne]
compMan is dead, Jim...

18 years ago[project @ 2005-07-19 22:55:10 by simonpj]
simonpj [Tue, 19 Jul 2005 22:55:10 +0000 (22:55 +0000)]
[project @ 2005-07-19 22:55:10 by simonpj]
remove RnSource.lhs-boot and add RnExpr.lhs-boot

18 years ago[project @ 2005-07-19 22:53:37 by simonpj]
simonpj [Tue, 19 Jul 2005 22:53:37 +0000 (22:53 +0000)]
[project @ 2005-07-19 22:53:37 by simonpj]
Wibble

18 years ago[project @ 2005-07-19 16:44:50 by simonpj]
simonpj [Tue, 19 Jul 2005 16:45:02 +0000 (16:45 +0000)]
[project @ 2005-07-19 16:44:50 by simonpj]
WARNING: this is a big commit.  You might want
to wait a few days before updating, in case I've
broken something.

However, if any of the changes are what you wanted,
please check it out and test!

This commit does three main things:

1. A re-organisation of the way that GHC handles bindings in HsSyn.
   This has been a bit of a mess for quite a while.  The key new
   types are

-- Bindings for a let or where clause
data HsLocalBinds id
  = HsValBinds (HsValBinds id)
  | HsIPBinds  (HsIPBinds id)
  | EmptyLocalBinds

-- Value bindings (not implicit parameters)
data HsValBinds id
  = ValBindsIn  -- Before typechecking
(LHsBinds id) [LSig id] -- Not dependency analysed
-- Recursive by default

  | ValBindsOut -- After typechecking
[(RecFlag, LHsBinds id)]-- Dependency analysed

2. Implement Mark Jones's idea of increasing polymoprhism
   by using type signatures to cut the strongly-connected components
   of a recursive group.  As a consequence, GHC no longer insists
   on the contexts of the type signatures of a recursive group
   being identical.

   This drove a significant change: the renamer no longer does dependency
   analysis.  Instead, it attaches a free-variable set to each binding,
   so that the type checker can do the dep anal.  Reason: the typechecker
   needs to do *two* analyses:
one to find the true mutually-recursive groups
(which we need so we can build the right CoreSyn)
one to find the groups in which to typecheck, taking
account of type signatures

3. Implement non-ground SPECIALISE pragmas, as promised, and as
   requested by Remi and Ross.  Certainly, this should fix the
   current problem with GHC, namely that if you have
g :: Eq a => a -> b -> b
   then you can now specialise thus
SPECIALISE g :: Int -> b -> b
    (This didn't use to work.)

   However, it goes further than that.  For example:
f :: (Eq a, Ix b) => a -> b -> b
   then you can make a partial specialisation
SPECIALISE f :: (Eq a) => a -> Int -> Int

    In principle, you can specialise f to *any* type that is
    "less polymorphic" (in the sense of subsumption) than f's
    actual type.  Such as
SPECIALISE f :: Eq a => [a] -> Int -> Int
    But I haven't tested that.

    I implemented this by doing the specialisation in the typechecker
    and desugarer, rather than leaving around the strange SpecPragmaIds,
    for the specialiser to find.  Indeed, SpecPragmaIds have vanished
    altogether (hooray).

    Pragmas in general are handled more tidily.  There's a new
    data type HsBinds.Prag, which lives in an AbsBinds, and carries
    pragma info from the typechecker to the desugarer.

Smaller things

- The loop in the renamer goes via RnExpr, instead of RnSource.
  (That makes it more like the type checker.)

- I fixed the thing that was causing 'check_tc' warnings to be
  emitted.

18 years ago[project @ 2005-07-18 11:47:08 by simonpj]
simonpj [Mon, 18 Jul 2005 11:47:08 +0000 (11:47 +0000)]
[project @ 2005-07-18 11:47:08 by simonpj]
Fix TH_reifyType2 test

18 years ago[project @ 2005-07-18 11:46:32 by simonpj]
simonpj [Mon, 18 Jul 2005 11:46:32 +0000 (11:46 +0000)]
[project @ 2005-07-18 11:46:32 by simonpj]
Comments

18 years ago[project @ 2005-07-15 02:00:15 by wolfgang]
wolfgang [Fri, 15 Jul 2005 02:00:15 +0000 (02:00 +0000)]
[project @ 2005-07-15 02:00:15 by wolfgang]
Mac OS X/PowerPC: Make GHCi deal with the additional statically linked
symbols from libSystemStub.a on Tiger (printf$LDBLStub and friends).

MERGE TO STABLE

18 years ago[project @ 2005-07-14 15:14:33 by simonmar]
simonmar [Thu, 14 Jul 2005 15:14:33 +0000 (15:14 +0000)]
[project @ 2005-07-14 15:14:33 by simonmar]
- -package P picks the latest version of P, instead of complaining
    if P is ambiguous.

  - -hide-package P hides all versions of P, instead of complaining
    if P is ambiguous.

18 years ago[project @ 2005-07-14 15:12:20 by simonmar]
simonmar [Thu, 14 Jul 2005 15:12:20 +0000 (15:12 +0000)]
[project @ 2005-07-14 15:12:20 by simonmar]
- -package P hides all other versions of P (this was advertised
    in the documentation, but wasn't actually implemented in 6.4)

  - if multiple packages with the same name are still exposed after
    the flags have been processed, then all except the latest version
    are hidden.

18 years ago[project @ 2005-07-14 10:38:03 by simonmar]
simonmar [Thu, 14 Jul 2005 10:38:03 +0000 (10:38 +0000)]
[project @ 2005-07-14 10:38:03 by simonmar]
Fix mulMayOflo() on 64-bit archs.  This fixes the arith003 failures on x86_64.

18 years ago[project @ 2005-07-13 13:08:05 by simonmar]
simonmar [Wed, 13 Jul 2005 13:08:05 +0000 (13:08 +0000)]
[project @ 2005-07-13 13:08:05 by simonmar]
#include <windows.h>

18 years ago[project @ 2005-07-13 12:27:55 by simonmar]
simonmar [Wed, 13 Jul 2005 12:27:55 +0000 (12:27 +0000)]
[project @ 2005-07-13 12:27:55 by simonmar]
Handle TREC_CHUNK in update_fwd_large

18 years ago[project @ 2005-07-13 10:16:11 by simonpj]
simonpj [Wed, 13 Jul 2005 10:16:11 +0000 (10:16 +0000)]
[project @ 2005-07-13 10:16:11 by simonpj]
MERGE to STABLE

Switch the order of equations generated by FunDeps.improve,
so that the error messages are more perspicuous.

This fixes SourceForge [ ghc-Bugs-1234239 ]
  "Bad location for violation of functional dependency"

tcfail143 tests.

18 years ago[project @ 2005-07-12 17:07:56 by panne]
panne [Tue, 12 Jul 2005 17:07:56 +0000 (17:07 +0000)]
[project @ 2005-07-12 17:07:56 by panne]
Add casts to silence warnings when using Solaris' simple-minded isupper() macro.

18 years ago[project @ 2005-07-12 16:30:01 by simonpj]
simonpj [Tue, 12 Jul 2005 16:30:01 +0000 (16:30 +0000)]
[project @ 2005-07-12 16:30:01 by simonpj]
Try MERGE to STABLE

When TH splices in code, it was previously decorated with noLoc.  If
there were any type errors in it, we got a very unhelpful message.

Now we propagate the splice location everywhere into the spliced code.
The location isn't very exact, because it refers to the splice site,
but it's better than before.

18 years ago[project @ 2005-07-12 14:50:56 by simonpj]
simonpj [Tue, 12 Jul 2005 14:50:56 +0000 (14:50 +0000)]
[project @ 2005-07-12 14:50:56 by simonpj]
Add an extra note about defaulting in GHCi

18 years ago[project @ 2005-07-12 14:50:10 by simonpj]
simonpj [Tue, 12 Jul 2005 14:50:10 +0000 (14:50 +0000)]
[project @ 2005-07-12 14:50:10 by simonpj]
An earlier commit, liberalising the defaulting rules for ghci,
messed up the handling of defaulting at the top level.  This
commit fixes it.

The current story is that if there's an ambiguous top-level
multi-parameter constraint (C a b), then a,b won't be defaulted,
regardless of how a,b are used otherwise.  A type variable is
defaulted only if it's constrained by single-parameter type classes,
even in the more-liberal GHCi.

tcfail142 tests this case.

18 years ago[project @ 2005-07-12 14:41:00 by simonmar]
simonmar [Tue, 12 Jul 2005 14:41:00 +0000 (14:41 +0000)]
[project @ 2005-07-12 14:41:00 by simonmar]
Give a more helpful error message on platforms for which FFI support
isn't implemented in GHCi (namely x86_64 at the moment).

18 years ago[project @ 2005-07-12 14:34:29 by simonmar]
simonmar [Tue, 12 Jul 2005 14:34:29 +0000 (14:34 +0000)]
[project @ 2005-07-12 14:34:29 by simonmar]
Fix cut-n-pasto in previous commit

18 years ago[project @ 2005-07-12 14:23:51 by simonmar]
simonmar [Tue, 12 Jul 2005 14:23:51 +0000 (14:23 +0000)]
[project @ 2005-07-12 14:23:51 by simonmar]
Disable a couple of assertions for the same reason as the previous commit.

18 years ago[project @ 2005-07-12 13:38:08 by simonpj]
simonpj [Tue, 12 Jul 2005 13:38:08 +0000 (13:38 +0000)]
[project @ 2005-07-12 13:38:08 by simonpj]
Check for an unboxed tuple binding
f = (# True, False #)

A fairly recent change, that treats specially non-recursive bindings of a
single variable, failed to take this into account.

tcfail141 tests this case.  (Was simpl008.)
-

18 years ago[project @ 2005-07-12 13:36:49 by simonpj]
simonpj [Tue, 12 Jul 2005 13:36:49 +0000 (13:36 +0000)]
[project @ 2005-07-12 13:36:49 by simonpj]
Comment only

18 years ago[project @ 2005-07-12 13:34:03 by simonmar]
simonmar [Tue, 12 Jul 2005 13:34:03 +0000 (13:34 +0000)]
[project @ 2005-07-12 13:34:03 by simonmar]
schedulDoGC: when traversing the all_threads list checking for invalid
transactions we were bogusly following the link field rather than the
global_link field.

18 years ago[project @ 2005-07-12 13:01:44 by simonmar]
simonmar [Tue, 12 Jul 2005 13:01:44 +0000 (13:01 +0000)]
[project @ 2005-07-12 13:01:44 by simonmar]
handle PrimTyCons in pprTyConHdr (fixes :i GHC.Base.Int# in GHCi)

18 years ago[project @ 2005-07-12 12:56:36 by simonmar]
simonmar [Tue, 12 Jul 2005 12:56:36 +0000 (12:56 +0000)]
[project @ 2005-07-12 12:56:36 by simonmar]
export some more bits

18 years ago[project @ 2005-07-12 12:20:58 by simonmar]
simonmar [Tue, 12 Jul 2005 12:20:58 +0000 (12:20 +0000)]
[project @ 2005-07-12 12:20:58 by simonmar]
More 64-fixing

18 years ago[project @ 2005-07-12 12:09:44 by simonmar]
simonmar [Tue, 12 Jul 2005 12:09:44 +0000 (12:09 +0000)]
[project @ 2005-07-12 12:09:44 by simonmar]
64 bit fix

18 years ago[project @ 2005-07-12 11:55:17 by simonmar]
simonmar [Tue, 12 Jul 2005 11:55:17 +0000 (11:55 +0000)]
[project @ 2005-07-12 11:55:17 by simonmar]
Use stgMallocBytesRWX for allocating info tables, since the memory
needs to be executable (not sure how this is working on OpenBSD right
now, but it definitely breaks on x86_64/Linux).

18 years ago[project @ 2005-07-12 11:51:31 by simonmar]
simonmar [Tue, 12 Jul 2005 11:51:31 +0000 (11:51 +0000)]
[project @ 2005-07-12 11:51:31 by simonmar]
Move mallocBytesRWX into RtsUtils, rename it to stgMallocBytesRWX, and
export it.

18 years ago[project @ 2005-07-12 11:38:44 by simonmar]
simonmar [Tue, 12 Jul 2005 11:38:44 +0000 (11:38 +0000)]
[project @ 2005-07-12 11:38:44 by simonmar]
Add some comments on why we don't use posix_memalign() right now.

18 years ago[project @ 2005-07-12 09:42:59 by simonmar]
simonmar [Tue, 12 Jul 2005 09:42:59 +0000 (09:42 +0000)]
[project @ 2005-07-12 09:42:59 by simonmar]
declare stg_returnToSchedNotPaused (forgot to commit this yesterday)

18 years ago[project @ 2005-07-11 20:33:45 by panne]
panne [Mon, 11 Jul 2005 20:33:45 +0000 (20:33 +0000)]
[project @ 2005-07-11 20:33:45 by panne]
After some experiments, it seems like we're stealing too many registers from
newer GCCs on SPARC, leading to

   "unable to find a register to spill in class `GENERAL_REGS'"

errors. The fix is to leave l6 and l7 to GCC. Tested with a full 2-stage
bootstrap (including OpenGL/GLUT packages) on SPARC Solaris 8 with GCC 3.4.4.

A test case for this (which I'm too lazy/tired to commit) is:

   module Blah ( foo ) where
   import Foreign.Ptr ( FunPtr )
   type Bar = Int -> Double -> Double -> Double -> IO ()
   foreign import ccall unsafe "dynamic" foo :: FunPtr Bar -> Bar

SimonM: MERGE TO STABLE (if nobody yells)

18 years ago[project @ 2005-07-11 15:57:38 by simonmar]
simonmar [Mon, 11 Jul 2005 15:57:39 +0000 (15:57 +0000)]
[project @ 2005-07-11 15:57:38 by simonmar]
Avoid calling threadPaused() on exit from STG land if we're just
switching to the interpreter, and conversely call threadPaused() in
the interpreter if we're returing to the scheduler for anything other
than switching to STG.

This will probably fix the recent slowdown in GHCi (ioref001 test, for
example).  It was broken when we moved the threadPaused() call into
STG from the scheduler, so it only affects the HEAD.

18 years ago[project @ 2005-07-11 15:34:07 by simonmar]
simonmar [Mon, 11 Jul 2005 15:34:07 +0000 (15:34 +0000)]
[project @ 2005-07-11 15:34:07 by simonmar]
make_constr_itbls: 64-bit fix (size of info table was hardcoded)

18 years ago[project @ 2005-07-11 14:21:54 by simonmar]
simonmar [Mon, 11 Jul 2005 14:21:54 +0000 (14:21 +0000)]
[project @ 2005-07-11 14:21:54 by simonmar]
byte code info tables for x86_64 (same as i386)

18 years ago[project @ 2005-07-11 14:08:07 by simonmar]
simonmar [Mon, 11 Jul 2005 14:08:07 +0000 (14:08 +0000)]
[project @ 2005-07-11 14:08:07 by simonmar]
Turn on GHCi for x86_64

18 years ago[project @ 2005-07-11 13:53:24 by simonmar]
simonmar [Mon, 11 Jul 2005 13:53:24 +0000 (13:53 +0000)]
[project @ 2005-07-11 13:53:24 by simonmar]
GHCi staggers to its feet on x86_64.

The problem is that in the small code model on x86_64, all symbol
relocations are 32-bit, because the program is assumed to fit into
2Gb.  However, shared libraries are linked outside the 2Gb range, and
the linker arranges that references to shared library symbols either
go via a jump table (for code references) or are copied into the 2Gb
area (for data references).

In GHCi's linker, We can use a jump table for the function symbols,
but we can't copy the data symbols because they've already been
relocated to point to the shared library.  What's more, we can't tell
whether a symbol reference is to code or data - this information is
only available from the shared library itself.

Fortunately, at least HSbase.o doesn't have any data references to
shared libraries (at least on the Linux distro I'm using), so I can at
least get GHCi up and limping.

18 years ago[project @ 2005-07-11 12:29:28 by simonmar]
simonmar [Mon, 11 Jul 2005 12:29:28 +0000 (12:29 +0000)]
[project @ 2005-07-11 12:29:28 by simonmar]
awakenBlockedQueue(): check for NULL.  This is a hack to workaround a
bug that occurs when async exceptions, unsafePerformIO, and
interruptible operations are used together.  See the comment in
Exceptions.cmm and bug #1235728 for more details.

18 years ago[project @ 2005-07-11 10:47:20 by simonpj]
simonpj [Mon, 11 Jul 2005 10:47:21 +0000 (10:47 +0000)]
[project @ 2005-07-11 10:47:20 by simonpj]
Wibbles to unifyFunTy error messages

18 years ago[project @ 2005-07-11 10:46:42 by simonpj]
simonpj [Mon, 11 Jul 2005 10:46:43 +0000 (10:46 +0000)]
[project @ 2005-07-11 10:46:42 by simonpj]
Improvements to speakN, define speakNOf, move plural from TcSimplify

18 years ago[project @ 2005-07-11 10:25:43 by simonmar]
simonmar [Mon, 11 Jul 2005 10:25:43 +0000 (10:25 +0000)]
[project @ 2005-07-11 10:25:43 by simonmar]
mingw32: ignore isDoesNotExistError failure from
GHC.ConsoleHandler.flushConsole

Submitted-by: Brian Smith <brianlsmith at gmail.com>

18 years ago[project @ 2005-07-11 09:54:43 by simonpj]
simonpj [Mon, 11 Jul 2005 09:54:44 +0000 (09:54 +0000)]
[project @ 2005-07-11 09:54:43 by simonpj]
Improve the error message from unifyFunTys.  Previously we got a really
horrible message from this:
  t = ((\Just x -> x) :: Maybe a -> a) (Just 1)

Try.hs:1:6:
    Couldn't match the rigid variable `a' against `t -> t1'
      Expected type: a
      Inferred type: t -> t1

Now it's much better:

Try.hs:14:6:
    The lambda expression `\ Just x -> ...' has two arguments,
    but its type `Maybe a -> a' has only one
    In the expression: (\ Just x -> x) :: Maybe a -> a

tcfail140 tests some cases

18 years ago[project @ 2005-07-11 09:48:57 by simonpj]
simonpj [Mon, 11 Jul 2005 09:48:57 +0000 (09:48 +0000)]
[project @ 2005-07-11 09:48:57 by simonpj]
Fix a bug in the renamer for parallel list comprehensions
MERGE TO STABLE

It's surprinsingly tricky to combine
  a) The parallel scopes for par-list-comps
with
  b) The general form of the renamer types, whereby
     scoped constructs work like
 rnPat :: Pat -> RnM (thing,FreeVars)
       -> RnM ((Pat,thing), FreeVars)
     This general shape neatly allows rnPat to
     extend the envt, report unused variables from
     the 'thing' inside, and return the correct set
     of free variables

But combining (a) and (b) is tricky, and was plain wrong before.

18 years ago[project @ 2005-07-11 09:48:19 by simonpj]
simonpj [Mon, 11 Jul 2005 09:48:19 +0000 (09:48 +0000)]
[project @ 2005-07-11 09:48:19 by simonpj]
Add speakN, and the ability to set printing depth

18 years ago[project @ 2005-07-11 09:17:41 by simonmar]
simonmar [Mon, 11 Jul 2005 09:17:41 +0000 (09:17 +0000)]
[project @ 2005-07-11 09:17:41 by simonmar]
enable splitting on x86_64

18 years ago[project @ 2005-07-11 09:10:58 by simonmar]
simonmar [Mon, 11 Jul 2005 09:10:58 +0000 (09:10 +0000)]
[project @ 2005-07-11 09:10:58 by simonmar]
x86_64: Pass -fno-asynchronous-unwind-tables to gcc, which eliminates
some unnecessary junk from the via-C generated code and allows
-split-objs to work.

18 years ago[project @ 2005-07-09 14:44:06 by panne]
panne [Sat, 9 Jul 2005 14:44:06 +0000 (14:44 +0000)]
[project @ 2005-07-09 14:44:06 by panne]
Fixed & simplified previous commit.

18 years ago[project @ 2005-07-09 14:35:51 by panne]
panne [Sat, 9 Jul 2005 14:35:51 +0000 (14:35 +0000)]
[project @ 2005-07-09 14:35:51 by panne]
Silence the error message when ld doesn't understand the -x option.

18 years ago[project @ 2005-07-09 14:33:01 by panne]
panne [Sat, 9 Jul 2005 14:33:01 +0000 (14:33 +0000)]
[project @ 2005-07-09 14:33:01 by panne]
Solaris' sed obviously doesn't like nested \(\), so do the gcc version
detection magic in two steps instead of one.

18 years ago[project @ 2005-07-09 00:13:14 by igloo]
igloo [Sat, 9 Jul 2005 00:13:14 +0000 (00:13 +0000)]
[project @ 2005-07-09 00:13:14 by igloo]
Fix building on IA64.

Please merge to stable.

18 years ago[project @ 2005-07-08 19:49:24 by simonpj]
simonpj [Fri, 8 Jul 2005 19:49:24 +0000 (19:49 +0000)]
[project @ 2005-07-08 19:49:24 by simonpj]
Revert accidental commit (merge to stable if bogus commit was merged)

18 years ago[project @ 2005-07-08 16:16:37 by simonpj]
simonpj [Fri, 8 Jul 2005 16:16:37 +0000 (16:16 +0000)]
[project @ 2005-07-08 16:16:37 by simonpj]
MERGE TO STABLE (once I"ve checked it works)

The dictionary-floating code in Specialise wasn't taking
variables free in the RULES into account, which resulted in
such variables perhaps going out of scope.

18 years ago[project @ 2005-07-08 15:05:15 by simonpj]
simonpj [Fri, 8 Jul 2005 15:05:16 +0000 (15:05 +0000)]
[project @ 2005-07-08 15:05:15 by simonpj]
MERGE TO STABLE

Add a check for Haskell-98 mode, to check that there is no type
synonym in an instance declaration.

tcfail139 tests this case

18 years ago[project @ 2005-07-08 13:57:50 by simonmar]
simonmar [Fri, 8 Jul 2005 13:57:50 +0000 (13:57 +0000)]
[project @ 2005-07-08 13:57:50 by simonmar]
genOutputFilenameFunc: fix output filename generated for non-Haskell
compilations with -odir.

18 years ago[project @ 2005-07-08 11:16:00 by simonmar]
simonmar [Fri, 8 Jul 2005 11:16:00 +0000 (11:16 +0000)]
[project @ 2005-07-08 11:16:00 by simonmar]
Clean .hi-boot and .o-boot files too

18 years ago[project @ 2005-07-07 13:50:40 by simonmar]
simonmar [Thu, 7 Jul 2005 13:50:40 +0000 (13:50 +0000)]
[project @ 2005-07-07 13:50:40 by simonmar]
small performance fix: in via-C mode we previously always created a
switch instead of an conditional-tree for a multi-branch case.  Refine
this slightly so that 2-branch switches turn into conditionals again,
since gcc doesn't do a good job of optimising the equivalent switch.

18 years ago[project @ 2005-07-06 11:31:53 by panne]
panne [Wed, 6 Jul 2005 11:31:53 +0000 (11:31 +0000)]
[project @ 2005-07-06 11:31:53 by panne]
DocBook validation police

18 years ago[project @ 2005-07-06 10:43:36 by simonmar]
simonmar [Wed, 6 Jul 2005 10:43:36 +0000 (10:43 +0000)]
[project @ 2005-07-06 10:43:36 by simonmar]
ghc -e should exit(1) if the statement fails to compile.

Fixes #1233146 (this was already partially fixed, in that ghc -e would
exit(1) if the modules fail to compile, but if the expression itself
was invalid it would still exit(0)).

18 years ago[project @ 2005-07-05 04:55:30 by dons]
dons [Tue, 5 Jul 2005 04:55:30 +0000 (04:55 +0000)]
[project @ 2005-07-05 04:55:30 by dons]
Fix ffi on OpenBSD by dynamically allocating the obscure_ccall_ret_code.
Also merge in SimonM's wrapper over inline asm patch.

18 years ago[project @ 2005-07-01 09:41:24 by simonmar]
simonmar [Fri, 1 Jul 2005 09:41:24 +0000 (09:41 +0000)]
[project @ 2005-07-01 09:41:24 by simonmar]
setContextAfterLoad: include the Prelude if the top module is compiled
(this broke at some point in the HEAD, 6.4 works fine).

18 years ago[project @ 2005-06-29 16:04:04 by simonpj]
simonpj [Wed, 29 Jun 2005 16:04:04 +0000 (16:04 +0000)]
[project @ 2005-06-29 16:04:04 by simonpj]
Vital wibble to last commit!

18 years ago[project @ 2005-06-29 15:41:27 by simonpj]
simonpj [Wed, 29 Jun 2005 15:41:27 +0000 (15:41 +0000)]
[project @ 2005-06-29 15:41:27 by simonpj]
MERGE TO STABLE

Fix a long-lurking renamer bug, concerning the reporting of ambiguous
name occurrences.

(the merge may require a little fiddling)

18 years ago[project @ 2005-06-29 08:47:21 by simonmar]
simonmar [Wed, 29 Jun 2005 08:47:21 +0000 (08:47 +0000)]
[project @ 2005-06-29 08:47:21 by simonmar]
Make it compile on Alpha.