ghc-hetmet.git
22 years ago[project @ 2001-08-04 06:19:54 by ken]
ken [Sat, 4 Aug 2001 06:19:55 +0000 (06:19 +0000)]
[project @ 2001-08-04 06:19:54 by ken]
NB: This commit renames some files.  In each of your build directories,
    you will need to:

rm -f ghc/compiler/prelude/primops.txt
rm -f ghc/compiler/prelude/primops.i
rm -f ghc/lib/std/PrelGHC.hi-boot
lndir ../fptools # or wherever your CVS working directory is

The change:
Run PrelGHC.hi-boot through the preprocesor, as we already do primops.txt.

This commit introduces a new prefix, ".pp", which means "run through
preprocesor".  In a previous commit, I changed ghc/compiler/Makefile
to preprocess primops.txt into primops.i.  That is gone now.  We now
preprocess primops.txt.pp (a file in the CVS repository) into primops.txt
(a platform-dependent file, created at build time).  We also preprocess
PrelGHC.hi-boot.pp (a file in the CVS repository) into PrelGHC.hi-boot
(a platform-dependent file, created at build time).

The reason for using the preprocessor is because fewer primops are defined
if SUPPORT_LONG_LONGS is undefined.  SUPPORT_LONG_LONGS is undefined on
64-bit architectures such as the Alpha.

