ghc-hetmet.git
22 years ago[project @ 2001-09-15 04:29:58 by ken]
ken [Sat, 15 Sep 2001 04:29:58 +0000 (04:29 +0000)]
[project @ 2001-09-15 04:29:58 by ken]
Make the binary distribution Makefile work with non-GNU make when
installing in-place. MERGE TO STABLE

22 years ago[project @ 2001-09-14 16:54:13 by qrczak]
qrczak [Fri, 14 Sep 2001 16:54:13 +0000 (16:54 +0000)]
[project @ 2001-09-14 16:54:13 by qrczak]
Make -c actually working (as --cc).

22 years ago[project @ 2001-09-14 16:01:20 by sewardj]
sewardj [Fri, 14 Sep 2001 16:01:20 +0000 (16:01 +0000)]
[project @ 2001-09-14 16:01:20 by sewardj]
Update version to 5.02.

MERGE TO STABLE

22 years ago[project @ 2001-09-14 15:56:40 by simonmar]
simonmar [Fri, 14 Sep 2001 15:56:40 +0000 (15:56 +0000)]
[project @ 2001-09-14 15:56:40 by simonmar]
Document how to use "foreign export" with GHC, including how to call
startupHaskell()/shutdownHaskell() when providing your own main().

22 years ago[project @ 2001-09-14 15:53:41 by sewardj]
sewardj [Fri, 14 Sep 2001 15:53:41 +0000 (15:53 +0000)]
[project @ 2001-09-14 15:53:41 by sewardj]
merge rev 1.47.2.1:

* typo ('-help' -> '--help')

22 years ago[project @ 2001-09-14 15:51:41 by simonpj]
simonpj [Fri, 14 Sep 2001 15:51:43 +0000 (15:51 +0000)]
[project @ 2001-09-14 15:51:41 by simonpj]
--------------------------
Add a rule-check pass
(special request by Manuel)
--------------------------

DO NOT merge with stable

The flag

-frule-check foo

will report all sites at which RULES whose name starts with "foo.."
might apply, but in fact the arguments don't match so the rule
doesn't apply.

