1. 03 Aug, 2000 2 commits
    • simonmar's avatar
      [project @ 2000-08-03 11:28:35 by simonmar] · 66f7a41d
      simonmar authored
      Implement +RTS -C<n>, the context switch interval flag.  This was
      previously advertised in the usage message, but there was a note in
      the Users' Guide stating that it didn't work.  Anwyay, I'm going to
      consider it a bug and backport to 4.08.1.
      66f7a41d
    • simonmar's avatar
      [project @ 2000-08-03 10:19:40 by simonmar] · f151e6c0
      simonmar authored
      Add a cross-ref to the section on Packages from the mention of the
      -package flag in the section on linking.
      f151e6c0
  2. 02 Aug, 2000 6 commits
    • simonmar's avatar
      [project @ 2000-08-02 16:32:51 by simonmar] · f892a421
      simonmar authored
      remove mkdependHS from the list of directories.
      f892a421
    • simonmar's avatar
      [project @ 2000-08-02 15:39:11 by simonmar] · aa282b85
      simonmar authored
      Remove the old mkdependHS cruft.
      aa282b85
    • simonmar's avatar
      [project @ 2000-08-02 15:27:25 by simonmar] · c4afba7e
      simonmar authored
      Assimilate mkdependHS into the driver, obsoleting the old Perl version.
      
      The functionality is pretty much identical, except a few of the flags
      accepted by the old version aren't implemented (--exclude-module,
      --exclude-directory, --include-module).  If anyone needs these
      options, please speak up.
      c4afba7e
    • rrt's avatar
      [project @ 2000-08-02 14:13:26 by rrt] · 567b2505
      rrt authored
      Many fixes to DLLisation. These were previously covered up because code was
      leaking into the import libraries for DLLs, so the fact that some symbols
      were thought of as local rather than in another DLL wasn't a problem.
      
      The main problems addressed by this commit are:
      
      1. Fixes RTS symbols working properly when DLLised. They didn't before.
      2. Uses NULL instead of stg_error_entry, because DLL entry points can't be
         used as static initialisers.
      3. PrelGHC.hi-boot changed to be in package RTS, and export of PrelNum and
         PrelErr moved to PrelBase, so that references to primops & the like
         are cross-DLL as they should be.
      4. Pass imports around as Modules rather than ModuleNames, so that
         ModuleInitLabels can be checked to see if they're in a DLL or not.
      567b2505
    • rrt's avatar
      [project @ 2000-08-02 13:42:32 by rrt] · c0339ba1
      rrt authored
      Now copied from ghc/rts/gmp.h
      c0339ba1
    • rrt's avatar
      [project @ 2000-08-02 13:38:13 by rrt] · 0b0cebed
      rrt authored
      Allow GMP to be compiled as a DLL.
      0b0cebed
  3. 01 Aug, 2000 1 commit
    • simonpj's avatar
      [project @ 2000-08-01 09:08:25 by simonpj] · fe69f3c1
      simonpj authored
      Simon's Marktoberdorf Commits
      
      1.  Tidy up the renaming story for "system binders", such as
      dictionary functions, default methods, constructor workers etc.  These
      are now documented in HsDecls.  The main effect of the change, apart
      from tidying up, is to make the *type-checker* (instead of the
      renamer) generate names for dict-funs and default-methods.  This is
      good because Sergei's generic-class stuff generates new classes at
      typecheck time.
      
      
      2.  Fix the CSE pass so it does not require the no-shadowing invariant.
      Keith discovered that the simplifier occasionally returns a result
      with shadowing.  After much fiddling around (which has improved the
      code in the simplifier a bit) I found that it is nearly impossible to
      arrange that it really does do no-shadowing.  So I gave up and fixed
      the CSE pass (which is the only one to rely on it) instead.
      
      
      3. Fix a performance bug in the simplifier.  The change is in
      SimplUtils.interestingArg.  It computes whether an argment should 
      be considered "interesting"; if a function is applied to an interesting
      argument, we are more likely to inline that function.
      Consider this case
      	let x = 3 in f x
      The 'x' argument was considered "uninteresting" for a silly reason.
      Since x only occurs once, it was unconditionally substituted, but
      interestingArg didn't take account of that case.  Now it does.
      
      I also made interestingArg a bit more liberal.  Let's see if we
      get too much inlining now.
      
      
      4.  In the occurrence analyser, we were choosing a bad loop breaker.
      Here's the comment that's now in OccurAnal.reOrderRec
      
          score ((bndr, rhs), _, _)
      	| exprIsTrivial rhs 	   = 3	-- Practically certain to be inlined
      		-- Used to have also: && not (isExportedId bndr)
      		-- But I found this sometimes cost an extra iteration when we have
      		--	rec { d = (a,b); a = ...df...; b = ...df...; df = d }
      		-- where df is the exported dictionary. Then df makes a really
      		-- bad choice for loop breaker
      
      I also increased the score for bindings with a non-functional type, so that
      dictionaries have a better chance of getting inlined early
      
      
      5. Add a hash code to the InScopeSet (and make it properly abstract)
      This should make uniqAway a lot more robust.  Simple experiments suggest
      that uniqAway no longer gets into the long iteration chains that it used
      to.
      
      
      6.  Fix a bug in the inliner that made the simplifier tend to get into
      a loop where it would keep iterating ("4 iterations, bailing out" message).
      In SimplUtils.mkRhsTyLam we float bindings out past a big lambda, thus:
      	x = /\ b -> let g = \x -> f x x
      		    in E
      becomes
      	g* = /\a -> \x -> f x x
      	x = /\ b -> let g = g* b in E
      	
      It's essential that we don't simply inling g* back into the RHS of g,
      else we will be back to square 1.  The inliner is meant not to do this
      because there's no benefit to the inlining, but the size calculation
      was a little off in CoreUnfold.
      
      
      7.  In SetLevels we were bogus-ly building a Subst with an empty in-scope
      set, so a WARNING popped up when compiling some modules.  (knights/ChessSetList
      was the example that tickled it.)  Now in fact the warning wasn't an error,
      but the Right Thing to do is to carry down a proper Subst in SetLevels, so
      that is what I have now done.  It is very little more expensive.
      fe69f3c1
  4. 31 Jul, 2000 2 commits
  5. 27 Jul, 2000 4 commits
  6. 26 Jul, 2000 6 commits
  7. 25 Jul, 2000 6 commits
    • rrt's avatar
      [project @ 2000-07-25 18:16:53 by rrt] · 3eb5132a
      rrt authored
      Advised Windows users to read the Windows installation notes for GHC before
      trying to build anything.
      3eb5132a
    • rrt's avatar
      [project @ 2000-07-25 18:10:38 by rrt] · 3295b59b
      rrt authored
      Pointed out that Windows users should read the GHC installation guide before
      trying to build anything.
      3295b59b
    • simonmar's avatar
      [project @ 2000-07-25 15:54:38 by simonmar] · 94b2b47a
      simonmar authored
      increase the repeat count; this bug is pretty fragile
      94b2b47a
    • simonmar's avatar
      [project @ 2000-07-25 15:48:16 by simonmar] · 5416852e
      simonmar authored
      Add test for handle finalization bug, fixed in
        1.60      +1 -2      fptools/ghc/lib/std/PrelHandle.lhs
        1.15      +4 -10     fptools/ghc/lib/std/PrelIO.lhs
      5416852e
    • simonmar's avatar
      [project @ 2000-07-25 15:20:10 by simonmar] · 8d2a22ef
      simonmar authored
      Fix bug reported by Hannah Schroeter: reading a file lazily using
      hGetContents and then closing it using hClose can cause the program to
      fall over with a deadlock.
      
      The reason is that when closing the file in lazyRead{Block,Line,Char},
      we set the foreign object in the handle to nullFile__, which causes
      the finalizer to run (at some point in the future).  The finalizer
      takes the MVar in the handle, frees the contents, but never puts the
      MVar back.  hClose then tries to take the MVar, and deadlocks.
      
      The solution is not to set the foreign object to nullFile__ in the
      first place; I'm not sure why it was done this way, and in fact it
      leads to a memory leak.  hClose itself has a similar problem, leading
      to a leak of the fileObject.
      8d2a22ef
    • michaelw's avatar
      [project @ 2000-07-25 12:24:14 by michaelw] · d6e97b4e
      michaelw authored
      giving the version number when asked for is NOT an error, therefore
      output now goes to stdout (cf. Coding Standards)
      d6e97b4e
  8. 24 Jul, 2000 3 commits
    • simonmar's avatar
      [project @ 2000-07-24 15:31:47 by simonmar] · a8e67124
      simonmar authored
      update documentation to reflect changes in the format of a package spec.
      a8e67124
    • simonmar's avatar
      [project @ 2000-07-24 15:16:44 by simonmar] · efc23818
      simonmar authored
      Sigh, change the package definition again.  We weren't making a
      distinction between libraries which need a suffix tag
      (eg. libHSstd_p), and those that don't (eg. libHSstd_cbits).
      
      The package spec now has two components for libraries, hs_libraries
      (tagged) and extra_libraries (untagged).  The ordering of these
      components is important: we specify that hs_libraries are linked
      before extra_libraries.  This sounds problematic if you want to link
      some plain C libraries before some Haskell libs, but in these cases it
      should be possible to create separate packages for the two libs and
      specify the dependencies explicitly.
      efc23818
    • simonmar's avatar
      [project @ 2000-07-24 14:29:55 by simonmar] · 1da7b45d
      simonmar authored
      Some changes to the way FFI decls are handled:
      
        - a foreign export dynamic which returns a newtype of
          an Addr now works correctly.  Similarly for foreign label.
      
        - unlifted types are not allowed in the arguments of a foreign
          export.  Previously we generated incorrect code for these cases.
      
      Newtypes in FFI declarations now work everywhere they should, as far
      as I can see.
      
      These changes will be backported into 4.08.1.
      1da7b45d
  9. 23 Jul, 2000 1 commit
    • panne's avatar
      [project @ 2000-07-23 10:53:11 by panne] · c8a6996a
      panne authored
      Strictfp-like behaviour is the default now, which can be switched off
      via -fexcess-precision. (Has anybody a better name for this option?)
      c8a6996a
  10. 21 Jul, 2000 8 commits
  11. 20 Jul, 2000 1 commit
    • rrt's avatar
      [project @ 2000-07-20 17:06:41 by rrt] · ba5a490c
      rrt authored
      What's the story, Rory?
      
         My name's not Rory. Owing to circumstances not fully understood, the RTS
         used to work DLLized, even though it was largely broken. Unfortunately,
         this was recently fixed.
      
      What used to happen?
      
         The EF_ macro from StgMacros.h was used to refer to primops &c.
      
      Why was this a Bad Thing?
      
         Because you need to use EDF_ when building with DLLs.
      
      What was the result?
      
         primops such as divExactInteger were compiled as _divExactInteger, rather
         than __imp__div_Exact_Integer, so they didn't refer to the DLL routines.
      
      How on earth did it work?
      
         I'm not sure, but somehow the code for the relevant routines got linked
         into the import libraries (e.g. libHSrts_imp.a), and were thus linked
         statically into the final binary.
      
      So that explains why the import libraries (supposedly just containing stubs)
      were larger than the DLLs they were stubbing, or the static libraries, for
      that matter?
      
         Perhaps.
      
      Golly!
      
         Indeed.
      
      What caused this code leakage?
      
         That's what I don't know. Perhaps a bug in the Cygwin DLL-building tools?
         I've upgraded from B20.1 to 1.1 recently.
      
      So, what's the hack, Mac?
      
         My name's not Mac. I added a new macro, ERTSF_, which uses DLL_IMPORT_RTS
         to make sure that the Right Thing is always done (because you mustn't
         make DLL references to RTS routines when compiling the RTS).
      
      Thanks for the chat, Matt!
      
         <punch>
      ba5a490c