1. 25 Apr, 2022 14 commits
    • Bodigrim's avatar
      Document behaviour of RULES with KnownNat · f2c08124
      Bodigrim authored and  Marge Bot's avatar Marge Bot committed
      f2c08124
    • Ben Gamari's avatar
      rts: Improve documentation of closure types · e76705cf
      Ben Gamari authored and  Marge Bot's avatar Marge Bot committed
      Also drops the unused TREC_COMMITTED transaction state.
      e76705cf
    • Ben Gamari's avatar
      rts: Refactor handling of dead threads' stacks · e09afbf2
      Ben Gamari authored and  Marge Bot's avatar Marge Bot committed
      This fixes a bug that @JunmingZhao42 and I noticed while working on her
      MMTK port. Specifically, in stg_stop_thread we used stg_enter_info as a
      sentinel at the tail of a stack after a thread has completed. However,
      stg_enter_info expects to have a two-field payload, which we do not
      push. Consequently, if the GC ends up somehow the stack it will attempt
      to interpret data past the end of the stack as the frame's fields,
      resulting in unsound behavior.
      
      To fix this I eliminate this hacky use of `stg_stop_thread` and instead
      introduce a new stack frame type, `stg_dead_thread_info`. Not only does
      this eliminate the potential for the previously mentioned memory
      unsoundness but it also more clearly captures the intended structure of
      the dead threads' stacks.
      e09afbf2
    • Ben Gamari's avatar
      Drop remaining vestiges of libtool · 41cf758b
      Ben Gamari authored and  Marge Bot's avatar Marge Bot committed
      Drop libtool logic from gen-dll, allowing us to drop the remaining logic
      from the `configure` script.
      
      Strangely, this appears to reliably reduce compiler allocations of
      T16875 on Windows.
      
      Closes #18826.
      
      Metric Decrease:
          T16875
      41cf758b
    • Ben Gamari's avatar
      Drop libtool path from settings file · 9420d26b
      Ben Gamari authored and  Marge Bot's avatar Marge Bot committed
      GHC no longers uses libtool for linking and therefore this is no longer
      necessary.
      9420d26b
    • Ben Gamari's avatar
      Drop dead code in GHC.Linker.Static.linkBinary' · cb71226f
      Ben Gamari authored and  Marge Bot's avatar Marge Bot committed
      Previously we supported building statically-linked executables using
      libtool. However, this was dropped in
      91262e75 in favor of using ar/ranlib
      directly. Consequently we can drop this logic.
      
      Fixes #18826.
      cb71226f
    • Ben Gamari's avatar
      testsuite: Add testcase for #21141 · 9587726f
      Ben Gamari authored and  Marge Bot's avatar Marge Bot committed
      9587726f
    • Ben Gamari's avatar
      Ensure that wired-in exception closures aren't GC'd · e7c4719d
      Ben Gamari authored and  Marge Bot's avatar Marge Bot committed
      As described in Note [Wired-in exceptions are not CAFfy], a small set of
      built-in exception closures get special treatment in the code generator,
      being declared as non-CAFfy despite potentially containing CAF
      references. The original intent of this treatment for the RTS to then
      add StablePtrs for each of the closures, ensuring that they are not
      GC'd. However, this logic was not applied consistently and eventually
      removed entirely in 951c1fb0. This lead to #21141.
      
      Here we fix this bug by reintroducing the StablePtrs and document the
      status quo.
      
      Closes #21141.
      e7c4719d
    • Ben Gamari's avatar
      rts: Factor out built-in GC roots · 9af091f7
      Ben Gamari authored and  Marge Bot's avatar Marge Bot committed
      9af091f7
    • Ben Gamari's avatar
      testsuite: Cabalify ghc-config · 6c7a4913
      Ben Gamari authored and  Marge Bot's avatar Marge Bot committed
      To ensure that the build benefits from Hadrian's usual logic for building
      packages, avoiding #21409.
      
      Closes #21409.
      6c7a4913
    • Ben Gamari's avatar
      testsuite: More robust library way detection · 18e5103f
      Ben Gamari authored and  Marge Bot's avatar Marge Bot committed
      Previously `test.mk` would try to determine whether the dynamic,
      profiling, and vanilla library ways are available by searching for
      `PrimOpWrappers.{,dyn_,p_}hi` in directory reported by `ghc-pkg field
      ghc-prim library-dirs`. However, this is extremely fragile as
      there is no guarantee that there is only one library directory. To
      handle the case of multiple `library-dirs` correct we would
      have to carry out the delicate task of tokenising the directory list (in
      shell, no less).
      
      Since this isn't a task that I am eager to solve, I have rather moved
      the detection logic into the testsuite driver and instead perform a test
      compilation in each of the ways. This should be more robust than the
      previous approach.
      
      I stumbled upon this while fixing #20579.
      18e5103f
    • Ben Gamari's avatar
      hadrian: Clean up handling of libffi dependencies · b2721819
      Ben Gamari authored and  Marge Bot's avatar Marge Bot committed
      b2721819
    • Ben Gamari's avatar
      hadrian: Drop redundant include directories · 53cc93ae
      Ben Gamari authored and  Marge Bot's avatar Marge Bot committed
      The package-specific include directories in
      Settings.Builders.Common.cIncludeDirs are now redundant since they now
      come from Cabal.
      
      Closes #20566.
      53cc93ae
    • Ben Gamari's avatar
      hadrian: Ensure that --extra-lib-dirs are used · 0950e2c4
      Ben Gamari authored and  Marge Bot's avatar Marge Bot committed
      Previously we only took `extraLibDirs` and friends from the package
      description, ignoring any contribution from the `LocalBuildInfo`. Fix
      this.
      
      Fixes #20566.
      0950e2c4
  2. 22 Apr, 2022 16 commits
  3. 21 Apr, 2022 1 commit
  4. 20 Apr, 2022 4 commits
    • Simon Peyton Jones's avatar
      Fix substitution in bindAuxiliaryDict · 0c02c919
      Simon Peyton Jones authored and  Marge Bot's avatar Marge Bot committed
      In GHC.Core.Opt.Specialise.bindAuxiliaryDict we were unnecessarily
      calling `extendInScope` to bring into scope variables that were
      /already/ in scope.  Worse, GHC.Core.Subst.extendInScope strangely
      deleted the newly-in-scope variables from the substitution -- and that
      was fatal in #21391.
      
      I removed the redundant calls to extendInScope.
      
      More ambitiously, I changed GHC.Core.Subst.extendInScope (and cousins)
      to stop deleting variables from the substitution.  I even changed the
      names of the function to extendSubstInScope (and cousins) and audited
      all the calls to check that deleting from the substitution was wrong.
      In fact there are very few such calls, and they are all about
      introducing a fresh non-in-scope variable.  These are "OutIds"; it is
      utterly wrong to mess with the "InId" substitution.
      
      I have not added a Note, because I'm deleting wrong code, and it'd be
      distracting to document a bug.
      0c02c919
    • Andreas Klebinger's avatar
      Fix a shadowing issue in StgUnarise. · 49bd7584
      Andreas Klebinger authored and  Marge Bot's avatar Marge Bot committed
      For I assume performance reasons we don't record no-op replacements
      during unarise. This lead to problems with code like this:
      
          f = \(Eta_B0 :: VoidType) x1 x2 ->
             ... let foo = \(Eta_B0 :: LiftedType) -> g x y Eta_B0
                 in ...
      
      Here we would record the outer Eta_B0 as void rep, but would not
      shadow Eta_B0 inside `foo` because this arg is single-rep and so
      doesn't need to replaced. But this means when looking at occurence
      sites we would check the env and assume it's void rep based on the
      entry we made for the (no longer in scope) outer `Eta_B0`.
      
      Fixes #21396 and the ticket has a few more details.
      49bd7584
    • Krzysztof Gogolewski's avatar
      Remove LevityInfo · a5ea65c9
      Krzysztof Gogolewski authored and  Marge Bot's avatar Marge Bot committed
      Every Id was storing a boolean whether it could be levity-polymorphic.
      This information is no longer needed since representation-checking
      has been moved to the typechecker.
      a5ea65c9
    • Alan Zimmerman's avatar
      Add -dkeep-comments flag to keep comments in the parser · 83c67f76
      Alan Zimmerman authored and  Marge Bot's avatar Marge Bot committed
      This provides a way to set the Opt_KeepRawTokenStream from the command
      line, allowing exact print annotation users to see exactly what is
      produced for a given parsed file, when used in conjunction with
      -ddump-parsed-ast
      
      Discussed in #19706, but this commit does not close the issue.
      83c67f76
  5. 15 Apr, 2022 3 commits
  6. 14 Apr, 2022 2 commits