Commit 43859689 authored by simonm's avatar simonm

[project @ 1998-12-02 13:17:09 by simonm]

Move 4.01 onto the main trunk.
parent 967cc47f

Too many changes to show.

To preserve performance only 199 of 199+ files are displayed.
......@@ -33,47 +33,24 @@
/* Define as the symbol which marks the end of the data section */
#undef DATA_SECTION_END_MARKER
/* Define as the decl which terminates the data section */
#undef DATA_SECTION_END_MARKER_DECL
/* Define if time.h or sys/time.h define the altzone variable */
#undef HAVE_ALTZONE
/* Define if you have /bin/sh */
#define HAVE_BIN_SH 0
/* Define if you have the GetModuleFileName function. */
#define HAVE_GETMODULEFILENAME 0
/* Define if C compiler supports long long types */
#undef HAVE_LONG_LONG
/* Define if fcntl.h defines O_BINARY */
#undef HAVE_O_BINARY
/* Define if compiler supports prototypes. */
#define HAVE_PROTOTYPES 0
/* Define if you have the WinExec function. */
#define HAVE_WINEXEC 0
/* Define if C Symbols have a leading underscore added by the compiler */
#undef LEADING_UNDERSCORE
/* Define as the symbol which marks the end of the text section */
#undef TEXT_SECTION_END_MARKER
/* Define to decl that terminates text section. */
#undef TEXT_SECTION_END_MARKER_DECL
/* Define to the type of the timezone variable (usually long or time_t) */
#undef TYPE_TIMEZONE
/* Define if signal handlers have type void (*)(int)
* (Otherwise, they're assumed to have type int (*)(void).)
*/
#define VOID_INT_SIGNALS 0
/* Leave that blank line there!! Autoheader needs it.
If you're adding to this file, keep in mind:
......
dnl $Id: aclocal.m4,v 1.34 1998/11/24 21:28:00 reid Exp $
dnl $Id: aclocal.m4,v 1.35 1998/12/02 13:17:10 simonm Exp $
dnl
dnl Extra autoconf macros for the Glasgow fptools
dnl
......@@ -470,7 +470,7 @@ for i in etext _etext __etext; do
fi
done
if test "$not_done" = 1; then
FPTOOLS_IN_SCOPE(etext asm("etext"),etext,fptools_cv_end_of_text)
FPTOOLS_IN_SCOPE(etext asm("etext"),etext,fptools_cv_end_of_text);
if test "$fptools_cv_end_of_text" = yes; then
AC_DEFINE(TEXT_SECTION_END_MARKER_DECL, etext asm("etext"))
AC_DEFINE(TEXT_SECTION_END_MARKER, etext)
......@@ -496,7 +496,7 @@ for i in end _end __end; do
fi
done
if test "$not_done" = 1; then
FPTOOLS_IN_SCOPE(end asm("end"),end,fptools_cv_end_of_data)
FPTOOLS_IN_SCOPE(end asm("end"),end,fptools_cv_end_of_data);
if test "$fptools_cv_end_of_data" = yes; then
AC_DEFINE(DATA_SECTION_END_MARKER_DECL, end asm("end"))
AC_DEFINE(DATA_SECTION_END_MARKER, end)
......
......@@ -436,7 +436,7 @@ dnl ** check for full ANSI header (.h) files
AC_HEADER_STDC
dnl ** check for specific header (.h) files that we are interested in
AC_CHECK_HEADERS(Files.h assert.h console.h ctype.h dirent.h errno.h fcntl.h float.h ftw.h grp.h ieee754.h malloc.h memory.h nlist.h pascal.h pwd.h sgtty.h siginfo.h signal.h stat.h stdlib.h stdarg.h string.h sys/fault.h sys/file.h sys/ioctl.h sys/mman.h sys/param.h sys/procfs.h sys/resource.h sys/signal.h sys/socket.h netinet/tcp.h sys/stat.h sys/syscall.h sys/time.h sys/timeb.h sys/timers.h sys/times.h sys/types.h sys/utsname.h sys/vadvise.h sys/wait.h termio.h termios.h time.h types.h unistd.h utime.h values.h vfork.h readline/readline.h bfd.h)
AC_CHECK_HEADERS(Files.h assert.h console.h ctype.h dirent.h errno.h fcntl.h float.h ftw.h grp.h ieee754.h malloc.h memory.h nlist.h pascal.h pwd.h sgtty.h siginfo.h signal.h stat.h stdlib.h stdarg.h string.h sys/fault.h sys/file.h sys/ioctl.h sys/limits.h sys/mman.h sys/param.h sys/procfs.h sys/resource.h sys/signal.h sys/socket.h netinet/tcp.h sys/stat.h sys/syscall.h sys/time.h sys/timeb.h sys/timers.h sys/times.h sys/types.h sys/utsname.h sys/vadvise.h sys/wait.h termio.h termios.h time.h types.h unistd.h utime.h values.h vfork.h readline/readline.h bfd.h)
dnl ** check for DOS include files
AC_CHECK_HEADERS(dos.h conio.h io.h std.h)
......
The Glasgow Haskell Compiler -- version 3.02
The Glasgow Haskell Compiler -- version 4.01
==============================================
We are pleased to announce a new release of the Glasgow Haskell
Compiler (GHC), version 3.02. The source distribution is freely
Compiler (GHC), version 4.01. The source distribution is freely
available via the World-Wide Web and through anon. FTP; details below.
Haskell is "the" standard lazy functional programming language; the
......@@ -14,15 +14,19 @@ related information is available from the Haskell home page at
+ What's new
=============
GHC 3.02 is a source-only release. Major news items:
GHC 4.01 is a small increment over 4.00. Many bugs have been fixed.
The following features are new:
* A new specialiser,
* A new unsafeCoerce# primitive.
* A NOINLINE pragma.
* Many bugs fixed, including several performance-related ones,
* Weak pointers,
* The foreign function interface is now complete.
GHC 3.02 produces the fastest code since 0.29, but there's still
plenty of tuning to do.
In addition, bootstrapping the compiler should now work out of the box.
The following things have not been fixed yet:
* The native code generator is still flaky, and is turned off by
default for the time being.
* The profiler is still flaky.
+ Mailing lists
================
......@@ -64,21 +68,22 @@ for tar, please)!
+ System requirements
======================
To compile up this source-only release, you need a machine with 16+MB
To compile up this source-only release, you need a machine with 32+MB
memory, GNU C (`gcc'), `perl' plus a version of GHC installed (version
2.10 at least). We have seen GHC work on these platforms:
2.10 at least). This release is known to work on the following platforms:
* i386-unknown-{linux,solaris2,freebsd,cygwin32}
* sparc-sun-{sunos4,solaris2}
Ports to the following platforms should be relatively easy, but
haven't been tested due to lack of time/hardware:
* alpha-dec-osf{2,3}
* hppa1.1-hp-hpux{9,10}
* sparc-sun-{sunos4,solaris2}
* mips-sgi-irix{5,6}
* i386-unknown-{linux,solaris2,freebsd,cygwin32}.
* {rs6000,powerpc}-ibm-aix
Similar platforms should work with minimal hacking effort. The installer's
guide included in distribution gives a complete run-down of what-ports-work;
an on-line version can be found at
http://www.dcs.gla.ac.uk/fp/software/ghc/3.02/installation_guide/installing_toc.html
The installer's guide included in distribution gives a complete
run-down of what-ports-work; an on-line version can be found at
EOF
http://www.dcs.gla.ac.uk/fp/software/ghc/4.01/installation_guide/installing_toc.html
#-----------------------------------------------------------------------------
# $Id: Makefile,v 1.7 1997/03/24 08:39:19 sof Exp $
# $Id: Makefile,v 1.8 1998/12/02 13:17:13 simonm Exp $
#
TOP=.
......@@ -21,9 +21,9 @@ include $(TOP)/mk/boilerplate.mk
# we descend into compiler/ and lib/
#
ifeq "$(GhcWithHscBuiltViaC)" "NO"
SUBDIRS = utils driver includes runtime docs compiler lib
SUBDIRS = utils driver includes rts docs compiler lib
else
SUBDIRS = utils driver includes runtime docs lib compiler
SUBDIRS = utils driver includes rts docs lib compiler
endif
# Easier to copy
......
The Glamorous Glasgow Haskell Compiler, version 3.02, patchlevel 0
The Glamorous Glasgow Haskell Compiler, version 4.01, patchlevel 0
This is version 3.02 of the Glorious Glasgow Haskell compilation
system (GHC). GHC 3.02 is a compiler for Haskell 1.4.
This is version 4.01 of the Glorious Glasgow Haskell compilation
system (GHC). GHC 4.01 is a compiler for Haskell 1.4.
Haskell is "the" standard lazy functional programming language.
Haskell 1.4 is the current version of the language, released in
April 1997. The language definition is on the Web at
http://www.haskell.org/report/index.html.
More information on GHC can be found on its web page
http://www.dcs.gla.ac.uk/fp/software/ghc
GHC documentation of interest:
* docs/installing.{dvi,info,html}: How to configure, build, and
* docs/installing.{dvi,html}: How to configure, build, and
install the system.
The document, as with many others, is in TeX-produced DVI format
(.dvi suffix), or GNU Info format (.info); the latter is close to
plain ASCII, if that's what you want.
(.dvi suffix), or HTML.
* ghc/docs/users_guide/user.{dvi,info,html}: How to use GHC; e.g., what
* ghc/docs/users_guide/user.{dvi,html}: How to use GHC; e.g., what
options are available, how to cope with common problems, how to use
the profiling facilities, etc.
* ghc/docs/libraries/libs.{dvi,html}: Several libraries that are
provided by both GHC and Hugs.
We welcome your comments and suggestions about this software! Please
do not suffer or grumble in silence. The "bug reports" section of the
User's Guide (docs/users_guide/user.{dvi,info,html}) says what we
would like to know when you report a problem.
User's Guide says what we would like to know when you report a
problem.
Current AQUA team (all @dcs.gla.ac.uk):
Current GHC team:
Simon Peyton Jones ( simonpj@microsoft.com) [our Fearless Leader]
Sigbjorn Finne (v-sfinne@microsoft.com) [hired hand]
Simon Marlow (t-simonm@microsoft.com) [hired hand]
Past contributors and/or continuing advisors (all @dcs.gla.ac.uk):
Sigbjorn Finne (sof) [hired hand]
Hans Wolfgang Loidl (hwloidl) [PhD student]
Simon Marlow (simonm) [hired hand]
Thomas Nordin (nordin) [@cse.ogi.edu; Green Card Hero]
Simon Peyton Jones (simonpj) [our Fearless Leader]
Hans Wolfgang Loidl (hwloidl) [PhD student]
Patrick Sansom (sansom) [hired hand, Bidirectional Analyses]
Phil Trinder (trinder) [hired hand, Parade]
Past contributors and/or continuing advisors:
Andy Gill (andy) [PhD student; at HP]
Cordy Hall (cvh) [GRASP]
Kevin Hammond (kh) [GRASP; at St. Andrews]
......@@ -49,6 +55,8 @@ Past contributors and/or continuing advisors:
David N Turner (dnt) [Linear Types; at An-Teallach]
Phil Wadler (wadler) [GRASP; at Lucent]
And many others who've contributed bits of code / bug reports in the past.
Cool people who've let us use their machines:
sparc-sun-sunos{4,5} PacSoft, Oregon Graduate Institute
......@@ -65,14 +73,13 @@ Simon's projects' acronyms:
GRASP ('90-'92): Graph reduction applications support project
AQUA ('93- ): Declarative systems architecture: a quantitative approach
GHC WWW page: http://www.dcs.gla.ac.uk/fp/software/ghc/
E-mail contacts:
glasgow-haskell-bugs@dcs.gla.ac.uk (bug reports mailing list)
glasgow-haskell-users@dcs.gla.ac.uk (users' mailing list)
Send mail to majordomo@dcs.gla.ac.uk with 'help' in the body of the
message for information on joining either of these mailing lists.
message for information on joining/leaving either of these mailing
lists.
Anonymous FTP site: ftp://ftp.dcs.gla.ac.uk:pub/haskell/glasgow.
Mostly mirrored by ftp.cs.chalmers.se and haskell.org (same
......
ToDo
~~~~
* Test effect of eta-expanding past (case x of ..)
* Bottom strictness isn't right. Should be (eg) SSX, not just X.
* Enumeration types in worker/wrapper for strictness analysis
* Use (!) types in data cons to unbox.
* Check constant folding
* .hi file isn't updated if the only change is to the exports.
For example, UgenAll.lhs re-exports all of U_binding.hs; when a data type
decl in the latter changes, the .hi file for the former isn't updated.
I think this happens when a module exports another mdodule thus:
module UgenAll( module U_binding, ... ) where
* This should be reported as an error:
data T k = MkT (k Int#)
* Bogus report of overlapped pattern for
f (R {field = [c]}) = 1
f (R {}) = 2
This shows up for TyCon.maybeTyConSingleCon
* > module Main( main ) where
> f :: String -> Int
> f "=<" = 0
> f "=" = 0
> g :: [Char] -> Int
> g ['=','<'] = 0
> g ['='] = 0
> main = return ()
For ``f'' the following is reported.
tmp.lhs:4:
Pattern match(es) are overlapped in the definition of function `f'
"=" = ...
There are no complaints for definition for ``g''.
* Without -O I don't think we need change the module version
if the usages change; I forget why it changes even with -O
* Record selectors for existential type; no good! What to do?
Record update doesn't make sense either.
Need to be careful when figuring out strictness, and when generating
worker-wrapper split.
Also when deriving.
* Consructor re-use via CSE
Notes on module dependencies
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The Name/Var/Type group is a bit complicated. Here's the deal
Name, PrimRep, FieldLabel (uses Type.Type)
then
Var (uses Const.Con, IdInfo.IdInfo, Type.GenType, Type.Kind)
then
VarEnv, VarSet
then
Class (uses TyCon.TyCon, Type.Type, SpecEnv.SpecEnv)
then
TyCon (uses Type.Type, Type.Kind, DataCon.DataCon)
then
Type (uses [DataCon.DataCon])
then
DataCon, TysPrim, Unify, SpecEnv, PprType
then
IdInfo, TysWiredIn (uses DataCon.mkDataCon, [MkId.mkDataConId])
then
PrimOp (uses PprType, TysWiredIn)
then
Const (needs PrimOp, [TysWiredIn.stringTy])
then
Id (needs Const.Con(..)), CoreSyn
then
CoreUtils, OccurAnal
then
CoreUnfold (uses OccurAnal)
then
MkId (uses CoreUnfold)
PrimOp uses TysWiredIn
Add
~~~
basicTypes/DataCon.lhs
basicTypes/DataCon.hi-boot
Remove
~~~~~~
specialise/SpecUtils.lhs
basicTypes/IdUtils.lhs
# -----------------------------------------------------------------------------
# $Id: Makefile,v 1.45 1998/08/21 11:03:30 sof Exp $
# $Id: Makefile,v 1.46 1998/12/02 13:17:15 simonm Exp $
TOP = ..
include $(TOP)/mk/boilerplate.mk
......@@ -60,14 +60,21 @@ endif
HS_SRCS = $(SRCS_UGNHS) \
$(foreach dir,$(DIRS),$(wildcard $(dir)/*.lhs)) \
rename/ParseIface.hs
$(foreach dir,$(DIRS),$(wildcard $(dir)/*.lhs))
ifneq "$(GhcWithHscBuiltViaC)" "YES"
HS_SRCS += rename/ParseIface.hs
endif
# NB: it's no good to include *.hs in the top-line wildcard, because the .hs files
# in parser/ may not have been created at that point.
HCS = $(patsubst %.lhs, %.hc, $(patsubst %.hs, %.hc, $(HS_SRCS)))
# ParseIface.hs ain't part of HS_SRCS when this is on..
ifeq "$(GhcWithHscBuiltViaC)" "YES"
HCS += rename/ParseIface.hc
endif
HS_OBJS = \
$(patsubst %.hc, %.o, $(HCS)) \
......@@ -91,15 +98,14 @@ C_SRCS += $(SRCS_UGNC)
LIBOBJS = \
$(SRCS_UGN_OBJS) parser/hslexer.o parser/hsparser.tab.o \
parser/id.o parser/infix.o parser/syntax.o parser/type2context.o \
parser/util.o
parser/util.o parser/ctypes.o
#
# stuff you get for free in a source distribution
#
SRC_DIST_FILES += rename/ParseIface.hs \
parser/U_tree.c parser/tree.h parser/tree.c \
parser/hsparser.tab.c parser/hsparser.tab.h \
parser/hslexer.c
# SRC_DIST_FILES += rename/ParseIface.hs \
# parser/U_tree.c parser/tree.h parser/tree.c \
# parser/hsparser.tab.c parser/hsparser.tab.h \
# parser/hslexer.c
# -----------------------------------------------------------------------------
# Haskell compilations
......@@ -138,9 +144,13 @@ absCSyn/PprAbsC_HC_OPTS = -H10m
basicTypes/IdInfo_HC_OPTS = -K2m
hsSyn/HsExpr_HC_OPTS = -K2m
main/Main_HC_OPTS = -fvia-C
main/Constants_HC_OPTS = -DHscIfaceFileVersion=$(HscIfaceFileVersion)
ifneq "$(GhcWithHscBuiltViaC)" "YES"
ifeq "$(GhcReportCompiles)" "YES"
main/Main_HC_OPTS += -syslib misc -DREPORT_TO_MOTHERLODE
endif
endif
main/CmdLineOpts_HC_OPTS = -fvia-C
nativeGen/PprMach_HC_OPTS = -K2m
......@@ -179,13 +189,19 @@ rename/RnExpr_HC_OPTS = -H10m
rename/RnNames_HC_OPTS = -H12m
rename/RnMonad_HC_OPTS = -fvia-C
specialise/Specialise_HC_OPTS = -Onot -H12m
simplCore/Simplify_HC_OPTS = -H15m
typecheck/TcGenDeriv_HC_OPTS = -H10m
# tmp, -- SDM
specialise/Specialise_HC_OPTS += -fno-prune-tydecls
# Was 10m for 2.10
typecheck/TcHsSyn_HC_OPTS = -H15m
# Was 10m for 2.10
typecheck/TcExpr_HC_OPTS = -H15m
typecheck/TcBinds_HC_OPTS = -H10m
typecheck/TcEnv_HC_OPTS = -H10m
utils/Argv_HC_OPTS = -fvia-C
......@@ -240,7 +256,7 @@ SRC_FLEX_OPTS += -s
parser/hschooks.o : parser/hschooks.c
@$(RM) $@
$(HC) -c -o $@ $(HC_OPTS) parser/hschooks.c
$(HC) -c -o $@ -I$(GHC_INCLUDE_DIR) $(HC_OPTS) parser/hschooks.c
# Interface-file parser uses Happy
......@@ -266,9 +282,12 @@ CLEAN_FILES += hsp
# Linking
SRC_LD_OPTS += -no-link-chk
ifneq "$(GhcWithHscBuiltViaC)" "YES"
ifeq "$(GhcReportCompiles)" "YES"
SRC_LD_OPTS += -syslib misc -syslib exts
endif
endif
#-----------------------------------------------------------------------------
# install
......@@ -285,7 +304,11 @@ INSTALL_LIBEXECS += hsc hsp
#
# Before doing `make depend', need to build all derived Haskell source files
#
depend :: $(LOOPS) $(SRCS_UGNHS) rename/ParseIface.hs
depend :: $(LOOPS) $(SRCS_UGNHS)
ifneq "$(GhcWithHscBuiltViaC)" "YES"
depend :: rename/ParseIface.hs
endif
#-----------------------------------------------------------------------------
# clean
......
%
% (c) The GRASP/AQUA Project, Glasgow University, 1992-1996
% (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
%
% $Id: AbsCSyn.lhs,v 1.18 1998/12/02 13:17:16 simonm Exp $
%
\section[AbstractC]{Abstract C: the last stop before machine code}
......@@ -29,32 +31,28 @@ module AbsCSyn {- (
-- registers
MagicId(..), node, infoptr,
isVolatileReg, noLiveRegsMask, mkLiveRegsMask,
isVolatileReg,
CostRes(Cost)
)-} where
#include "HsVersions.h"
import {-# SOURCE #-} ClosureInfo ( ClosureInfo )
import {-# SOURCE #-} CLabel ( CLabel )
#if ! OMIT_NATIVE_CODEGEN
import {-# SOURCE #-} MachMisc
#endif
import CLabel
import Constants ( mAX_Vanilla_REG, mAX_Float_REG,
mAX_Double_REG, lIVENESS_R1, lIVENESS_R2,
lIVENESS_R3, lIVENESS_R4, lIVENESS_R5,
lIVENESS_R6, lIVENESS_R7, lIVENESS_R8
)
import HeapOffs ( VirtualSpAOffset, VirtualSpBOffset,
VirtualHeapOffset, HeapOffset
)
import CostCentre ( CostCentre )
import Literal ( mkMachInt, Literal )
import PrimRep ( isFollowableRep, PrimRep(..) )
mAX_Double_REG, spRelToInt )
import CostCentre ( CostCentre, CostCentreStack )
import Const ( mkMachInt, Literal )
import PrimRep ( PrimRep(..) )
import PrimOp ( PrimOp )
import Unique ( Unique )
import StgSyn ( SRT(..) )
import BitSet -- for liveness masks
\end{code}
......@@ -108,7 +106,6 @@ stored in a mixed type location.)
-- CSwitch m [(tag,code)] AbsCNop == code
| CCodeBlock CLabel AbstractC
-- [amode analog: CLabelledCode]
-- A labelled block of code; this "statement" is not
-- executed; rather, the labelled code will be hoisted
-- out to the top level (out of line) & it can be
......@@ -119,13 +116,11 @@ stored in a mixed type location.)
RegRelative -- address of the info ptr
CAddrMode -- cost centre to place in closure
-- CReg CurCostCentre or CC_HDR(R1.p{-Node-})
Bool -- inplace update or allocate
| COpStmt
[CAddrMode] -- Results
PrimOp
[CAddrMode] -- Arguments
Int -- Live registers (may be obtainable from volatility? ADR)
[MagicId] -- Potentially volatile/live registers
-- (to save/restore around the call/op)
......@@ -145,6 +140,17 @@ stored in a mixed type location.)
-- For example { a := b, b := a }
-- needs to go via (at least one) temporary
| CCheck -- heap or stack checks, or both.
CCheckMacro -- These might include some code to fill in tags
[CAddrMode] -- on the stack, so we can't use CMacroStmt below.
AbstractC
| CRetDirect -- Direct return
Unique -- for making labels
AbstractC -- return code
(CLabel,SRT) -- SRT info
Liveness -- stack liveness at the return point
-- see the notes about these next few; they follow below...
| CMacroStmt CStmtMacro [CAddrMode]
| CCallProfCtrMacro FAST_STRING [CAddrMode]
......@@ -166,50 +172,42 @@ stored in a mixed type location.)
| CStaticClosure
CLabel -- The (full, not base) label to use for labelling the closure.
ClosureInfo
CAddrMode -- cost centre identifier to place in closure
[CAddrMode] -- free vars; ptrs, then non-ptrs
CAddrMode -- cost centre identifier to place in closure
[CAddrMode] -- free vars; ptrs, then non-ptrs.
| CSRT CLabel [CLabel] -- SRT declarations: basically an array of
-- pointers to static closures.
| CBitmap CLabel LivenessMask -- A larger-than-32-bits bitmap.
| CClosureInfoAndCode
ClosureInfo -- Explains placement and layout of closure
AbstractC -- Slow entry point code
ClosureInfo -- Explains placement and layout of closure
AbstractC -- Slow entry point code
(Maybe AbstractC)
-- Fast entry point code, if any
CAddrMode -- Address of update code; Nothing => should never be used
-- (which is the case for all except constructors)
String -- Closure description; NB we can't get this from