ghc-hetmet.git
14 years agoFix the alternative layout rule to handle explicit let/in
Ian Lynagh [Tue, 2 Mar 2010 16:51:19 +0000 (16:51 +0000)]
Fix the alternative layout rule to handle explicit let/in
It used to break on
    let {x = 'a'} in x
as the 'in' token would keep closing contexts looking for an implicit
'let' layout.

14 years agoexpand comments for #2578 fix
Simon Marlow [Mon, 1 Mar 2010 09:55:25 +0000 (09:55 +0000)]
expand comments for #2578 fix

14 years agoa faster appendFS
ich@christoph-bauer.net [Sat, 27 Feb 2010 21:16:59 +0000 (21:16 +0000)]
a faster appendFS

14 years agoImplement a smart constructor mkUnsafeCoercion, and use it
simonpj@microsoft.com [Mon, 1 Mar 2010 11:17:44 +0000 (11:17 +0000)]
Implement a smart constructor mkUnsafeCoercion, and use it

This just ensures that an unsafe coercion is as localised as possible.
For example, instead of
    UnsafeCo (Int -> t1) (Int -> t2)
use
    Int -> UnsafeCo t1 t2

14 years agoSuggest -XGeneralizedNewtypeDeriving (fix Trac #3888)
simonpj@microsoft.com [Mon, 1 Mar 2010 11:15:55 +0000 (11:15 +0000)]
Suggest -XGeneralizedNewtypeDeriving (fix Trac #3888)

If we can't derive a type, but it's a reasonable possibility that
newtype deriving would do the job, suggest it.

A little refactoring too, moving non_iso_class to top level,
and putting it with std_class_via_iso.

14 years agoTidy up AnyTyCon stuff
simonpj@microsoft.com [Mon, 1 Mar 2010 11:14:01 +0000 (11:14 +0000)]
Tidy up AnyTyCon stuff

If we find ourselves making up an AnyTyCon of kind '??', say,
then default it to liftedTypeKind.  And similarly for any sub-kind
of LiftedTypeKind.

This is just a tidy-up.

14 years agoFix pretty-printing of IfaceAnyTc (fixes Trac #3883)
simonpj@microsoft.com [Mon, 1 Mar 2010 11:10:40 +0000 (11:10 +0000)]
Fix pretty-printing of IfaceAnyTc (fixes Trac #3883)

The panic message in ifaceTyConName on IfaceAnyTc
called the pretty-printer, called ifaceTyConName again,
which caused an infinite regress.  Stupid.

See
 * Note [The Name of an IfaceAnyTc], and
 * The Outputable instance for IfaceTyCon

14 years agoOmit unnecessary parens when pretty-printing IfaceExpr
simonpj@microsoft.com [Mon, 1 Mar 2010 11:07:48 +0000 (11:07 +0000)]
Omit unnecessary parens when pretty-printing IfaceExpr

14 years agoComments only
simonpj@microsoft.com [Thu, 25 Feb 2010 17:41:12 +0000 (17:41 +0000)]
Comments only

14 years agoAdd comment
simonpj@microsoft.com [Thu, 25 Feb 2010 17:40:48 +0000 (17:40 +0000)]
Add comment

14 years agoChange pretty printing of InlinePrag slightly
simonpj@microsoft.com [Thu, 25 Feb 2010 17:40:28 +0000 (17:40 +0000)]
Change pretty printing of InlinePrag slightly

14 years agoAdd -no-auto-link-packages docs to the user guide; fixes trac #3759
Ian Lynagh [Sun, 28 Feb 2010 19:18:37 +0000 (19:18 +0000)]
Add -no-auto-link-packages docs to the user guide; fixes trac #3759

14 years agoWhitespace only in docs/users_guide/packages.xml
Ian Lynagh [Sun, 28 Feb 2010 18:29:45 +0000 (18:29 +0000)]
Whitespace only in docs/users_guide/packages.xml

14 years agoAdd a LICENSE file to libraries/bin-package-db
Ian Lynagh [Sat, 27 Feb 2010 20:56:26 +0000 (20:56 +0000)]
Add a LICENSE file to libraries/bin-package-db
Silences a (harmless) error from tar when making bindists

14 years agoHave separate rules to generate tags and TAGS
Ian Lynagh [Sat, 27 Feb 2010 20:25:17 +0000 (20:25 +0000)]
Have separate rules to generate tags and TAGS
This works around the two filenames being the same on case-insensitive
file systems.

14 years agoFix trac #2578
Ian Lynagh [Sat, 27 Feb 2010 17:39:51 +0000 (17:39 +0000)]
Fix trac #2578
We define empty datatypes as not being enumerations, which means the
empty blocks aren't generated.

14 years agoFix the build with GHC < 6.12
Ian Lynagh [Fri, 26 Feb 2010 22:39:31 +0000 (22:39 +0000)]
Fix the build with GHC < 6.12

14 years agoupdate the docs to reflect changes in the tracing flags
Simon Marlow [Fri, 26 Feb 2010 11:12:05 +0000 (11:12 +0000)]
update the docs to reflect changes in the tracing flags

14 years agoTweak the tracing flags slightly, and clean up error handling and diagnostics
Simon Marlow [Fri, 26 Feb 2010 11:06:08 +0000 (11:06 +0000)]
Tweak the tracing flags slightly, and clean up error handling and diagnostics

Tracing flags are now:

   -l[flags]  Log events in binary format to the file <program>.eventlog
   -v[flags]  Log events to stderr
              where [flags] can contain:
                 s    scheduler events
                 t    add time stamps (only useful with -v)

and there are more helpful error messages when using flags that are
only available in particular variants of the RTS:

 the flag -v requires the program to be built with -debug
 the flag -Ds requires the program to be built with -debug
 the flag -p requires the program to be built with -prof
 the flag -N requires the program to be built with -threaded
 the flag -v requires the program to be built with -debug

Also, I fixed the crash reported in #3874, with +RTS -ls -v.

14 years agoFix crash when using printf format specifiers in traceEvent (#3874)
Simon Marlow [Fri, 26 Feb 2010 09:32:15 +0000 (09:32 +0000)]
Fix crash when using printf format specifiers in traceEvent (#3874)

14 years agohack to make the docs build again in a lndir build tree (see comments)
Simon Marlow [Thu, 25 Feb 2010 13:16:16 +0000 (13:16 +0000)]
hack to make the docs build again in a lndir build tree (see comments)

14 years agoForce encoding to UTF-8 when writing individual .conf files
Simon Marlow [Wed, 24 Feb 2010 15:25:19 +0000 (15:25 +0000)]
Force encoding to UTF-8 when writing individual .conf files

14 years agoFix build for non-x86 arches again.
Ben.Lippmeier@anu.edu.au [Mon, 22 Feb 2010 07:51:44 +0000 (07:51 +0000)]
Fix build for non-x86 arches again.

14 years agoFix the link to the ghc docs in libraries/prologue.txt
Ian Lynagh [Tue, 23 Feb 2010 18:16:44 +0000 (18:16 +0000)]
Fix the link to the ghc docs in libraries/prologue.txt

14 years agoFix more library links in the user guide
Ian Lynagh [Tue, 23 Feb 2010 16:45:51 +0000 (16:45 +0000)]
Fix more library links in the user guide

14 years agoFix the links to the base docs from the user guide
Ian Lynagh [Tue, 23 Feb 2010 15:05:22 +0000 (15:05 +0000)]
Fix the links to the base docs from the user guide

14 years agoRemove old, unused release notes
Ian Lynagh [Tue, 23 Feb 2010 15:03:27 +0000 (15:03 +0000)]
Remove old, unused release notes

14 years agoFix #3875: Crash in parallel GC, wrong pointer was being tested.
Ben.Lippmeier@anu.edu.au [Mon, 22 Feb 2010 03:16:27 +0000 (03:16 +0000)]
Fix #3875: Crash in parallel GC, wrong pointer was being tested.

14 years agoAdd utils/ghctags/ghc.mk
Ian Lynagh [Sun, 21 Feb 2010 18:52:00 +0000 (18:52 +0000)]
Add utils/ghctags/ghc.mk

14 years agoMake "make tags" work in the new build system
Ian Lynagh [Sun, 21 Feb 2010 16:44:32 +0000 (16:44 +0000)]
Make "make tags" work in the new build system

14 years agoRemove the old hstags util
Ian Lynagh [Sat, 20 Feb 2010 23:59:09 +0000 (23:59 +0000)]
Remove the old hstags util

14 years agoCheck for suitable versions of make in bindists; fixes trac #3860
Ian Lynagh [Sat, 20 Feb 2010 21:11:57 +0000 (21:11 +0000)]
Check for suitable versions of make in bindists; fixes trac #3860
We already had a check in configure of the actual build. This patch
adds it to the configure of the bindists too.

14 years agoFix build on Windows
Ian Lynagh [Fri, 19 Feb 2010 13:42:22 +0000 (13:42 +0000)]
Fix build on Windows

14 years agoUse the shared C wrapper code in ghci.c too
Ian Lynagh [Thu, 18 Feb 2010 17:17:16 +0000 (17:17 +0000)]
Use the shared C wrapper code in ghci.c too

14 years agoRefactor gcc.c, pulling out the reusable code
Ian Lynagh [Thu, 18 Feb 2010 17:09:31 +0000 (17:09 +0000)]
Refactor gcc.c, pulling out the reusable code

14 years agoFix a recompilation checking bug when a package dependency changes
Simon Marlow [Wed, 17 Feb 2010 13:32:50 +0000 (13:32 +0000)]
Fix a recompilation checking bug when a package dependency changes

We weren't forcing enough recompilationg when package dependencies
changed, with the result that bumping a package version could lead to
linking failures or other problems later.

The problem/solutation are described on the wiki:

http://hackage.haskell.org/trac/ghc/wiki/Commentary/Compiler/RecompilationAvoidance#Packageversionchanges

14 years agodarcs-all --extra get: gets a few extra packages
Simon Marlow [Wed, 17 Feb 2010 10:46:34 +0000 (10:46 +0000)]
darcs-all --extra get: gets a few extra packages
currently deepseq, parallel, stm.

14 years agoAllow extra packages to be added to the build, by setting $(EXTRA_PACKAGES)
Simon Marlow [Wed, 17 Feb 2010 10:31:34 +0000 (10:31 +0000)]
Allow extra packages to be added to the build, by setting $(EXTRA_PACKAGES)

14 years agoBeef up cmmMiniInline a tiny bit
Simon Marlow [Tue, 16 Feb 2010 15:05:06 +0000 (15:05 +0000)]
Beef up cmmMiniInline a tiny bit
Allow a temporary assignment to be pushed past an assignment to a
global if the global is not mentioned in the rhs of the assignment we
are inlining.

This fixes up some bad code.  We should make sure we're doing
something equivalent in the new backend in due course.

14 years agoWrite the binary cache file atomically
Simon Marlow [Tue, 16 Feb 2010 13:48:41 +0000 (13:48 +0000)]
Write the binary cache file atomically
Should fix an occasional build error of the form
 ghc-pkg: too few bytes. Failed reading at byte position 8

14 years agodisable a false assertion, with a comment to explain why
Simon Marlow [Tue, 16 Feb 2010 12:35:44 +0000 (12:35 +0000)]
disable a false assertion, with a comment to explain why

14 years agoFix a bug that can lead to noDuplicate# not working sometimes.
Simon Marlow [Tue, 16 Feb 2010 12:34:11 +0000 (12:34 +0000)]
Fix a bug that can lead to noDuplicate# not working sometimes.

The symptom is that under some rare conditions when running in
parallel, an unsafePerformIO or unsafeInterleaveIO computation might
be duplicated, so e.g. lazy I/O might give the wrong answer (the
stream might appear to have duplicate parts or parts missing).

I have a program that demonstrates it -N3 or more, some lazy I/O, and
a lot of shared mutable state.  See the comment with stg_noDuplicatezh
in PrimOps.cmm that explains the problem and the fix.  This took me
about a day to find :-(

14 years agoRepresent the free register set using Word64 on x86-64 (fixes ffi009)
Simon Marlow [Mon, 15 Feb 2010 13:01:02 +0000 (13:01 +0000)]
Represent the free register set using Word64 on x86-64 (fixes ffi009)
Following recent changes to the numbering of registers, we overflowed
Word32 on x86-64, with the result that xmm8 and later we not being
allocated.

14 years agofix lost context switches in GHCi (fixes test 3429(ghci))
Simon Marlow [Mon, 15 Feb 2010 09:32:05 +0000 (09:32 +0000)]
fix lost context switches in GHCi (fixes test 3429(ghci))

14 years agoFix build for non-x86 architectures
Ben.Lippmeier@anu.edu.au [Mon, 15 Feb 2010 01:47:19 +0000 (01:47 +0000)]
Fix build for non-x86 architectures

14 years agoAdd comments about the ForceSpecConstr mechanism
Roman Leshchinskiy [Mon, 15 Feb 2010 03:01:03 +0000 (03:01 +0000)]
Add comments about the ForceSpecConstr mechanism

14 years agoSpot ForceSpecConstr arguments in polymorphic loops
Roman Leshchinskiy [Mon, 15 Feb 2010 02:53:08 +0000 (02:53 +0000)]
Spot ForceSpecConstr arguments in polymorphic loops

14 years agoDon't rely on tar supporting -z; trac #3841
Ian Lynagh [Sun, 14 Feb 2010 22:04:50 +0000 (22:04 +0000)]
Don't rely on tar supporting -z; trac #3841

14 years agodon't constant fold division that would result in negative zero (#3676)
Simon Marlow [Thu, 11 Feb 2010 13:15:43 +0000 (13:15 +0000)]
don't constant fold division that would result in negative zero (#3676)

14 years agoImprove error dump in TcEnv
simonpj@microsoft.com [Wed, 10 Feb 2010 14:52:10 +0000 (14:52 +0000)]
Improve error dump in TcEnv

14 years agoKeep track of explicit kinding in HsTyVarBndr; plus fix Trac #3845
simonpj@microsoft.com [Wed, 10 Feb 2010 14:51:55 +0000 (14:51 +0000)]
Keep track of explicit kinding in HsTyVarBndr; plus fix Trac #3845

To print HsTypes correctly we should remember whether the Kind on
a HsTyVarBndr came from type inference, or was put there by the
user.  See Note [Printing KindedTyVars] in HsTypes.  So instead of
changing a UserTyVar to a KindedTyVar during kind checking, we
simply add a PostTcKind to the UserTyVar.

The change was provoked by Trac #3830, although other changes
mean that #3830 gets a diferent and better error message now.
So this patch is simply doing the Right Thing for the future.

This patch also fixes Trac #3845, which was caused by a *type splice*
not remembering the free *term variables* mentioned in it.  Result
was that we build a 'let' when it should have been 'letrec'.
Hence a new FreeVars field in HsSpliceTy.

While I was at it, I got rid of HsSpliceTyOut and use a PostTcKind
on HsSpliceTy instead, just like on the UserTyVar.

14 years agoDocumentation for changes to Template Haskell and quasi-quotation
simonpj@microsoft.com [Wed, 10 Feb 2010 11:42:13 +0000 (11:42 +0000)]
Documentation for changes to Template Haskell and quasi-quotation

14 years agoRemove redundant import
simonpj@microsoft.com [Mon, 8 Feb 2010 16:57:56 +0000 (16:57 +0000)]
Remove redundant import

14 years agoStop fruitless ANF-ing
simonpj@microsoft.com [Wed, 10 Feb 2010 09:47:33 +0000 (09:47 +0000)]
Stop fruitless ANF-ing

The simplifier is taking more iterations than it should, because we
were fruitlessly ANF-ing a top-level declaration of form

   x = Ptr "foo"#

to get

   x = let v = "foo"# in Ptr v

and then inlining v again.  This patch makes Simplify.makeTrivial
top-level aware, so that it doesn't ANF if it's going to be undone.

14 years agoComments only
simonpj@microsoft.com [Wed, 10 Feb 2010 09:45:37 +0000 (09:45 +0000)]
Comments only

14 years agoSimplify syntax for quasi-quotation
simonpj@microsoft.com [Wed, 10 Feb 2010 09:44:19 +0000 (09:44 +0000)]
Simplify syntax for quasi-quotation

After some discussion we decided to make a quasi-quote look like

   [pads| ...blah... |]

rather than

   [$pads| ...blah... |]

as before. The new syntax is quieter, although it does not signal
quite as clearly that there is a splice going on.

14 years agoSeveral TH/quasiquote changes
simonpj@microsoft.com [Wed, 10 Feb 2010 09:39:10 +0000 (09:39 +0000)]
Several TH/quasiquote changes

a) Added quasi-quote forms for
      declarations
      types
   e.g.   f :: [$qq| ... |]

b) Allow Template Haskell pattern quotes (but not splices)
   e.g.  f x = [p| Int -> $x |]

c) Improve pretty-printing for HsPat to remove superfluous
   parens.  (This isn't TH related really, but it affects
   some of the same code.)

A consequence of (a) is that when gathering and grouping declarations
in RnSource.findSplice, we must expand quasiquotes as we do so.
Otherwise it's all fairly straightforward.  I did a little bit of
refactoring in TcSplice.

User-manual changes still to come.

14 years agogenerate slightly better code for ccall argument-pushing on x86
Simon Marlow [Tue, 9 Feb 2010 10:11:14 +0000 (10:11 +0000)]
generate slightly better code for ccall argument-pushing on x86

14 years ago--lazy overrides --partial too
Simon Marlow [Tue, 9 Feb 2010 09:39:27 +0000 (09:39 +0000)]
--lazy overrides --partial too
At least until we switch to --lazy being the default

14 years agoFix Trac #3850
simonpj@microsoft.com [Mon, 8 Feb 2010 16:37:51 +0000 (16:37 +0000)]
Fix Trac #3850

This patch simply avoids a needless difference in behaviour from
6.10, and one that happens to affect HList. See Note [Stupid theta].

14 years agoFix a bug introduced in the SSE2 support: callClobberedRegs was wrong
Simon Marlow [Fri, 5 Feb 2010 11:29:38 +0000 (11:29 +0000)]
Fix a bug introduced in the SSE2 support: callClobberedRegs was wrong

14 years agoImplement SSE2 floating-point support in the x86 native code generator (#594)
Simon Marlow [Thu, 4 Feb 2010 10:48:49 +0000 (10:48 +0000)]
Implement SSE2 floating-point support in the x86 native code generator (#594)

The new flag -msse2 enables code generation for SSE2 on x86.  It
results in substantially faster floating-point performance; the main
reason for doing this was that our x87 code generation is appallingly
bad, and since we plan to drop -fvia-C soon, we need a way to generate
half-decent floating-point code.

The catch is that SSE2 is only available on CPUs that support it (P4+,
AMD K8+).  We'll have to think hard about whether we should enable it
by default for the libraries we ship.  In the meantime, at least
-msse2 should be an acceptable replacement for "-fvia-C
-optc-ffast-math -fexcess-precision".

SSE2 also has the advantage of performing all operations at the
correct precision, so floating-point results are consistent with other
platforms.

I also tweaked the x87 code generation a bit while I was here, now
it's slighlty less bad than before.

14 years agoadd libraries/binary
Simon Marlow [Wed, 3 Feb 2010 13:54:21 +0000 (13:54 +0000)]
add libraries/binary

14 years agoadd comment for srt_bitmap field
Simon Marlow [Wed, 3 Feb 2010 10:34:31 +0000 (10:34 +0000)]
add comment for srt_bitmap field

14 years agoUse bash to run boot-pkgs, the default Solaris shell doesn't support the -ot test...
benl@cse.unsw.edu.au [Wed, 3 Feb 2010 03:07:48 +0000 (03:07 +0000)]
Use bash to run boot-pkgs, the default Solaris shell doesn't support the -ot test flag

14 years agoDisable -Wcast-align when building the rts
benl@cse.unsw.edu.au [Wed, 3 Feb 2010 02:46:05 +0000 (02:46 +0000)]
Disable -Wcast-align when building the rts
This flag seems buggy on GCC 4.1.2, which is the only GCC version we
have that can bootstrap the SPARC build. We end up with lots of supurious
warnings of the form "cast increases required alignment of target type".
Some legitimate warnings can be fixed by adding an intermediate cast to
(void*), but we get others in rts/sm/GCUtils.c concerning the gct var
that look innocuous to me. We could enable this again once we deprecate
support for registerised builds on this arch.

14 years agoStifle warning about printf format strings
benl@cse.unsw.edu.au [Wed, 3 Feb 2010 02:31:24 +0000 (02:31 +0000)]
Stifle warning about printf format strings

14 years agoCast to (void*) to stifle warning about signedness
benl@cse.unsw.edu.au [Wed, 3 Feb 2010 02:30:29 +0000 (02:30 +0000)]
Cast to (void*) to stifle warning about signedness

14 years agoAdd missing import sm_mutex, which fixes the -fvia-c build
benl@cse.unsw.edu.au [Tue, 2 Feb 2010 05:14:51 +0000 (05:14 +0000)]
Add missing import sm_mutex, which fixes the -fvia-c build

14 years agoFix typo in error message (#3848)
Simon Marlow [Sat, 30 Jan 2010 09:46:28 +0000 (09:46 +0000)]
Fix typo in error message (#3848)

14 years agoFix Trac #3831: blowup in SpecConstr
simonpj@microsoft.com [Mon, 1 Feb 2010 00:24:20 +0000 (00:24 +0000)]
Fix Trac #3831: blowup in SpecConstr

It turned out that there were two bugs.  First, we were getting an
exponential number of specialisations when we had a deep nest of
join points.  See Note [Avoiding exponential blowup]. I fixed this
by dividing sc_count (in ScEnv) by the number of specialisations
when recursing.  Crude but effective.

Second, when making specialisations I was looking at the result of
applying specExpr to the RHS of the function, whereas I should have
been looking at the original RHS.  See Note [Specialise original
body].

There's a tantalising missed opportunity here, though.  In this
example (recorded as a test simplCore/should_compile/T3831), each join
point has *exactly one* call pattern, so we should really just
specialise for that alone, in which case there's zero code-blow-up.
In particular, we don't need the *original* RHS at all.  I need to think
more about how to exploit this.

But the blowup is now limited, so compiling terminfo with -O2 works again.

14 years agoRe-read pragmas after preprocessing (#2464, #3674, #3457)
Simon Marlow [Fri, 29 Jan 2010 11:40:50 +0000 (11:40 +0000)]
Re-read pragmas after preprocessing (#2464, #3674, #3457)
This was a lot easier than I imagined.

14 years agotweak the totally-bogus arbitrary stack-squeezing heuristic to fix #2797
Simon Marlow [Thu, 28 Jan 2010 12:44:54 +0000 (12:44 +0000)]
tweak the totally-bogus arbitrary stack-squeezing heuristic to fix #2797
In #2797, a program that ran in constant stack space when compiled
needed linear stack space when interpreted.  It turned out to be
nothing more than stack-squeezing not happening.  We have a heuristic
to avoid stack-squeezing when it would be too expensive (shuffling a
large amount of memory to save a few words), but in some cases even
expensive stack-squeezing is necessary to avoid linear stack usage.
One day we should implement stack chunks, which would make this less
expensive.

14 years agofix warning on Windows
Simon Marlow [Wed, 27 Jan 2010 16:29:54 +0000 (16:29 +0000)]
fix warning on Windows

14 years agofix Windows build (GHC.Conc.runHandlers is Unix-only)
Simon Marlow [Wed, 27 Jan 2010 14:57:18 +0000 (14:57 +0000)]
fix Windows build (GHC.Conc.runHandlers is Unix-only)

14 years agoDon't Terminate the ticker thread (#3748)
Simon Marlow [Wed, 27 Jan 2010 13:54:30 +0000 (13:54 +0000)]
Don't Terminate the ticker thread (#3748)

14 years agoWin32 yieldThread(): use SwitchToThread() instead of Sleep(0)
Simon Marlow [Wed, 27 Jan 2010 13:31:06 +0000 (13:31 +0000)]
Win32 yieldThread(): use SwitchToThread() instead of Sleep(0)

14 years agofix warnings
Simon Marlow [Wed, 27 Jan 2010 13:30:40 +0000 (13:30 +0000)]
fix warnings

14 years agocatch SIGHUP and SIGTERM and raise an exception (#3656)
Simon Marlow [Wed, 27 Jan 2010 14:04:38 +0000 (14:04 +0000)]
catch SIGHUP and SIGTERM and raise an exception (#3656)

14 years agodefine INFINITY and NAN if they don't exist (#2929)
Simon Marlow [Wed, 27 Jan 2010 13:36:32 +0000 (13:36 +0000)]
define INFINITY and NAN if they don't exist (#2929)

14 years agoremove suspicious whitespace-only lines
Simon Marlow [Wed, 27 Jan 2010 13:30:08 +0000 (13:30 +0000)]
remove suspicious whitespace-only lines

14 years agoaddCoverageTicksToBinds: tolerate a non-existent .hs file (#3803)
Simon Marlow [Wed, 27 Jan 2010 11:32:05 +0000 (11:32 +0000)]
addCoverageTicksToBinds: tolerate a non-existent .hs file (#3803)

14 years agoavoid using non-standard %zd format specifier (#3804)
Simon Marlow [Tue, 26 Jan 2010 16:33:22 +0000 (16:33 +0000)]
avoid using non-standard %zd format specifier (#3804)

14 years agoFix signal segfaults on Solaris (#3790)
Simon Marlow [Tue, 26 Jan 2010 15:54:49 +0000 (15:54 +0000)]
Fix signal segfaults on Solaris (#3790)

14 years agocomment-out an incorrect assertion
Simon Marlow [Tue, 26 Jan 2010 15:01:03 +0000 (15:01 +0000)]
comment-out an incorrect assertion

14 years agoFix a deadlock, and possibly other problems
Simon Marlow [Tue, 26 Jan 2010 15:00:37 +0000 (15:00 +0000)]
Fix a deadlock, and possibly other problems
After a bound thread had completed, its TSO remains in the heap until
it has been GC'd, although the associated Task is returned to the
caller where it is freed and possibly re-used.

The bug was that GC was following the pointer to the Task and updating
the TSO field, meanwhile the Task had already been recycled (it was
being used by exitScheduler()). Confusion ensued, leading to a very
occasional deadlock at shutdown, but in principle it could result in
other crashes too.

The fix is to remove the link between the TSO and the Task when the
TSO has completed and the call to schedule() has returned; see
comments in Schedule.c.

14 years agoWhen acquiring a spinlock, yieldThread() every 1000 spins (#3553, #3758)
Simon Marlow [Fri, 22 Jan 2010 16:49:11 +0000 (16:49 +0000)]
When acquiring a spinlock, yieldThread() every 1000 spins (#3553, #3758)

This helps when the thread holding the lock has been descheduled,
which is the main cause of the "last-core slowdown" problem.  With
this patch, I get much better results with -N8 on an 8-core box,
although some benchmarks are still worse than with 7 cores.

I also added a yieldThread() into the any_work() loop of the parallel
GC when it has no work to do. Oddly, this seems to improve performance
on the parallel GC benchmarks even when all the cores are busy.
Perhaps it is due to reducing contention on the memory bus.

14 years ago'store' should be static (#3835)
Simon Marlow [Fri, 22 Jan 2010 16:48:34 +0000 (16:48 +0000)]
'store' should be static (#3835)

14 years agoAdd some missing getStablePtr()s for CAFs that the RTS refers to
Simon Marlow [Fri, 22 Jan 2010 14:36:58 +0000 (14:36 +0000)]
Add some missing getStablePtr()s for CAFs that the RTS refers to

A recent patch ("Refactor CoreArity a bit") changed the arity of
GHC.Conc.runSparks such that it became a CAF, and the RTS was not
explicitly retaining it, which led to a crash when the CAF got GC'd.
While fixing this I found a couple of other closures that the RTS
refers to which weren't getting the correct CAF treatment.

14 years agoRemove an out-of-date comment
Ian Lynagh [Fri, 22 Jan 2010 13:08:53 +0000 (13:08 +0000)]
Remove an out-of-date comment

14 years agofix build on Windows
Simon Marlow [Fri, 22 Jan 2010 12:10:16 +0000 (12:10 +0000)]
fix build on Windows

14 years agofix warning on Windows
Simon Marlow [Fri, 22 Jan 2010 12:03:28 +0000 (12:03 +0000)]
fix warning on Windows

14 years agoFix docs for sizeofByteArray#/sizeofMutableByteArray# (#3800)
Simon Marlow [Tue, 19 Jan 2010 10:38:25 +0000 (10:38 +0000)]
Fix docs for sizeofByteArray#/sizeofMutableByteArray# (#3800)
In 6.14.1 we'll switch these primops to return the exact byte size,
but for 6.12.2 we need to fix the docs.

14 years agoInclude regex.h in Linker.c on OS X too
Ian Lynagh [Wed, 20 Jan 2010 20:19:58 +0000 (20:19 +0000)]
Include regex.h in Linker.c on OS X too

14 years agoWe no longer need a prototype for __eprintf
Ian Lynagh [Wed, 20 Jan 2010 19:50:24 +0000 (19:50 +0000)]
We no longer need a prototype for __eprintf
It looks like it was only needed on OSX, but it has a prototype in
assert.h which now gets #included.

14 years agoFix build
Ian Lynagh [Wed, 20 Jan 2010 16:31:01 +0000 (16:31 +0000)]
Fix build
Remove a prototype of a function that wasn't defined

14 years agoFIX #2615 (linker scripts in .so files)
howard_b_golden@yahoo.com [Wed, 16 Dec 2009 18:51:55 +0000 (18:51 +0000)]
FIX #2615 (linker scripts in .so files)
This patch does not apply to Windows. It only applies to systems with
ELF binaries.

This is a patch to rts/Linker.c to recognize linker scripts in .so
files and find the real target .so shared library for loading.

14 years agoFix Trac #3813: unused variables in GHCi bindings
simonpj@microsoft.com [Wed, 20 Jan 2010 09:45:33 +0000 (09:45 +0000)]
Fix Trac #3813: unused variables in GHCi bindings

In a GHCi stmt we don't want to report unused variables,
because we don't know the scope of the binding, eg

Prelude> x <- blah

Fixing this needed a little more info about the context of the stmt,
thus the new constructor GhciStmt in the HsStmtContext type.

14 years agoFix Trac #3823, plus warning police in TcRnDriver
simonpj@microsoft.com [Wed, 20 Jan 2010 09:42:21 +0000 (09:42 +0000)]
Fix Trac #3823, plus warning police in TcRnDriver

The immediate reason for this patch is to fix #3823. This was
rather easy: all the work was being done but I was returning
type_env2 rather than type_env3.

An unused-veriable warning would have shown this up, so I fixed all
the other warnings in TcRnDriver.  Doing so showed up at least two
genuine lurking bugs.  Hurrah.

14 years agoChange how RTS libraries get installed; fixes trac #3794
Ian Lynagh [Tue, 19 Jan 2010 23:26:23 +0000 (23:26 +0000)]
Change how RTS libraries get installed; fixes trac #3794