The pass is run right after all the core-to-core passes.  (Next thing
to do: make the core-to-core script external, so you can fiddle with
it.  Meanwhile, the core-to-core script is in
DriverState.builCoreToDo
so you can move the CoreDoRuleCheck line around if you want.

The format of the report is experimental: Manuel, feel free to fiddle
with it.

Most of the code is in specialise/Rules.lhs

Incidental changes
~~~~~~~~~~~~~~~~~~
Change BuiltinRule so that the rule name is accessible
without actually successfully applying the rule.  This
change affects quite a few files in a trivial way.

22 years ago[project @ 2001-09-14 15:49:56 by simonpj]
simonpj [Fri, 14 Sep 2001 15:49:56 +0000 (15:49 +0000)]
[project @ 2001-09-14 15:49:56 by simonpj]
-----------------
Make seq built in
-----------------

DO NOT merge with stable

Until this commit 'seq' used a cunning hack so that it
seems to be *non-strict* in its second argument:

  seq x y = case seq# x of { 0 -> y; other -> error "urk" }

The reason for this is to make sure that x is evaluated before y,
which is what you want in a parallel setting.

But in a *sequential* settting, this simply destroys strictness
information about y.  Now that people are starting to use seq more,
this is becoming painful.  People sometimes use seq to make their
function strict, and are surprised when it becomes non-strict in other
arguments!

So this commit changes seq so that it does what you would naively
expect:

seq x y = case x of { any -> y }

This is done by making seq built-in, defined along with
unsafeCoerce
getTag

in MkId.lhs.  (I considered giving their unfoldings in
PrelGHC.hi-boot.pp, but then there is the matter of making sure they
are unfolded, since these fns don't have top-level curried defns,
so I held off and did seq the same way as the other two.)

I renamed PrelConc.seq as PrelConc.pseq; maybe its name will change
to `then` or `before` or something else.  That's up to the GPH
folk.

22 years ago[project @ 2001-09-14 15:45:53 by simonpj]
simonpj [Fri, 14 Sep 2001 15:45:53 +0000 (15:45 +0000)]
[project @ 2001-09-14 15:45:53 by simonpj]
Add comments

22 years ago[project @ 2001-09-14 15:44:13 by simonpj]
simonpj [Fri, 14 Sep 2001 15:44:13 +0000 (15:44 +0000)]
[project @ 2001-09-14 15:44:13 by simonpj]
--------------------------
Cleanup in DataCon
--------------------------

DO NOT merge with stable

The dataConRepStrictness call used to reuturn a [Demand],
but that's a bit misleading.  In particular, consider a  strict
constructor

data Foo = MkFoo ![Int]

Then the wrapper MkFoo is strict, but the worker $wMkFoo is not.

MkFoo x = case x of { DEFAULT -> $wMkFoo x }

Nevertheless, when we pattern-match on $wMkFoo we will surely
find an evaluated component to the data structure, and that is
what dataConRepStrictness reports, and that's how it is used
in Simplify.

Solution: make dataConRepStrictness return [StrictnessMark]
not [Demand]. A small matter really.

22 years ago[project @ 2001-09-14 14:51:06 by simonmar]
simonmar [Fri, 14 Sep 2001 14:51:06 +0000 (14:51 +0000)]
[project @ 2001-09-14 14:51:06 by simonmar]
oops: hPutStr wasn't flushing a line-buffered handle properly at the
end of a line.

MERGE TO STABLE

22 years ago[project @ 2001-09-14 13:52:21 by sewardj]
sewardj [Fri, 14 Sep 2001 13:52:21 +0000 (13:52 +0000)]
[project @ 2001-09-14 13:52:21 by sewardj]
Make rotate fns work properly when rotate count is a multiple of the
word size.  This fixes sparc failures in
ghc-regress/numeric/should_run/arith011.  Also fix some
copy-and-paste-o-s.Killed by signal 2.

MERGE TO STABLE

22 years ago[project @ 2001-09-13 15:54:43 by simonmar]
simonmar [Thu, 13 Sep 2001 15:54:43 +0000 (15:54 +0000)]
[project @ 2001-09-13 15:54:43 by simonmar]
Back out the change to remove Ord as a superclass of Ix; the revised
Haskell 98 report will no longer have this change.

22 years ago[project @ 2001-09-13 14:44:24 by simonpj]
simonpj [Thu, 13 Sep 2001 14:44:24 +0000 (14:44 +0000)]
[project @ 2001-09-13 14:44:24 by simonpj]
More error-message grammar

22 years ago[project @ 2001-09-12 15:52:40 by sewardj]
sewardj [Wed, 12 Sep 2001 15:52:40 +0000 (15:52 +0000)]
[project @ 2001-09-12 15:52:40 by sewardj]
merge (ghc-5-02-branch --> HEAD):

Bugfix: there was an implicit assumption that the list of slots passed
to freeStackSlots was already sorted, whereas in fact this wasn't the
case for at least one call.  Now we explicitly sort the list in
freeStackSlots, removing the hidden assumption.

The symptoms of this bug include crashes (perhaps the "AsmCodeGen"
crash), and a tendency to grow the stack a lot when let-no-escapes are
involved (because the bug caused fragmentation of the stack free list,
so we weren't re-using free slots properly).
  1.17.2.1  +3 -2      fptools/ghc/compiler/codeGen/CgStackery.lhs

ASSERT that the list of stack slots we calculate in buildLivenessMask
is sorted, because we rely on that property later.
  1.38.2.1  +5 -6      fptools/ghc/compiler/codeGen/CgBindery.lhs

22 years ago[project @ 2001-09-12 14:53:39 by sewardj]
sewardj [Wed, 12 Sep 2001 14:53:39 +0000 (14:53 +0000)]
[project @ 2001-09-12 14:53:39 by sewardj]
Redo half-arsed hacks to do with BSS symbols on ELF.  Hopefully get it
right this time.

MERGE TO STABLE

22 years ago[project @ 2001-09-12 11:52:58 by rrt]
rrt [Wed, 12 Sep 2001 11:52:58 +0000 (11:52 +0000)]
[project @ 2001-09-12 11:52:58 by rrt]
Do the ifdefery properly so it works on Unix.

22 years ago[project @ 2001-09-12 11:24:18 by rrt]
rrt [Wed, 12 Sep 2001 11:24:18 +0000 (11:24 +0000)]
[project @ 2001-09-12 11:24:18 by rrt]
Updated to new directory structure (no extra-bin), and with all the right
binaries in bin.

22 years ago[project @ 2001-09-12 11:16:05 by rrt]
rrt [Wed, 12 Sep 2001 11:16:05 +0000 (11:16 +0000)]
[project @ 2001-09-12 11:16:05 by rrt]
Make hsc2hs find template-hsc.h on Windows. This involves putting Main.hs
through cpp; to avoid the string gap problem preprocessing
__GLASGOW_HASKELL__ into its value inside strings, make judicious use of ++
(hope that's OK, Marcin; there seemed very little point in putting it all in
KludgedSystem this time).

22 years ago[project @ 2001-09-12 11:05:34 by qrczak]
qrczak [Wed, 12 Sep 2001 11:05:34 +0000 (11:05 +0000)]
[project @ 2001-09-12 11:05:34 by qrczak]
Fix comment.

22 years ago[project @ 2001-09-12 10:22:19 by qrczak]
qrczak [Wed, 12 Sep 2001 10:22:19 +0000 (10:22 +0000)]
[project @ 2001-09-12 10:22:19 by qrczak]
Fix creating HSstd.o.

22 years ago[project @ 2001-09-12 05:52:13 by qrczak]
qrczak [Wed, 12 Sep 2001 05:52:13 +0000 (05:52 +0000)]
[project @ 2001-09-12 05:52:13 by qrczak]
Don't exclude PrelMain.o from libHSstd.a.

22 years ago[project @ 2001-09-11 11:13:22 by rje]
rje [Tue, 11 Sep 2001 11:13:22 +0000 (11:13 +0000)]
[project @ 2001-09-11 11:13:22 by rje]
hasktags is now built as part of the standard build process.

22 years ago[project @ 2001-09-11 09:02:43 by simonpj]
simonpj [Tue, 11 Sep 2001 09:02:43 +0000 (09:02 +0000)]
[project @ 2001-09-11 09:02:43 by simonpj]
--------------------------
Strictness of blockAsynch
--------------------------

MERGE WITH STABLE BRANCH

If we're going to supply strictness info for blockAsynchExceptions#,
it should match its arity (as other State# transformers do).

22 years ago[project @ 2001-09-11 08:18:16 by simonpj]
simonpj [Tue, 11 Sep 2001 08:18:16 +0000 (08:18 +0000)]
[project @ 2001-09-11 08:18:16 by simonpj]
-----------------------
More demand-info fixes
-----------------------

MERGE WITH STABLE BRANCH

There are a handful of functions in IdInfo that zap the
demand-info stored in an Id.  Alas, they were zapping the
*old* demand-info not the new one.  (The old one is still
there for comparison purposes.)  So we were getting some
spurious warnings and (more seriously) potentially some
incorrect strictness.  Easily fixed though.

22 years ago[project @ 2001-09-10 16:48:10 by simonmar]
simonmar [Mon, 10 Sep 2001 16:48:10 +0000 (16:48 +0000)]
[project @ 2001-09-10 16:48:10 by simonmar]
Sync the documentation with the extra-bin removal.

22 years ago[project @ 2001-09-10 12:57:59 by simonmar]
simonmar [Mon, 10 Sep 2001 12:57:59 +0000 (12:57 +0000)]
[project @ 2001-09-10 12:57:59 by simonmar]
oops, revert accidental commit

22 years ago[project @ 2001-09-10 12:57:25 by simonmar]
simonmar [Mon, 10 Sep 2001 12:57:25 +0000 (12:57 +0000)]
[project @ 2001-09-10 12:57:25 by simonmar]
good riddance

22 years ago[project @ 2001-09-10 12:53:21 by simonmar]
simonmar [Mon, 10 Sep 2001 12:53:21 +0000 (12:53 +0000)]
[project @ 2001-09-10 12:53:21 by simonmar]
Remove the "extra-bin" subdirectory from $(libexecdir), since there
are too many assumptions in the tree that $(libexecdir) == $(libdir)
(at the moment, binary dists are fairly well broken).

Reuben has promised to track the change in the Windows distribution.

22 years ago[project @ 2001-09-10 10:07:21 by rje]
rje [Mon, 10 Sep 2001 10:07:21 +0000 (10:07 +0000)]
[project @ 2001-09-10 10:07:21 by rje]
Fixed a bug in TICKY_TICKY profiling.

Previously, the TICK_ENT_DIRECT event was logged before the heap/stack
check was done. As a result, if the check failed, the TICK_ENT_DIRECT
event would be logged a second time, causing TICKY_TICKY to give innacurate
numbers.

This patch shouldn't have any affect on non-ticky compilation.

Also changed the modified bit of code to use "do" notation, and so look a bit
neater.

22 years ago[project @ 2001-09-10 07:25:17 by simonpj]
simonpj [Mon, 10 Sep 2001 07:25:17 +0000 (07:25 +0000)]
[project @ 2001-09-10 07:25:17 by simonpj]
Fix ungramatical error message

22 years ago[project @ 2001-09-10 07:24:09 by simonpj]
simonpj [Mon, 10 Sep 2001 07:24:09 +0000 (07:24 +0000)]
[project @ 2001-09-10 07:24:09 by simonpj]
-----------------------------------
Fix a strictness bug in the simplifier
-----------------------------------

This one has been there a long time, but hasn't bitten till
now.  We should never float a let that is marked "sure to be
evaluated" out of a let.  It shouldn't happen, and there was
a warning to check, but the warning cried 'wolf' too often, so
we have generally ignored it. But the wolf called for supper,
when compiling spectral/expert with profiling on.

The fix is simple too:
* use exprIsValue not exprIsCheap as the test
* move the warning, so it doesn't cry wolf

Documentation with Simplify.simplRhs.

On the way, I'm going to conmmit a change in the same module,
which keeps unfolding info on lambda-bound variables.  This
improves the elimination of cases when the wrapper does the
'seq' -- then the worker gets to know that the arg is evaluated.

22 years ago[project @ 2001-09-08 22:40:38 by ken]
ken [Sat, 8 Sep 2001 22:40:38 +0000 (22:40 +0000)]
[project @ 2001-09-08 22:40:38 by ken]
Make the binary distribution configure recognize alphaev56-dec-osf5.
MERGE TO STABLE.

22 years ago[project @ 2001-09-08 21:42:07 by sof]
sof [Sat, 8 Sep 2001 21:42:07 +0000 (21:42 +0000)]
[project @ 2001-09-08 21:42:07 by sof]
Remove ugly special casing - if you want to turn off the
default rule for GHCI_LIBRARY, set DONT_WANT_STD_GHCI_LIB_RULE
to YES in your Makefile prior to including $(TOP)/mk/target.mk

ghc/lib/std and hslibs/win32 both do this now on mingw32.

22 years ago[project @ 2001-09-07 16:52:53 by simonpj]
simonpj [Fri, 7 Sep 2001 16:52:53 +0000 (16:52 +0000)]
[project @ 2001-09-07 16:52:53 by simonpj]
Make isStrictDmd give the right answer

22 years ago[project @ 2001-09-07 16:46:21 by simonpj]
simonpj [Fri, 7 Sep 2001 16:46:21 +0000 (16:46 +0000)]
[project @ 2001-09-07 16:46:21 by simonpj]
Make dmdFix not loop forever

22 years ago[project @ 2001-09-07 16:08:31 by sewardj]
sewardj [Fri, 7 Sep 2001 16:08:31 +0000 (16:08 +0000)]
[project @ 2001-09-07 16:08:31 by sewardj]
Fix compilation with -DDEBUG.

MERGE TO STABLE

22 years ago[project @ 2001-09-07 13:38:55 by simonpj]
simonpj [Fri, 7 Sep 2001 13:38:55 +0000 (13:38 +0000)]
[project @ 2001-09-07 13:38:55 by simonpj]
Improve the error message for duplicate or invalid binders
in a binding group.

[Consequence: rnfail034 should not be an expected failure
      any more]

MERGE WITH STABLE BRANCH

22 years ago[project @ 2001-09-07 12:44:30 by simonpj]
simonpj [Fri, 7 Sep 2001 12:44:30 +0000 (12:44 +0000)]
[project @ 2001-09-07 12:44:30 by simonpj]
----------------------------------------
Make dict funs and default methods
into LocalIds only at their binding site
----------------------------------------
        [part of 3 related commits]

There's a long comment about this with MkId.mkDefaultMethodId,
which I reproduce below.

While I was at it, I renamed setIdNoDiscard to setIdLocalExported.
Which is hardly an improvement, I'm afraid.  This renaming touches
Var.lhs, Id.lhs, SimplCore.lhs
in a trivial way.

---------------------

Dict funs and default methods are *not* ImplicitIds.  Their definition
involves user-written code, so we can't figure out their strictness etc
based on fixed info, as we can for constructors and record selectors (say).

We build them as GlobalIds, but when in the module where they are
bound, we turn the Id at the *binding site* into an exported LocalId.
This ensures that they are taken to account by free-variable finding
and dependency analysis (e.g. CoreFVs.exprFreeVars).   The simplifier
will propagate the LocalId to all occurrence sites.

Why shouldn't they be bound as GlobalIds?  Because, in particular, if
they are globals, the specialiser floats dict uses above their defns,
which prevents good simplifications happening.  Also the strictness
analyser treats a occurrence of a GlobalId as imported and assumes it
contains strictness in its IdInfo, which isn't true if the thing is
bound in the same module as the occurrence.

It's OK for dfuns to be LocalIds, because we form the instance-env to
pass on to the next module (md_insts) in CoreTidy, afer tidying
and globalising the top-level Ids.

BUT make sure they are *exported* LocalIds (setIdLocalExported) so
that they aren't discarded by the occurrence analyser.

22 years ago[project @ 2001-09-07 12:43:28 by simonpj]
simonpj [Fri, 7 Sep 2001 12:43:28 +0000 (12:43 +0000)]
[project @ 2001-09-07 12:43:28 by simonpj]
-----------------------------------
Pin on accurate strictness info for
record and dictionary selectors
-----------------------------------
        [part of 3 related commits]

This fixes a long-standing infelicity.  Sometimes selectors aren't
inlined until after strictness analysis, so if we don't have decent
strictness info on them we get bad strictness results.

For record selectors, the unboxing-strict-fields stuff makes it hard
to figurwe out the correct strictness, so we just invoke the demand
analyser to work it out.

22 years ago[project @ 2001-09-07 12:42:46 by simonpj]
simonpj [Fri, 7 Sep 2001 12:42:47 +0000 (12:42 +0000)]
[project @ 2001-09-07 12:42:46 by simonpj]
------------------------
Fix the demand analyser
------------------------

A spiffy new domain for demands, and definitions for lub/both
which are actually monotonic.   Quite a bit of related jiggling
around.

One of the original motivations was to do with functions like:

sum n []     = n
sum n (x:xs) = sum (n+x) xs

Even though n is returned boxed from the first case, we don't want
to get strictness
S(L)V -> T
because that means we pass the box for n, and that is TERRIBLE.
So the new version errs on the side of unboxing, more like the forwards
analyser, and only passes the box if it is *definitely* needed, rather
than if it *may* be needed.

22 years ago[project @ 2001-09-07 12:34:54 by simonpj]
simonpj [Fri, 7 Sep 2001 12:34:54 +0000 (12:34 +0000)]
[project @ 2001-09-07 12:34:54 by simonpj]
Omit unnecessary import

22 years ago[project @ 2001-09-07 12:34:03 by simonpj]
simonpj [Fri, 7 Sep 2001 12:34:04 +0000 (12:34 +0000)]
[project @ 2001-09-07 12:34:03 by simonpj]
-------------------
Newtypes and ccalls
     [addendum]
-------------------

MERGE WITH STABLE BRANCH

I accidentally omitted these two wibbles from my previous commit.
I've added PrelNames.unitTyConKey, and used it in TcType and DsCCall.

22 years ago[project @ 2001-09-07 12:30:15 by simonpj]
simonpj [Fri, 7 Sep 2001 12:30:15 +0000 (12:30 +0000)]
[project @ 2001-09-07 12:30:15 by simonpj]
-------------------
Newtypes and ccalls
-------------------

MERGE WITH STABLE BRANCH

Yet another bit of newtype-squashing that hadn't been
synced with reality.  In desugaring ccalls, we can still
see newtypes, if they are recursive, and we must generate
appropriate coerces.

Fixes a bug in cg011.

22 years ago[project @ 2001-09-06 21:08:16 by ken]
ken [Thu, 6 Sep 2001 21:08:16 +0000 (21:08 +0000)]
[project @ 2001-09-06 21:08:16 by ken]
Fix the code to *really* do the following:

On the Alpha we can only handle <= 4 integer arguments with foreign export
dynamic.  Following the example of the corresponding Sparc hack, we detect
when we're being asked to do something we can't and refuse.

MERGE TO STABLE BRANCH

22 years ago[project @ 2001-09-06 15:54:48 by apt]
apt [Thu, 6 Sep 2001 15:54:48 +0000 (15:54 +0000)]
[project @ 2001-09-06 15:54:48 by apt]
document -fext-core flag and set pointers to ext-core docs/tools (MERGE to STABLE pleeeeeease.)

22 years ago[project @ 2001-09-06 15:43:35 by simonpj]
simonpj [Thu, 6 Sep 2001 15:43:35 +0000 (15:43 +0000)]
[project @ 2001-09-06 15:43:35 by simonpj]
Import wibbles

22 years ago[project @ 2001-09-06 15:38:16 by sewardj]
sewardj [Thu, 6 Sep 2001 15:38:16 +0000 (15:38 +0000)]
[project @ 2001-09-06 15:38:16 by sewardj]
Change a couple more Int32s into CTimes, which they are really.

22 years ago[project @ 2001-09-06 15:15:23 by sewardj]
sewardj [Thu, 6 Sep 2001 15:15:23 +0000 (15:15 +0000)]
[project @ 2001-09-06 15:15:23 by sewardj]
Convert some CInts into CTimes.

MERGE TO STABLE.

22 years ago[project @ 2001-09-06 14:41:21 by apt]
apt [Thu, 6 Sep 2001 14:41:21 +0000 (14:41 +0000)]
[project @ 2001-09-06 14:41:21 by apt]
add pointer to primops.txt documentation feature

22 years ago[project @ 2001-09-06 14:26:14 by apt]
apt [Thu, 6 Sep 2001 14:26:14 +0000 (14:26 +0000)]
[project @ 2001-09-06 14:26:14 by apt]
change ext-core output file suffix from .core (too easy to delete accidentally) to .hcr (MERGE TO STABLE)

22 years ago[project @ 2001-09-06 10:03:32 by sewardj]
sewardj [Thu, 6 Sep 2001 10:03:32 +0000 (10:03 +0000)]
[project @ 2001-09-06 10:03:32 by sewardj]
Fix cpp-inspired sparc breakage.  Sigh.

22 years ago[project @ 2001-09-05 15:15:33 by sewardj]
sewardj [Wed, 5 Sep 2001 15:15:33 +0000 (15:15 +0000)]
[project @ 2001-09-05 15:15:33 by sewardj]
Fix 32-bit breakage.  Int32 is the wrong thing; CInt is probably
right.  I assume that Alpha is LP64, so that on Alpha
   sizeof(int) = 32, sizeof(long) = 64
and that these are both sized at 32 for 32-bit platforms.

22 years ago[project @ 2001-09-05 04:03:15 by ken]
ken [Wed, 5 Sep 2001 04:03:15 +0000 (04:03 +0000)]
[project @ 2001-09-05 04:03:15 by ken]
Replace CLong with CInt32 to fix 32-bit assumption. MERGE TO STABLE BRANCH

22 years ago[project @ 2001-09-04 18:29:20 by ken]
ken [Tue, 4 Sep 2001 18:29:22 +0000 (18:29 +0000)]
[project @ 2001-09-04 18:29:20 by ken]
THIS CHANGE AFFECTS ALL OBJECT FILES COMPILED FROM HASKELL.
Please say "make -C ghc/lib/std clean; make -C hslibs clean".

This commit eliminates spurious warning messages when compiling on
the Alpha.  There are two kinds of spurious warning messages:

(1) gcc: -noprefix_recognition: linker input file unused since linking not done

    This warning is because we pass the flag "-Xlinker -noprefix_recognition"
    to gcc.  We remove this warning by no longer passing the flag to gcc,
    and by removing the reason we were passing the flag in the first place:
    __init_* is now renamed to __stginit_*.

(2) .../includes/Regs.h: warning: call-clobbered register used for global
    register variable

    This warning and all other warnings except (1), we eliminate by
    passing the -w flag to gcc.

MERGE TO STABLE BRANCH

22 years ago[project @ 2001-09-04 18:22:34 by ken]
ken [Tue, 4 Sep 2001 18:22:34 +0000 (18:22 +0000)]
[project @ 2001-09-04 18:22:34 by ken]
On the Alpha we can only handle <= 4 integer arguments with foreign export
dynamic.  Following the example of the corresponding Sparc hack, we detect
when we're being asked to do something we can't and refuse.

MERGE TO STABLE BRANCH

22 years ago[project @ 2001-09-04 16:49:12 by sewardj]
sewardj [Tue, 4 Sep 2001 16:49:12 +0000 (16:49 +0000)]
[project @ 2001-09-04 16:49:12 by sewardj]
Fix ELF compilation for new section table scheme.

22 years ago[project @ 2001-09-04 16:35:02 by sewardj]
sewardj [Tue, 4 Sep 2001 16:35:02 +0000 (16:35 +0000)]
[project @ 2001-09-04 16:35:02 by sewardj]
Build system hacks to split HSwin32.o into two parts, so that it
can be loaded into GHCi.  Uses the same gruesome hacks as HSstd.o.

22 years ago[project @ 2001-09-04 16:33:04 by sewardj]
sewardj [Tue, 4 Sep 2001 16:33:04 +0000 (16:33 +0000)]
[project @ 2001-09-04 16:33:04 by sewardj]
Further linker fixes.  Record .bss space allocated, for the benefit of
LOOKS_LIKE_GHC_INFO etc tests done by the GC.  In this commit, for
Win32 only.

Also some minor tweaks so that -package win32 can be loaded into GHCi.

22 years ago[project @ 2001-09-04 14:11:58 by ken]
ken [Tue, 4 Sep 2001 14:11:58 +0000 (14:11 +0000)]
[project @ 2001-09-04 14:11:58 by ken]
Just as we do on sparc:
On alpha, create code to shuffle a0 .. a3 into a2 .. a5 before the
old code.  This is a GHASTLY HACK which at least makes f-x-dynamic on
alpha work for callees with up to 32 bytes (4 words) of args.

22 years ago[project @ 2001-09-02 10:40:34 by qrczak]
qrczak [Sun, 2 Sep 2001 10:40:34 +0000 (10:40 +0000)]
[project @ 2001-09-02 10:40:34 by qrczak]
Clean core, not *core (because of ext-core dirs).

22 years ago[project @ 2001-08-31 15:58:30 by apt]
apt [Fri, 31 Aug 2001 15:58:30 +0000 (15:58 +0000)]
[project @ 2001-08-31 15:58:30 by apt]
add ext-core example programs -- MERGE TO STABLE (surely harmless?)

22 years ago[project @ 2001-08-31 15:48:55 by apt]
apt [Fri, 31 Aug 2001 15:48:55 +0000 (15:48 +0000)]
[project @ 2001-08-31 15:48:55 by apt]
add documentation for ext-core -- MERGE TO STABLE (surely harmless?)

22 years ago[project @ 2001-08-31 15:28:49 by apt]
apt [Fri, 31 Aug 2001 15:28:49 +0000 (15:28 +0000)]
[project @ 2001-08-31 15:28:49 by apt]
fix documentation typos

22 years ago[project @ 2001-08-31 14:40:31 by simonmar]
simonmar [Fri, 31 Aug 2001 14:40:31 +0000 (14:40 +0000)]
[project @ 2001-08-31 14:40:31 by simonmar]
Fix worker-wrapper generation.  See commments in WwLib.mk_ww_str

22 years ago[project @ 2001-08-31 14:32:03 by sewardj]
sewardj [Fri, 31 Aug 2001 14:32:03 +0000 (14:32 +0000)]
[project @ 2001-08-31 14:32:03 by sewardj]
Fix Linux compile b0rkage.  Darn.

MERGE TO STABLE BRANCH

22 years ago[project @ 2001-08-31 13:51:45 by sewardj]
sewardj [Fri, 31 Aug 2001 13:51:45 +0000 (13:51 +0000)]
[project @ 2001-08-31 13:51:45 by sewardj]
Pass -w to gcc for .hc compilation on sparc-solaris so as to suppress
warnings about call-clobbered regs being used for global vars.

22 years ago[project @ 2001-08-31 12:39:06 by rje]
rje [Fri, 31 Aug 2001 12:39:06 +0000 (12:39 +0000)]
[project @ 2001-08-31 12:39:06 by rje]
Reapplied my "FCode as a monad" patch, now that 5.02 has forked into
a separate branch.

I'm fairly sure that this doesn't change the behaviour of anything.

22 years ago[project @ 2001-08-31 11:44:12 by sewardj]
sewardj [Fri, 31 Aug 2001 11:44:12 +0000 (11:44 +0000)]
[project @ 2001-08-31 11:44:12 by sewardj]
.bss section fixes for ELF.

MERGE TO STABLE BRANCH (and test better!)

22 years ago[project @ 2001-08-31 11:42:44 by sewardj]
sewardj [Fri, 31 Aug 2001 11:42:44 +0000 (11:42 +0000)]
[project @ 2001-08-31 11:42:44 by sewardj]
Properly handle the linker debugging (-D4096) before.

MERGE TO STABLE BRANCH

22 years ago[project @ 2001-08-30 16:21:45 by rrt]
rrt [Thu, 30 Aug 2001 16:21:45 +0000 (16:21 +0000)]
[project @ 2001-08-30 16:21:45 by rrt]
Remove a spurious space. Oh, yes.

22 years ago[project @ 2001-08-30 10:35:10 by sewardj]
sewardj [Thu, 30 Aug 2001 10:35:11 +0000 (10:35 +0000)]
[project @ 2001-08-30 10:35:10 by sewardj]
Advance HEAD version to 5.03.

22 years ago[project @ 2001-08-30 10:22:52 by simonmar]
simonmar [Thu, 30 Aug 2001 10:22:52 +0000 (10:22 +0000)]
[project @ 2001-08-30 10:22:52 by simonmar]
Don't automatically enable compaction when generations == 1.

22 years ago[project @ 2001-08-30 10:21:40 by simonmar]
simonmar [Thu, 30 Aug 2001 10:21:40 +0000 (10:21 +0000)]
[project @ 2001-08-30 10:21:40 by simonmar]
Automatically disable compaction when there's only one generation
(-G1) and print a warning to that effect.

22 years ago[project @ 2001-08-30 09:51:15 by sewardj]
sewardj [Thu, 30 Aug 2001 09:51:16 +0000 (09:51 +0000)]
[project @ 2001-08-30 09:51:15 by sewardj]
Back out recent changes to the code generator as too destabilising.
Revert files as follows:

revert to 1.35   CgBindery.lhs
revert to 1.26   CgMonad.lhs
revert to 1.15   CgStackery.lhs
revert to 1.10   CgUsages.lhs

22 years ago[project @ 2001-08-29 19:29:04 by sof]
sof [Wed, 29 Aug 2001 19:29:04 +0000 (19:29 +0000)]
[project @ 2001-08-29 19:29:04 by sof]
make it compile.

22 years ago[project @ 2001-08-29 18:12:19 by sof]
sof [Wed, 29 Aug 2001 18:12:19 +0000 (18:12 +0000)]
[project @ 2001-08-29 18:12:19 by sof]
emptyPLS: warning removal

22 years ago[project @ 2001-08-29 17:24:25 by qrczak]
qrczak [Wed, 29 Aug 2001 17:24:25 +0000 (17:24 +0000)]
[project @ 2001-08-29 17:24:25 by qrczak]
Remove annoying warnings about using a deprecated extension
when compiling via gcc-3.0.

#if __GNUC__ >= 3
/* Assume that a flexible array member at the end of a struct
 * can be defined thus: T arr[]; */
#define FLEXIBLE_ARRAY
#else
/* Assume that it must be defined thus: T arr[0]; */
#define FLEXIBLE_ARRAY 0
#endif

A test program (hsking) compiled fine with gcc-3.0!

22 years ago[project @ 2001-08-29 16:02:30 by rje]
rje [Wed, 29 Aug 2001 16:02:30 +0000 (16:02 +0000)]
[project @ 2001-08-29 16:02:30 by rje]
Another Haskell equivalent of CTags.

Written because fptags and hstags don't seem to be maintained any more and
its seemed to be less effort to write a new version, than to figure out
how those one's worked.

22 years ago[project @ 2001-08-29 15:12:21 by sewardj]
sewardj [Wed, 29 Aug 2001 15:12:21 +0000 (15:12 +0000)]
[project @ 2001-08-29 15:12:21 by sewardj]
Make the PEi386 linker able to handle symbols in .bss sections
(almost) correctly:

* "Anonymous" bss sections (where something like
     static int a[10]
  lives) are given a calloc'd block of memory to live in.

* Publically visible bss-resident symbols, such as
    int a[10]
  are each given their own calloc'd block.  The normal
  way of things is for identically-named symbols in different
  modules to be commoned up and allocated the largest stated
  size of any of the symbols.  We don't do that -- if two different
  .o files each declared  int a[10],  you'll get two independent
  lumps of memory.  Hence "almost" above.

These calloc'd lumps (pseudo-bss spaces) are not added to the list
of sections extracted for the benefit of the closure-vs-itbl pointer
checks done by the garbage collector.  I don't think that matters.

These fixes need to be propagated to other formats too (viz, ELF).

This fixes the problem reported by ??? in which, on Windows,
   writeFile "foo" "bar" in GHCi gives a segfault.

This bug was so horrible to track down and fix that I have instituted
range checking in the relocation processing machinery.  The runtime
linker checks all locations it is patching to ensure they are within
a known segment before writing to them.  Hopefully this will pick up
any future problems.  The performance impact of this, assessed by
the time to start up GHCi, is unmeasureably small.

22 years ago[project @ 2001-08-29 15:02:02 by sewardj]
sewardj [Wed, 29 Aug 2001 15:02:02 +0000 (15:02 +0000)]
[project @ 2001-08-29 15:02:02 by sewardj]
Duh.  Remember to actually zero out the space in stgCallocBytes.  Duh.

22 years ago[project @ 2001-08-29 14:55:58 by sewardj]
sewardj [Wed, 29 Aug 2001 14:55:58 +0000 (14:55 +0000)]
[project @ 2001-08-29 14:55:58 by sewardj]
Add stgCallocBytes().

22 years ago[project @ 2001-08-29 14:32:49 by simonmar]
simonmar [Wed, 29 Aug 2001 14:32:49 +0000 (14:32 +0000)]
[project @ 2001-08-29 14:32:49 by simonmar]
Fix *two* bugs in formatRealFloat:

The first one is in the Haskell 98 errata, namely that negative
exponents cause an infinite loop in the FFFixed case when no precision
is specified.  eg. `Numeric.showFFloat Nothing 0.02 ""'  I've modified
the code in the errata to properly handle the e == 0 case and to be
slightly more efficient when e > 0.

The second bug is this:

   Prelude> Numeric.showFFloat (Just 0) 0.02 ""
   "0."

22 years ago[project @ 2001-08-29 14:20:14 by rje]
rje [Wed, 29 Aug 2001 14:20:14 +0000 (14:20 +0000)]
[project @ 2001-08-29 14:20:14 by rje]
FCode/Code is now a monad, and thus now also a constructed type, rather than a
type synonym.

This requires quite a lot of changes in quite a lot of files, but none of these changes should have changed the behaviour of anything.

Being a Monad allows code that used FCode to be IMHO rather more readable
as it can use do notation, and other common Monad idioms.

In addition, state has been abstracted away with getter and setter
functions, so that functions mess with the innards of FCode as little as
possible - making it easier to change FCode in future.

22 years ago[project @ 2001-08-29 11:20:40 by simonmar]
simonmar [Wed, 29 Aug 2001 11:20:40 +0000 (11:20 +0000)]
[project @ 2001-08-29 11:20:40 by simonmar]
- use SET_HDR rather than initialising header.info directly (fixes
  potential bugs with profiling).

- add some masking to the Int32/Word32 cases to match the Int8-16 and
  Word8-16 cases (potential 64-bit bugs).

22 years ago[project @ 2001-08-29 10:49:28 by simonmar]
simonmar [Wed, 29 Aug 2001 10:49:28 +0000 (10:49 +0000)]
[project @ 2001-08-29 10:49:28 by simonmar]
Add genRange method to class RandomGen, as per the revised Haskell 98
library report.

22 years ago[project @ 2001-08-29 10:19:31 by simonmar]
simonmar [Wed, 29 Aug 2001 10:19:31 +0000 (10:19 +0000)]
[project @ 2001-08-29 10:19:31 by simonmar]
Make the Permissions type non-abstract as per the revised Haskell 98 report.

22 years ago[project @ 2001-08-29 10:12:34 by simonmar]
simonmar [Wed, 29 Aug 2001 10:12:34 +0000 (10:12 +0000)]
[project @ 2001-08-29 10:12:34 by simonmar]
update maximumBy and minimumBy in line with the revised Haskell 98 report

22 years ago[project @ 2001-08-29 09:34:05 by simonmar]
simonmar [Wed, 29 Aug 2001 09:34:05 +0000 (09:34 +0000)]
[project @ 2001-08-29 09:34:05 by simonmar]
Changes to the Ix class from the revised Haskell 98 report:

  - Ord is no longer a superclass of Ix.

  - rangeSize is now a class member, as there are cases when
    it is useful to be able to override it.  As a result, GHC's
    performance-improving "unsafeRangeSize" function also has to be
    a class method just in case the programmer has overriden
    rangeSize.  Of course, unsafeRangeSize isn't visible when just
    importing Ix.

  - Added unsafeRangeSize bindings to all our standard Ix instances.

  - Improved the Ix instances for Int{8,16,32,64} and
    Word{8,16,32,64} by defining unsafeIndex instead of index, and
    providing a definition of unsafeRangeSize.

I hope I haven't mucked anything up :) The array tests all pass
successfully, except for arr016 which depended on Ord being a
superclass of Ix.  I'll commit changes to this test shortly.

22 years ago[project @ 2001-08-28 19:32:54 by sof]
sof [Tue, 28 Aug 2001 19:32:54 +0000 (19:32 +0000)]
[project @ 2001-08-28 19:32:54 by sof]
bring PprType (and its Outputable Type instance) into scope

22 years ago[project @ 2001-08-28 15:36:52 by simonmar]
simonmar [Tue, 28 Aug 2001 15:36:52 +0000 (15:36 +0000)]
[project @ 2001-08-28 15:36:52 by simonmar]
Change the definition of recip in the instance of Fractional for
Ratio, to:

recip (x:%y) =  y % x

as per the revised Haskell 98 report.

22 years ago[project @ 2001-08-28 15:12:37 by simonmar]
simonmar [Tue, 28 Aug 2001 15:12:37 +0000 (15:12 +0000)]
[project @ 2001-08-28 15:12:37 by simonmar]
Bring scanr1, scanl, and scanl1 into line with the revised H98 report.

22 years ago[project @ 2001-08-28 15:11:41 by simonmar]
simonmar [Tue, 28 Aug 2001 15:11:41 +0000 (15:11 +0000)]
[project @ 2001-08-28 15:11:41 by simonmar]
Add instances of Eq & Ord up to size 15 (Bounded, Read & Show will
have to wait)

22 years ago[project @ 2001-08-28 15:07:58 by simonmar]
simonmar [Tue, 28 Aug 2001 15:07:58 +0000 (15:07 +0000)]
[project @ 2001-08-28 15:07:58 by simonmar]
Correct the USE_REPORT_PRELUDE definition of (!!).

22 years ago[project @ 2001-08-28 10:06:29 by simonpj]
simonpj [Tue, 28 Aug 2001 10:06:30 +0000 (10:06 +0000)]
[project @ 2001-08-28 10:06:29 by simonpj]
----------------------------------------
Make isFFIArgumentTy understand newtypes
----------------------------------------

This fixes the bug Manuel reported:

newtype T = T (Ptr T)
foreign import ccall foo :: T -> IO (Ptr T)

  test.hs:6:
      Unacceptable argument type in foreign declaration: T

On the way, I moved isFFIArgumentTy and friends out of TysWiredIn,
where they didn't really belong, into TcType.  That in turn force
me to move isStrictType, and isPrimitiveType.

22 years ago[project @ 2001-08-28 10:03:23 by simonpj]
simonpj [Tue, 28 Aug 2001 10:03:24 +0000 (10:03 +0000)]
[project @ 2001-08-28 10:03:23 by simonpj]
Add pprEquation

22 years ago[project @ 2001-08-28 09:55:35 by simonmar]
simonmar [Tue, 28 Aug 2001 09:55:35 +0000 (09:55 +0000)]
[project @ 2001-08-28 09:55:35 by simonmar]
Fix (read "Infinity") and (read "NaN") for RealFloat types.

22 years ago[project @ 2001-08-28 08:34:29 by apt]
apt [Tue, 28 Aug 2001 08:34:29 +0000 (08:34 +0000)]
[project @ 2001-08-28 08:34:29 by apt]
fix problem with -fno-code

22 years ago[project @ 2001-08-27 15:16:30 by apt]
apt [Mon, 27 Aug 2001 15:16:30 +0000 (15:16 +0000)]
[project @ 2001-08-27 15:16:30 by apt]
shut up shortMeOut traces

22 years ago[project @ 2001-08-27 14:29:16 by apt]
apt [Mon, 27 Aug 2001 14:29:16 +0000 (14:29 +0000)]
[project @ 2001-08-27 14:29:16 by apt]
use qualified names to indicate external status of values

22 years ago[project @ 2001-08-27 14:27:23 by apt]
apt [Mon, 27 Aug 2001 14:27:23 +0000 (14:27 +0000)]
[project @ 2001-08-27 14:27:23 by apt]
document 31-bit core output option settings