22 years ago[project @ 2001-08-04 06:11:24 by ken]
ken [Sat, 4 Aug 2001 06:11:24 +0000 (06:11 +0000)]
[project @ 2001-08-04 06:11:24 by ken]
Changed

    # Add _hsc.c files to the cbits library
    SRCS += $(wildcard ../*_hsc.c)

(which didn't work because SRCS has already been pattern-matched and
substituted into other make variables to death by then) to

    # Add _hsc.c files to the cbits library
    C_SRCS += $(wildcard ../*_hsc.c)

22 years ago[project @ 2001-08-04 06:10:04 by ken]
ken [Sat, 4 Aug 2001 06:10:04 +0000 (06:10 +0000)]
[project @ 2001-08-04 06:10:04 by ken]
Fixed assumption that int and HsInt are the same.

22 years ago[project @ 2001-08-04 06:09:24 by ken]
ken [Sat, 4 Aug 2001 06:09:24 +0000 (06:09 +0000)]
[project @ 2001-08-04 06:09:24 by ken]
Change the generation of package.conf and package.conf.inplace, so that
-lbfd and -liberty are included when necessary.

22 years ago[project @ 2001-08-04 06:07:22 by ken]
ken [Sat, 4 Aug 2001 06:07:22 +0000 (06:07 +0000)]
[project @ 2001-08-04 06:07:22 by ken]
its => it's (or as the saying goes, wibble)

22 years ago[project @ 2001-08-03 23:38:50 by ken]
ken [Fri, 3 Aug 2001 23:38:50 +0000 (23:38 +0000)]
[project @ 2001-08-03 23:38:50 by ken]
Fixed: ExitException doesn't exist in __GLASGOW_HASKELL__ < 501,
so references to ExitException should be preprocessed out.

22 years ago[project @ 2001-08-03 20:40:43 by sof]
sof [Fri, 3 Aug 2001 20:40:43 +0000 (20:40 +0000)]
[project @ 2001-08-03 20:40:43 by sof]
- have the toplevel exception handler propagate ExitExceptions, don't flag
  them as panics. i.e., when the dynamic exception handler catches a
  PhaseFailed{}, it throws an ExitException. The outer/topmost handler
  catches this (on a Win32 box, but not my other (Linux) box for some
  reason...), and maps it to a panic, which is not what you want.
- introduced the old 'Compilation had errors' message in case of a
  PhaseFailed{}; feel free to nuke that one (again).

22 years ago[project @ 2001-08-03 17:03:48 by sof]
sof [Fri, 3 Aug 2001 17:03:48 +0000 (17:03 +0000)]
[project @ 2001-08-03 17:03:48 by sof]
Keep ghci.c out of C_SRCS on non-mingw plats

22 years ago[project @ 2001-08-03 16:30:13 by sof]
sof [Fri, 3 Aug 2001 16:30:13 +0000 (16:30 +0000)]
[project @ 2001-08-03 16:30:13 by sof]
Full complement of sized Int/Word getter routines

22 years ago[project @ 2001-08-03 15:11:10 by sewardj]
sewardj [Fri, 3 Aug 2001 15:11:10 +0000 (15:11 +0000)]
[project @ 2001-08-03 15:11:10 by sewardj]
Fix enough bugs/incompletenesses so that foreign import (static) works
fairly well on x86.

Still ToDo:
* f-i dynamic
* save/restore GC/thread context around calls
* stdcall support
* pass/return of 64-bit integral quantities on x86
* sparc implementation

22 years ago[project @ 2001-08-03 15:05:52 by sewardj]
sewardj [Fri, 3 Aug 2001 15:05:52 +0000 (15:05 +0000)]
[project @ 2001-08-03 15:05:52 by sewardj]
wibble: add cast to keep gcc happy.

22 years ago[project @ 2001-08-03 07:44:47 by sof]
sof [Fri, 3 Aug 2001 07:44:48 +0000 (07:44 +0000)]
[project @ 2001-08-03 07:44:47 by sof]
Make dependency generation work a little bit better
(stage1 goes through OK; yet to do a stage2, but
thought I'd commit before I hit the sack).

22 years ago[project @ 2001-08-03 00:08:07 by sof]
sof [Fri, 3 Aug 2001 00:08:07 +0000 (00:08 +0000)]
[project @ 2001-08-03 00:08:07 by sof]
Only define i_CCALL iff bci_CCALL is defined in WithHc's ByteCodes.h

22 years ago[project @ 2001-08-02 17:15:16 by sewardj]
sewardj [Thu, 2 Aug 2001 17:15:17 +0000 (17:15 +0000)]
[project @ 2001-08-02 17:15:16 by sewardj]
Haskell-side support for FFI (foreign import only).

Since doing the FFI necessarily involves gruesome
architecture-specific knowledge about calling conventions, I have
chosen to put this knowledge in Haskell-land, in ByteCodeFFI.

The general idea is: to do a ccall, the interpreter accumulates the
args R to L on the stack, as is the normal case for tail-calls.
However, it then calls a piece of machine code created by ByteCodeFFI
and which is specific to this call site.  This glue code copies args
off the Haskell stack, calls the target function, and places the
result back into a dummy placeholder created on the Haskell stack
prior to the call.  The interpreter then SLIDEs and RETURNs in the
normal way.

The magic glue code copies args off the Haskell stack and pushes them
directly on the C stack (x86) and/or into regs (sparc et al).  Because
the code is made up specifically for this call site, it can do all
that non-interpretively.  The address (of the C fn to call) is
presented as just another tagged Addr# on the Haskell stack.  This
makes f-i-dynamic trivial since the first arg is the said Addr#.

Presently ByteCodeFFI only knows how to generate x86 code sequences.

22 years ago[project @ 2001-08-02 17:01:33 by sewardj]
sewardj [Thu, 2 Aug 2001 17:01:33 +0000 (17:01 +0000)]
[project @ 2001-08-02 17:01:33 by sewardj]
C-side support for FFI in GHCi (foreign import only).

22 years ago[project @ 2001-08-02 16:35:10 by simonmar]
simonmar [Thu, 2 Aug 2001 16:35:10 +0000 (16:35 +0000)]
[project @ 2001-08-02 16:35:10 by simonmar]
Simplify the dependency analyser to use the Finder instead of doing
its own directory searching.

22 years ago[project @ 2001-08-02 16:30:41 by simonmar]
simonmar [Thu, 2 Aug 2001 16:31:13 +0000 (16:31 +0000)]
[project @ 2001-08-02 16:30:41 by simonmar]
Turn the strictness analyser back on again.

22 years ago[project @ 2001-08-02 16:05:06 by simonmar]
simonmar [Thu, 2 Aug 2001 16:05:06 +0000 (16:05 +0000)]
[project @ 2001-08-02 16:05:06 by simonmar]
Fix something that looks wrong in an attempt to get HEAD back on the
rails again, whilst trying to get the award for the highest
size-of-commit-message-to-number-of-lines-actually-changed ratio.

The problem is this: a constructor defined as

data T = A !Int

will cause a DataCon wrapper to be generated like this:

A = \x -> case x of x' { DEFAULT -> $wA x' }

but the strictness on $wA says that it is strict in its first field.
This is where the story gets a little hazy, but it seems that the
compiler (5.00.2) happily removes the extra case thinking that x is
going to get evaluated anyway, leaving us with

A = \x -> $wA x

and the argument to A ends up not being evaluated at all.  Certain
other parts of the compiler make use of the evaluatedness of fields in
order to remove unnecessary cases, with the end result that we end up
trying to dataToTag# an unevaluated thing, and certain derived Eq
instances can give wrong results.  Phew.

Now, here's the bit I *don't* understand: I can only see the bug with
5.00.2, and only when the data type has more than one constructor:

data T = A !Int  |  B

nevertheless, the HEAD compiler when bootstrapped displays symptoms of
a broken Eq instance, so I'm trying this fix to see if it helps.

The Attempted Fix: give the DataConId a fully-lazy strictness
signature.

22 years ago[project @ 2001-08-02 15:33:35 by ken]
ken [Thu, 2 Aug 2001 15:33:35 +0000 (15:33 +0000)]
[project @ 2001-08-02 15:33:35 by ken]
Some 64-bit fixes for the new GC code.

22 years ago[project @ 2001-08-02 08:29:42 by simonmar]
simonmar [Thu, 2 Aug 2001 08:29:42 +0000 (08:29 +0000)]
[project @ 2001-08-02 08:29:42 by simonmar]
oops, only import Exception.block when compiling GHCi (and we know
we're bootstrapping)

22 years ago[project @ 2001-08-02 05:15:33 by qrczak]
qrczak [Thu, 2 Aug 2001 05:15:33 +0000 (05:15 +0000)]
[project @ 2001-08-02 05:15:33 by qrczak]
Give ghc yet more memory.

22 years ago[project @ 2001-08-02 01:01:46 by sof]
sof [Thu, 2 Aug 2001 01:01:46 +0000 (01:01 +0000)]
[project @ 2001-08-02 01:01:46 by sof]
Example invocation of 'windres' was a bit off

22 years ago[project @ 2001-08-01 21:55:04 by sof]
sof [Wed, 1 Aug 2001 21:55:04 +0000 (21:55 +0000)]
[project @ 2001-08-01 21:55:04 by sof]
Support LFNs

22 years ago[project @ 2001-08-01 20:37:00 by qrczak]
qrczak [Wed, 1 Aug 2001 20:37:00 +0000 (20:37 +0000)]
[project @ 2001-08-01 20:37:00 by qrczak]
Give ghc more heap so it can bootstrap itself until the strictness
analyser works again.

22 years ago[project @ 2001-08-01 12:07:50 by simonmar]
simonmar [Wed, 1 Aug 2001 12:07:50 +0000 (12:07 +0000)]
[project @ 2001-08-01 12:07:50 by simonmar]
Signification cleanup & rewrite of CmLink.

Fixes at least one bug: the PersistentLinkerState could sometimes get
out of step with the RTS's idea of which modules were loaded, leading
to an unloadObj failure when we try to unload the same module twice.
This could happen if a ^C exception is received in the middle of a
:load.

Fixed by keeping the part of the linker's state that must match up
with the RTS's internal state entirely private to CmLink, stored in a
global variable.  The operations in CmLink which manipulate this state
are now wrapped by Exception.block, and so are safe from ^C
exceptions.

22 years ago[project @ 2001-08-01 11:49:27 by simonmar]
simonmar [Wed, 1 Aug 2001 11:49:27 +0000 (11:49 +0000)]
[project @ 2001-08-01 11:49:27 by simonmar]
use :set rather than :s

22 years ago[project @ 2001-08-01 08:20:33 by simonmar]
simonmar [Wed, 1 Aug 2001 08:20:33 +0000 (08:20 +0000)]
[project @ 2001-08-01 08:20:33 by simonmar]
*now* UF_CCS isn't used anywhere.

(and it was wrong, too, which is why I wanted to get rid of it)

22 years ago[project @ 2001-08-01 06:56:20 by qrczak]
qrczak [Wed, 1 Aug 2001 06:56:20 +0000 (06:56 +0000)]
[project @ 2001-08-01 06:56:20 by qrczak]
Temporarily add -H80M to options for some modules, until the strictness
analyser is working again.

22 years ago[project @ 2001-07-31 18:30:22 by qrczak]
qrczak [Tue, 31 Jul 2001 18:30:22 +0000 (18:30 +0000)]
[project @ 2001-07-31 18:30:22 by qrczak]
UF_CCS was used in compiler/main/Constants.lhs

22 years ago[project @ 2001-07-31 16:44:44 by simonmar]
simonmar [Tue, 31 Jul 2001 16:44:44 +0000 (16:44 +0000)]
[project @ 2001-07-31 16:44:44 by simonmar]
Remove the out-of-date "FAQ" about GHCi not having the :add command
(it does now).

22 years ago[project @ 2001-07-31 14:31:28 by simonmar]
simonmar [Tue, 31 Jul 2001 14:31:28 +0000 (14:31 +0000)]
[project @ 2001-07-31 14:31:28 by simonmar]
GHC_INTERPRETER_DIR is unused

22 years ago[project @ 2001-07-31 13:44:37 by simonmar]
simonmar [Tue, 31 Jul 2001 13:44:37 +0000 (13:44 +0000)]
[project @ 2001-07-31 13:44:37 by simonmar]
UF_CCS is unused

22 years ago[project @ 2001-07-31 11:06:00 by simonmar]
simonmar [Tue, 31 Jul 2001 11:06:00 +0000 (11:06 +0000)]
[project @ 2001-07-31 11:06:00 by simonmar]
make -keep-hc-files and -keep-s-files work with --make

22 years ago[project @ 2001-07-31 10:58:34 by rrt]
rrt [Tue, 31 Jul 2001 10:58:34 +0000 (10:58 +0000)]
[project @ 2001-07-31 10:58:34 by rrt]
Add the --with-gcc story. Tidy up some typos.

22 years ago[project @ 2001-07-31 10:48:02 by simonmar]
simonmar [Tue, 31 Jul 2001 10:48:02 +0000 (10:48 +0000)]
[project @ 2001-07-31 10:48:02 by simonmar]
Update for changes in Haskell 98: take, drop & splitAt now don't fail
on negative arguments.

22 years ago[project @ 2001-07-31 10:06:25 by sewardj]
sewardj [Tue, 31 Jul 2001 10:06:25 +0000 (10:06 +0000)]
[project @ 2001-07-31 10:06:25 by sewardj]
Disable all strictness analysis in the HEAD compiler until such time
as we can figure out why the new analyser is not working correctly.
I realise this is a drastic measure, but all previous attempts to
either fix or work around the problem have failed.

If you are doing work which requires maxed-out performance, you may
want to revert the effects of this commit in your source tree.  The
compiler only generates wrong code under pretty obscure circumstances
(when compiling itself).  All other programs appear to work correctly
with the new analyser.

We hope this situation will not last for long.

22 years ago[project @ 2001-07-30 13:06:18 by simonmar]
simonmar [Mon, 30 Jul 2001 13:06:18 +0000 (13:06 +0000)]
[project @ 2001-07-30 13:06:18 by simonmar]
add definition of unmark()

22 years ago[project @ 2001-07-30 12:57:01 by simonmar]
simonmar [Mon, 30 Jul 2001 12:57:01 +0000 (12:57 +0000)]
[project @ 2001-07-30 12:57:01 by simonmar]
Small perf. improvement: use the next bit in the bitmap to indicate
whether the current object needs to be pushed into the next block
during compaction.  This saves having to do the double traversal of
the threaded info pointer list during the second pass in most cases.

22 years ago[project @ 2001-07-30 12:54:12 by simonmar]
simonmar [Mon, 30 Jul 2001 12:54:12 +0000 (12:54 +0000)]
[project @ 2001-07-30 12:54:12 by simonmar]
- Bugfix: mark the weak pointer list before GC, instead of the
  (strange) old mechanism which involved "cleaning it up" after GC.

- size the old generation properly when doing compacting GC.

22 years ago[project @ 2001-07-30 10:40:36 by rrt]
rrt [Mon, 30 Jul 2001 10:40:36 +0000 (10:40 +0000)]
[project @ 2001-07-30 10:40:36 by rrt]
Add Sigbjorn's wrapper for ghci on Windows. ghci.exe will work from cmd.exe,
bash, the Explorer &c. &c., i.e. it's a one-size fits all solution. Thanks,
Sigbjorn!

22 years ago[project @ 2001-07-30 09:47:13 by simonmar]
simonmar [Mon, 30 Jul 2001 09:47:13 +0000 (09:47 +0000)]
[project @ 2001-07-30 09:47:13 by simonmar]
tiny layout wibble

22 years ago[project @ 2001-07-30 09:30:07 by simonmar]
simonmar [Mon, 30 Jul 2001 09:30:07 +0000 (09:30 +0000)]
[project @ 2001-07-30 09:30:07 by simonmar]
clean up; move some code into more relevant parts of the file.

22 years ago[project @ 2001-07-26 16:22:50 by qrczak]
qrczak [Thu, 26 Jul 2001 16:22:50 +0000 (16:22 +0000)]
[project @ 2001-07-26 16:22:50 by qrczak]
Clean *_hsc.$(way_)o for other ways too.

22 years ago[project @ 2001-07-26 14:29:26 by simonmar]
simonmar [Thu, 26 Jul 2001 14:29:26 +0000 (14:29 +0000)]
[project @ 2001-07-26 14:29:26 by simonmar]
Fall back to doing a linear scan of the old generation when the mark
stack fills up.

The compacting collector should work for all programs now, but there's
still some work to do on the speed of the collector - don't expect
programs to go any faster :)

22 years ago[project @ 2001-07-26 10:06:22 by simonmar]
simonmar [Thu, 26 Jul 2001 10:06:22 +0000 (10:06 +0000)]
[project @ 2001-07-26 10:06:22 by simonmar]
Fix from Simon P.J. (committing over the phone :-)

Add missing case in lub:

lub Eval (Seq k Defer ds) = Lazy

previously lub of Eval and Defer would have defaulted to Eval, which
was overoptimistic.

22 years ago[project @ 2001-07-26 09:54:39 by simonmar]
simonmar [Thu, 26 Jul 2001 09:54:39 +0000 (09:54 +0000)]
[project @ 2001-07-26 09:54:39 by simonmar]
Make the panic case in evalAbsence into another "TELL SIMON" trace.

22 years ago[project @ 2001-07-26 03:26:28 by ken]
ken [Thu, 26 Jul 2001 03:26:28 +0000 (03:26 +0000)]
[project @ 2001-07-26 03:26:28 by ken]
The heap shall start at HEAP_BASE == 0x180000000L on alpha-osf3.

22 years ago[project @ 2001-07-26 03:24:01 by ken]
ken [Thu, 26 Jul 2001 03:24:01 +0000 (03:24 +0000)]
[project @ 2001-07-26 03:24:01 by ken]
In addition to handling SIGINT, also handle SIGFPE by ignoring it.
Apparently IEEE requires floating-point exceptions to be ignored by
default, but alpha-dec-osf3 doesn't seem to do so.

22 years ago[project @ 2001-07-26 03:20:52 by ken]
ken [Thu, 26 Jul 2001 03:20:52 +0000 (03:20 +0000)]
[project @ 2001-07-26 03:20:52 by ken]
Added to main():

   /*
    * Believe it or not, calling tzset() at startup seems to get rid of
    * a scheduler-related Heisenbug on alpha-dec-osf3.  The symptom of
    * the bug is that, when the load on the machine is high or when
    * there are many threads, the variable "Capability *cap" in the
    * function "schedule" in the file "Schedule.c" magically becomes
    * null before the line "t = cap->rCurrentTSO;".  Why, and why does
    * calling tzset() here seem to fix it?  Excellent questions!
    */
   tzset();

22 years ago[project @ 2001-07-26 03:13:37 by ken]
ken [Thu, 26 Jul 2001 03:13:37 +0000 (03:13 +0000)]
[project @ 2001-07-26 03:13:37 by ken]
Fixed code to not return an undefined value on platforms that are
neither OBJFORMAT_ELF nor OBJFORMAT_PEi386.

22 years ago[project @ 2001-07-26 03:08:38 by ken]
ken [Thu, 26 Jul 2001 03:08:39 +0000 (03:08 +0000)]
[project @ 2001-07-26 03:08:38 by ken]
Run prelude/primops.txt through the preprocessor, to weed out
primitives that don't (need to) exist on 64-bit architectures.

22 years ago[project @ 2001-07-25 15:55:30 by simonpj]
simonpj [Wed, 25 Jul 2001 15:55:30 +0000 (15:55 +0000)]
[project @ 2001-07-25 15:55:30 by simonpj]
-----------------------------------------
Fix a bug in the monomorphism restriction
------------------------------------------

Thanks for Koen for reporting this bug.

In tcSimplifyRestricted, I wrongly called tcSimpifyToDicts,
whereas actually we have to simplfy further than simply to
a dictionary.

The test for this is in typecheck/should_compile/tc132.hs

22 years ago[project @ 2001-07-25 13:29:07 by simonpj]
simonpj [Wed, 25 Jul 2001 13:29:07 +0000 (13:29 +0000)]
[project @ 2001-07-25 13:29:07 by simonpj]
---------------------------------
Fix a bug in the defn of "both"
---------------------------------

This bug made the bootstrapped GHC enter an absent argument.

The change is from

both Lazy (Seq k Now ds) = Seq Keep Now ds
to
both Lazy (Seq k l ds) = Seq Keep l ds

Simple, eh?  (Comments with the code.)

22 years ago[project @ 2001-07-25 12:18:26 by simonmar]
simonmar [Wed, 25 Jul 2001 12:18:26 +0000 (12:18 +0000)]
[project @ 2001-07-25 12:18:26 by simonmar]
- move the call to scavenge_mark_stack() inside the inner scavenge loop,
  so it gets called more often and there's less chance of the mark
  stack filling up.  None of the nofib tests cause the mark stack to
  fill up now.

- remove some experimental code from scavenge_mark_stack().

22 years ago[project @ 2001-07-25 11:55:57 by simonmar]
simonmar [Wed, 25 Jul 2001 11:55:57 +0000 (11:55 +0000)]
[project @ 2001-07-25 11:55:57 by simonmar]
Specialise thread_static() a little bit: improves performance for
threading the static object list.

22 years ago[project @ 2001-07-25 10:49:46 by simonpj]
simonpj [Wed, 25 Jul 2001 10:49:46 +0000 (10:49 +0000)]
[project @ 2001-07-25 10:49:46 by simonpj]
Do for evalStrictness the same as for evalAbsence

22 years ago[project @ 2001-07-25 10:10:25 by simonmar]
simonmar [Wed, 25 Jul 2001 10:10:25 +0000 (10:10 +0000)]
[project @ 2001-07-25 10:10:25 by simonmar]
- Move FptoolsHcOpts out of the hslibs section of this file (which was
  *exactly* the wrong place for it).

- Clarify the meaning of FptoolsHcOpts and GhcHcOpts.

NOTE: $(FptoolsHcOpts) gets added to every Haskell compilation for
Haskell *programs* (not libraries), including GHC itself.  By default,
it contains only -O.  To remove the -O, you need to override
FptoolsHcOpts in build.mk, not GhcHcOpts.

GhcHcOpts is still there, and contains options to be added when
compiling GHC only.

22 years ago[project @ 2001-07-25 09:19:41 by simonpj]
simonpj [Wed, 25 Jul 2001 09:19:41 +0000 (09:19 +0000)]
[project @ 2001-07-25 09:19:41 by simonpj]
---------------------------------
Another long-standing infelicity!
---------------------------------

CoreTidy was throwing away demand info on let-binders.
This meant that CorePrep would build a let (thunk) instead of
a case, even if the Id is sure to be demanded.

Easily fixed by making CoreTidy retain the demand info.

This demand-analysis stuff is having the excellent side effect
of flushing out performance bugs!

22 years ago[project @ 2001-07-25 09:14:21 by simonmar]
simonmar [Wed, 25 Jul 2001 09:14:21 +0000 (09:14 +0000)]
[project @ 2001-07-25 09:14:21 by simonmar]
- bugfix (was erroneously ignoring the return value from scavenge_one() and
  checking failed_to_evac instead, which was always false)

- printf format fix (shut gcc up).

22 years ago[project @ 2001-07-25 08:04:00 by simonpj]
simonpj [Wed, 25 Jul 2001 08:04:00 +0000 (08:04 +0000)]
[project @ 2001-07-25 08:04:00 by simonpj]
Change pretty-print of DmdType slightly

22 years ago[project @ 2001-07-25 07:43:53 by simonpj]
simonpj [Wed, 25 Jul 2001 07:43:53 +0000 (07:43 +0000)]
[project @ 2001-07-25 07:43:53 by simonpj]
---------------------------
Fix another bad DmdAnal bug
---------------------------

The `both` operator wasn't commutative, leading to most
strange results.  In particular, the fixpoint finder went into
an infinite fip/flop loop on Marcin's program.

22 years ago[project @ 2001-07-25 07:42:23 by simonpj]
simonpj [Wed, 25 Jul 2001 07:42:23 +0000 (07:42 +0000)]
[project @ 2001-07-25 07:42:23 by simonpj]
---------------------------------------
Fix a grevious dict-inlining infelicity
---------------------------------------

This commit fixes an infelicity that must have been there
for a long time.  The problem was that dictionary functions
(arising from instance declarations) were treated as GlobalIds,
and hence no taken account of when doing free variable and dependency
analysis.    As a result, the specialiser was messing up dependency
order, so the program was considerably more complex than it should
be by the time it got to the strictness analyser.

Net result:
PrelRead.$sreduce :: Integer -> Integer -> (Integer,Integer)
didn't get detected as strict.

Easily fixed, by making DictFunIds into LocalIds (albeit exported ones).

22 years ago[project @ 2001-07-24 18:04:01 by sof]
sof [Tue, 24 Jul 2001 18:04:01 +0000 (18:04 +0000)]
[project @ 2001-07-24 18:04:01 by sof]
Capture the dependency of PrelIO.hsc on PrelHandle_hsc.h (as was, 'make clean; make all' broke)

22 years ago[project @ 2001-07-24 16:47:40 by simonpj]
simonpj [Tue, 24 Jul 2001 16:47:40 +0000 (16:47 +0000)]
[project @ 2001-07-24 16:47:40 by simonpj]
Print a bit more info in an old strictness analyser assert fail

22 years ago[project @ 2001-07-24 16:46:51 by simonpj]
simonpj [Tue, 24 Jul 2001 16:46:51 +0000 (16:46 +0000)]
[project @ 2001-07-24 16:46:51 by simonpj]
Print a bit more info in the dmdFix loop

22 years ago[project @ 2001-07-24 16:42:11 by simonpj]
simonpj [Tue, 24 Jul 2001 16:42:11 +0000 (16:42 +0000)]
[project @ 2001-07-24 16:42:11 by simonpj]
A major demand-analyser fix, which made it say something was
absent when it wasn't at all.  Here's the comment from the
Case equation of dmdAnal.

-- Figure out whether the case binder is used, and use
-- that to set the keepity of the demand.  This is utterly essential.
-- Consider f x = case x of y { (a,b) -> k y a }
-- If we just take scrut_demand = U(L,A), then we won't pass x to the
-- worker, so the worker will rebuild
-- x = (a, absent-error)
-- and that'll crash.

22 years ago[project @ 2001-07-24 16:36:43 by simonmar]
simonmar [Tue, 24 Jul 2001 16:36:44 +0000 (16:36 +0000)]
[project @ 2001-07-24 16:36:43 by simonmar]
Bugfixes; take large objects into account in stats output.

22 years ago[project @ 2001-07-24 16:09:48 by simonpj]
simonpj [Tue, 24 Jul 2001 16:09:48 +0000 (16:09 +0000)]
[project @ 2001-07-24 16:09:48 by simonpj]
wibble

22 years ago[project @ 2001-07-24 16:04:21 by simonpj]
simonpj [Tue, 24 Jul 2001 16:04:21 +0000 (16:04 +0000)]
[project @ 2001-07-24 16:04:21 by simonpj]
Add errorCString

22 years ago[project @ 2001-07-24 15:57:27 by simonpj]
simonpj [Tue, 24 Jul 2001 15:57:27 +0000 (15:57 +0000)]
[project @ 2001-07-24 15:57:27 by simonpj]
Make absent-arg errors more descriptive

22 years ago[project @ 2001-07-24 15:13:01 by simonmar]
simonmar [Tue, 24 Jul 2001 15:13:01 +0000 (15:13 +0000)]
[project @ 2001-07-24 15:13:01 by simonmar]
More tweaks.  Getting usable now.

22 years ago[project @ 2001-07-24 14:29:13 by simonmar]
simonmar [Tue, 24 Jul 2001 14:29:13 +0000 (14:29 +0000)]
[project @ 2001-07-24 14:29:13 by simonmar]
Make compacting GC faster, stage 1.

A cunning trick from Simon P.J. to avoid needing to call the
potentially expensive LOOKS_LIKE_GHC_INFO() a lot.

22 years ago[project @ 2001-07-24 10:38:48 by simonmar]
simonmar [Tue, 24 Jul 2001 10:38:48 +0000 (10:38 +0000)]
[project @ 2001-07-24 10:38:48 by simonmar]
remove extra SRC_MKDEPENDC_OPTS, since we shouldn't be doing a
mkdependC in this directory at all.

22 years ago[project @ 2001-07-24 10:37:57 by simonmar]
simonmar [Tue, 24 Jul 2001 10:37:57 +0000 (10:37 +0000)]
[project @ 2001-07-24 10:37:57 by simonmar]
Remove whitespace from the end of lines.  The extra whitespace is
syntactically meaningful to make(!) and was causing us to do
a superfluous mkdependC in directories without any C files.

22 years ago[project @ 2001-07-24 10:31:07 by simonmar]
simonmar [Tue, 24 Jul 2001 10:31:07 +0000 (10:31 +0000)]
[project @ 2001-07-24 10:31:07 by simonmar]
libm is a dependency of the RTS now, so don't also depend on it for
package "std".

22 years ago[project @ 2001-07-24 10:28:51 by simonmar]
simonmar [Tue, 24 Jul 2001 10:28:51 +0000 (10:28 +0000)]
[project @ 2001-07-24 10:28:51 by simonmar]
back the last change out; a better way to get all the hc files you need is

SRC_HC_OPTS += -keep-hc-files

in your build.mk.

22 years ago[project @ 2001-07-24 09:55:16 by simonpj]
simonpj [Tue, 24 Jul 2001 09:55:16 +0000 (09:55 +0000)]
[project @ 2001-07-24 09:55:16 by simonpj]
Two fixes to the demand analyis.

1.  Don't look inside Coerces.  These wrap recursive newtypes,
and we might fail to find a fixpoint if we look inside them.

2.  Polymorphic 'seq' is represented by a (Seq _ _ []) demand,
so lub/both must be prepared to take a Seq with an empty list
of demands without complaint.

22 years ago[project @ 2001-07-24 09:53:27 by simonpj]
simonpj [Tue, 24 Jul 2001 09:53:27 +0000 (09:53 +0000)]
[project @ 2001-07-24 09:53:27 by simonpj]
Keep the printed stuff for Demand and DmdResult separate, else
we can get confused when parsing a strictness signature.  For
example, previously

LX

could have been parsed as L  -> X
or as LX -> T

Urk!  I've taken the simple path of making DmdResults print in
lower case.  Thus

Lx  means L  -> x
LX means LX -> t

22 years ago[project @ 2001-07-24 09:46:55 by simonmar]
simonmar [Tue, 24 Jul 2001 09:46:55 +0000 (09:46 +0000)]
[project @ 2001-07-24 09:46:55 by simonmar]
Add Ken Shan to the contributor's list for his heroic work on the
Alpha port of GHC.  Thanks Ken!

22 years ago[project @ 2001-07-24 09:08:47 by simonpj]
simonpj [Tue, 24 Jul 2001 09:08:47 +0000 (09:08 +0000)]
[project @ 2001-07-24 09:08:47 by simonpj]
Add missing cases to newDemand

22 years ago[project @ 2001-07-24 06:31:35 by ken]
ken [Tue, 24 Jul 2001 06:31:36 +0000 (06:31 +0000)]
[project @ 2001-07-24 06:31:35 by ken]
Innocent changes to resurrect/add 64-bit support.

22 years ago[project @ 2001-07-24 06:02:21 by ken]
ken [Tue, 24 Jul 2001 06:02:21 +0000 (06:02 +0000)]
[project @ 2001-07-24 06:02:21 by ken]
Fix typo in StgRun() for the Alpha

22 years ago[project @ 2001-07-24 06:01:21 by ken]
ken [Tue, 24 Jul 2001 06:01:21 +0000 (06:01 +0000)]
[project @ 2001-07-24 06:01:21 by ken]
#include <string.h> to get proper prototypes

22 years ago[project @ 2001-07-24 05:53:27 by ken]
ken [Tue, 24 Jul 2001 05:53:27 +0000 (05:53 +0000)]
[project @ 2001-07-24 05:53:27 by ken]
Removed debugging (tracing) code.

22 years ago[project @ 2001-07-24 05:49:32 by ken]
ken [Tue, 24 Jul 2001 05:49:32 +0000 (05:49 +0000)]
[project @ 2001-07-24 05:49:32 by ken]
Fixed punctuation typo.

22 years ago[project @ 2001-07-24 05:17:52 by ken]
ken [Tue, 24 Jul 2001 05:17:52 +0000 (05:17 +0000)]
[project @ 2001-07-24 05:17:52 by ken]
Added -I$(GHC_INCLUDE_DIR) to $(SRC_MKDEPENDC_OPTS), so that
mkdependC can find its include files properly.

22 years ago[project @ 2001-07-24 05:08:51 by ken]
ken [Tue, 24 Jul 2001 05:08:51 +0000 (05:08 +0000)]
[project @ 2001-07-24 05:08:51 by ken]
Made "nat" 64-bit ("unsigned long") rather than 32-bit ("unsigned int")
on 64-bit machines.  This fixes some problems caused by code elsewhere
assuming that sizeof(nat) == sizeof(void *).

22 years ago[project @ 2001-07-24 05:07:37 by ken]
ken [Tue, 24 Jul 2001 05:07:37 +0000 (05:07 +0000)]
[project @ 2001-07-24 05:07:37 by ken]
Added -lm to the extra_libraries list for the rts package.  This is
because ldexp() is used by StgPrimFloat.c and is in -lm on alpha-osf3.

22 years ago[project @ 2001-07-24 05:05:41 by ken]
ken [Tue, 24 Jul 2001 05:05:41 +0000 (05:05 +0000)]
[project @ 2001-07-24 05:05:41 by ken]
Added $(GhcHcOpts) to $(SRC_HC_OPTS), so that by setting
--keep-hc-files-too in $(GhcHcOpts) we get .hc files for the
Haskell code under this directory, ghc/driver.

22 years ago[project @ 2001-07-24 05:04:58 by ken]
ken [Tue, 24 Jul 2001 05:04:59 +0000 (05:04 +0000)]
[project @ 2001-07-24 05:04:58 by ken]
Removed 32-bit dependencies in the generation and handling of
liveness mask bitmaps.  We now support both 32-bit and 64-bit
machines with identical .hc files.  Support for >64-bit machines
would be easy to add.  Note that old .hc files are incompatible
with the changes made to ghc/include/InfoMacros.h!

22 years ago[project @ 2001-07-24 04:52:49 by ken]
ken [Tue, 24 Jul 2001 04:52:49 +0000 (04:52 +0000)]
[project @ 2001-07-24 04:52:49 by ken]
Made some code #ifdef GHCI, so that it will compile without GHCI enabled.

22 years ago[project @ 2001-07-24 04:47:06 by ken]
ken [Tue, 24 Jul 2001 04:47:06 +0000 (04:47 +0000)]
[project @ 2001-07-24 04:47:06 by ken]
Added missing hyphen in frnot of machdepCCOpts for mips and powerpc.

22 years ago[project @ 2001-07-24 04:46:37 by ken]
ken [Tue, 24 Jul 2001 04:46:37 +0000 (04:46 +0000)]
[project @ 2001-07-24 04:46:37 by ken]
Added -Xlinker -noprefix_recognition to Alpha-specific
machdepCCOpts.  We need this flag to disable the following
documented behavior of ld(1) on Digital UNIX:

   All routines that start with __init_ are treated, by default,
   as initialization routines. These are routines that are called
   without an argument when the file that contains them is loaded
   or when the program that contains them is started.

Unfortunately, this flag produces the annoying (but harmless) gcc
message

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

(See also mk/bootstrap.mk)

22 years ago[project @ 2001-07-24 04:45:59 by ken]
ken [Tue, 24 Jul 2001 04:45:59 +0000 (04:45 +0000)]
[project @ 2001-07-24 04:45:59 by ken]
Added -static, a flag for compiling on the Alpha that is already
listed under machdepCCOpts in DriverFlags.hs.  Without it, the
following assert in GC.c fails:

    /* make sure the info pointer is into text space */
    ASSERT(q && (LOOKS_LIKE_GHC_INFO(GET_INFO(q))
                 || IS_HUGS_CONSTR_INFO(GET_INFO(q))));

Added -Xlinker -noprefix_recognition, a flag for Alpha compilation
that I just added to machdepCCOpts in DriverFlags.hs.  We need
this flag to disable the following documented behavior of ld(1) on
Digital UNIX:

   All routines that start with __init_ are treated, by default,
   as initialization routines. These are routines that are called
   without an argument when the file that contains them is loaded
   or when the program that contains them is started.

Unfortunately, this flag produces the annoying (but harmless) gcc
message

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

(See also ghc/compiler/main/DriverFlags.hs)

22 years ago[project @ 2001-07-24 04:41:40 by ken]
ken [Tue, 24 Jul 2001 04:41:40 +0000 (04:41 +0000)]
[project @ 2001-07-24 04:41:40 by ken]
Added #include "SchedAPI.h" to fix compiler warning message.

22 years ago[project @ 2001-07-24 04:39:31 by ken]
ken [Tue, 24 Jul 2001 04:39:32 +0000 (04:39 +0000)]
[project @ 2001-07-24 04:39:31 by ken]
Make the Time module thread-safe by calling the reentrant functions
gmtime_r and localtime_r instead of gmtime and localtime wherever
they are available.

(This is necessary to make Time work at all on our Alpha machine --
perhaps GHC tickles the reentrancy of the C library or something?)

22 years ago[project @ 2001-07-24 04:35:36 by ken]
ken [Tue, 24 Jul 2001 04:35:36 +0000 (04:35 +0000)]
[project @ 2001-07-24 04:35:36 by ken]
Fixed: The type of sec and usec in struct timeval are always 32 bits,
but not always a CLong.  (On Alphas, CLong is 64 bits.)

22 years ago[project @ 2001-07-23 23:37:35 by andy]
andy [Mon, 23 Jul 2001 23:37:35 +0000 (23:37 +0000)]
[project @ 2001-07-23 23:37:35 by andy]
Adding the -Pa flag. This allows you to see all the cost centres

22 years ago[project @ 2001-07-23 23:29:47 by ken]
ken [Mon, 23 Jul 2001 23:29:47 +0000 (23:29 +0000)]
[project @ 2001-07-23 23:29:47 by ken]
Removed 32-bit assumptions.

22 years ago[project @ 2001-07-23 23:27:50 by ken]
ken [Mon, 23 Jul 2001 23:27:50 +0000 (23:27 +0000)]
[project @ 2001-07-23 23:27:50 by ken]
- Added recommended gcc warning flag: -Wcast-align

  - Fixed: "make distclean" would run in the gmp subdirectory multiple
    times, once for each way.  The second time, the Makefile in there
    is gone, causing an error.