1. 03 Nov, 2019 23 commits
    • Ryan Scott's avatar
      Reify oversaturated data family instances correctly (#17296) · 9ecf4bb1
      Ryan Scott authored
      `TcSplice` was not properly handling oversaturated data family
      instances, such as the example in #17296, as it dropped arguments due
      to carelessly zipping data family instance arguments with
      `tyConTyVars`. For data families, the number of `tyConTyVars` can
      sometimes be less than the number of arguments it can accept in a
      data family instance due to the fact that data family instances can
      be oversaturated.
      To account for this, `TcSplice.mkIsPolyTvs` has now been renamed to
      `tyConArgsPolyKinded` and now factors in `tyConResKind` in addition
      to `tyConTyVars`. I've also added
      `Note [Reified instances and explicit kind signatures]` which
      explains the various subtleties in play here.
      Fixes #17296.
      (cherry picked from commit e3636a68)
    • Ryan Scott's avatar
      Fix #14579 by defining tyConAppNeedsKindSig, and using it · 963ed692
      Ryan Scott authored
      (cherry picked from commit e88e083d)
    • Ben Gamari's avatar
      configure: Search for LLVM executables with two-number versions · 140f0a74
      Ben Gamari authored
      Fedora uses the naming llc-7.0 while Debian uses llc-7. Ensure that both
      are found.
      Fixes #16990.
      (cherry picked from commit 90bf11c6)
    • Ben Gamari's avatar
      testsuite: Add tests for #16943 · d9e01a96
      Ben Gamari authored
      (cherry picked from commit f1d0e49f)
    • Sam Halliday's avatar
      expose ModuleInfo.minf_rdr_env for tooling authors · 854ce0e5
      Sam Halliday authored
      (cherry picked from commit 993804bf)
    • Andreas Klebinger's avatar
      Fix bounds check in ocResolve_PEi386 for relocation values. · ab65b997
      Andreas Klebinger authored
      The old test was wrong at least for gcc and the value -2287728808L.
      It also relied on implementation defined behaviour (right shift
      on a negative value), which might or might not be ok.
      Either way it's now a simple comparison which will always work.
      (cherry picked from commit abfbdff2)
    • Ben Gamari's avatar
      configure: Don't depend upon alex in source dist build · 996f281c
      Ben Gamari authored
      This fixes #16860 by verifying that the generated sources don't already
      exist before asserting that the `alex` executable was found. This
      replicates the logic already used for `happy` in the case of `alex`.
      (cherry picked from commit 68dc96a0)
    • Ömer Sinan Ağacan's avatar
      Fix new compact block allocation in allocateForCompact · c4cfb707
      Ömer Sinan Ağacan authored
      allocateForCompact() is called when nursery of a compact region is
      full, to add new blocks to the compact. New blocks added to an existing
      region needs a StgCompactNFDataBlock header, not a StgCompactNFData.
      This fixes allocateForCompact() so that it now correctly allocates space
      for StgCompactNFDataBlock instead of StgCompactNFData as before.
      Fixes #17044.
      A regression test T17044 added.
      (cherry picked from commit 981d3b9e)
    • Ben Gamari's avatar
      Exclude rts.cabal from source distributions · 1c33f5d6
      Ben Gamari authored
      This modifies both the Hadrian and make build systems to avoid included
      the rts.cabal generated by autoconf in the source distribution.
      Fixes #17265.
      (cherry picked from commit e81d4bc7)
    • Ben Gamari's avatar
      rules/haddock: Ensure that RTS stats directory exists · c3fd844c
      Ben Gamari authored
      It may not exist if the source tarball was extracted yet not the
      testsuite tarball.
      (cherry picked from commit 624eb0fc)
    • Ben Gamari's avatar
      rts: Fix CNF dirtying logic · 900fce4e
      Ben Gamari authored
      Previously due to a silly implementation bug CNFs would never have their
      dirty flag set, resulting in their being added again and again to the
      `mut_list`. Fix this.
      Fixes #17297.
      (cherry picked from commit ba27fe74)
    • Stefan Schulze Frielinghaus's avatar
      Extend argument of createIOThread to word size · 822a7f4d
      Stefan Schulze Frielinghaus authored
      Function createIOThread expects its second argument to be of size word.
      The natural size of the second parameter is 32bits. Thus for some 64bit
      architectures, where a write of the lower half of a register does not
      clear the upper half, the value must be zero extended.
      (cherry picked from commit d0924b15)
    • Ben Gamari's avatar
      configure: Determine library versions of template-haskell, et al. · 2c0df863
      Ben Gamari authored
      These are needed by the user guide documentation. Fixes #17260.
      (cherry picked from commit 0c53d0aa)
    • Roland Senn's avatar
      New fix for #11647. Avoid side effects like #17171 · 2fe94000
      Roland Senn authored
      If a main module doesn't contain a header, we omit the check whether the main module is exported.
      With this patch GHC, GHCi and runghc use the same code.
      (cherry picked from commit 93f02b62)
    • Ryan Scott's avatar
      Don't skip validity checks for built-in classes (#17355) · 51036008
      Ryan Scott authored
      Issue #17355 occurred because the control flow for
      `TcValidity.check_valid_inst_head` was structured in such a way that
      whenever it checked a special, built-in class (like `Generic` or
      `HasField`), it would skip the most important check of all:
      `checkValidTypePats`, which rejects nonsense like this:
      instance Generic (forall a. a)
      This fixes the issue by carving out `checkValidTypePats` from
      `check_valid_inst_head` so that `checkValidTypePats` is always
      invoked. `check_valid_inst_head` has also been renamed to
      `check_special_inst_head` to reflect its new purpose of _only_
      checking for instances headed by special classes.
      Fixes #17355.
      (cherry picked from commit f375e3fb)
    • Ben Gamari's avatar
      Bump stm submodule · e8175bed
      Ben Gamari authored
      (cherry picked from commit 8b578e72)
    • ryates@cs.rochester.edu's avatar
      Full abort on validate failure merging `orElse`. · 432a270e
      ryates@cs.rochester.edu authored
      Previously partial roll back of a branch of an `orElse` was attempted
      if validation failure was observed.  Validation here, however, does
      not account for what part of the transaction observed inconsistent
      state.  This commit fixes this by fully aborting and restarting the
      (cherry picked from commit 998f2e18)
    • Ben Gamari's avatar
      Drop duplicate -optl's from GHC invocations · 9c7dde7f
      Ben Gamari authored
      Previously the make build system would pass things like
      `-optl-optl-Wl,-x -optl-optl-Wl,noexecstack` to GHC. This would
      naturally result in mass confusion as GHC would pass `-optl-Wl,-x` to
      GCC. GCC would in turn interpret this as `-o ptl-Wl,-x`, setting the
      output pass of the invocation.
      The problem that `-optl` was added to the command-line in two places in
      the build system. Fix this.
      Fixes #17385.
      (cherry picked from commit 2d12d59e)
    • Ben Gamari's avatar
      base: Add @since on GHC.IO.Handle.Lock.hUnlock · 68dc5b0a
      Ben Gamari authored
      Unfortunately this was introduced in base-4.11.0 (GHC 8.4.1)
      whereas the other locking primitives were added in base-4.10.0 (GHC
      (cherry picked from commit 3ad35f76)
    • Roland Senn's avatar
      Fix #14690 - :steplocal panics after break-on-error · 4c376e30
      Roland Senn authored
      `:steplocal` enables only breakpoints in the current top-level binding.
      When a normal breakpoint is hit, then the module name and the break id from the `BRK_FUN` byte code
      allow us to access the corresponding entry in a ModBreak table. From this entry we then get the SrcSpan
      (see compiler/main/InteractiveEval.hs:bindLocalsAtBreakpoint).
      With this source-span we can then determine the current top-level binding, needed for the steplocal command.
      However, if we break at an exception or at an error, we don't have an BRK_FUN byte-code, so we don't have any source information.
      The function `bindLocalsAtBreakpoint` creates an `UnhelpfulSpan`, which doesn't allow us to determine the current top-level binding.
      To avoid a `panic`, we have to check for `UnhelpfulSpan` in the function `ghc/GHCi/UI.hs:stepLocalCmd`.
      Hence a :steplocal command after a break-on-exception or a break-on-error is not possible.
      (cherry picked from commit 1be9c35c)
    • Ben Gamari's avatar
      testsuite: Add test for #17414 · d04492c0
      Ben Gamari authored
      (cherry picked from commit 1ce3d982)
    • Ben Gamari's avatar
      base: Clamp IO operation size to 2GB on Darwin · 176367f8
      Ben Gamari authored
      As reported in #17414, Darwin throws EINVAL in response to large
      (cherry picked from commit 08810f12)
    • Ömer Sinan Ağacan's avatar
      Fix LLVM version check yet again · 061f7f9b
      Ömer Sinan Ağacan authored
      There were two problems with LLVM version checking:
      - The parser would only parse x and x.y formatted versions. E.g. 1.2.3
        would be rejected.
      - The version check was too strict and would reject x.y formatted
        versions. E.g. when we support version 7 it'd reject 7.0 ("LLVM
        version 7.0") and only accept 7 ("LLVM version 7").
      We now parse versions with arbitrarily deep minor numbering (x.y.z.t...)
      and accept versions as long as the major version matches the supported
      version (e.g. 7.1, 7.1.2, ...).
      (cherry picked from commit bf9dfe1c)
  2. 23 Oct, 2019 2 commits
  3. 09 Oct, 2019 1 commit
  4. 26 Aug, 2019 3 commits
  5. 25 Aug, 2019 2 commits
  6. 22 Aug, 2019 1 commit
  7. 21 Aug, 2019 8 commits
    • Ben Gamari's avatar
      gitlab-ci: Bump Docker images revision · 4ffb18ea
      Ben Gamari authored
    • Ben Gamari's avatar
      SetLevels: Don't set context level when floating cases · a2a0e6f3
      Ben Gamari authored
      When floating a single-alternative case we previously would set the
      context level to the level where we were floating the case. However,
      this is not what FloatOut did: it rather left
    • Ben Gamari's avatar
      testsuite: Add cut-down test for #16978 · 6bd8b6d1
      Ben Gamari authored
    • Matthew Pickering's avatar
      rts: Do not traverse nursery for dead closures in LDV profile · edaa5bd8
      Matthew Pickering authored
      It is important that `heapCensus` and `LdvCensusForDead` traverse the
      same areas.
      `heapCensus` increases the `not_used` counter which tracks how many
      closures are live but haven't been used yet.
      `LdvCensusForDead` increases the `void_total` counter which tracks how
      many dead closures there are.
      The `LAG` is then calculated by substracting the `void_total` from
      `not_used` and so it is essential that `not_used >= void_total`. This
      fact is checked by quite a few assertions.
      However, if a program has low maximum residency but allocates a lot in
      the nursery then these assertions were failing (see #16753 and #15903)
      because `LdvCensusForDead` was observing dead closures from the nursery
      which totalled more than the `not_used`. The same closures were not
      counted by `heapCensus`.
      Therefore, it seems that the correct fix is to make `LdvCensusForDead`
      agree with `heapCensus` and not traverse the nursery for dead closures.
      Fixes #16100 #16753 #15903 #8982
      (cherry picked from commit 1dc61c1a)
    • Matthew Pickering's avatar
      rts: Correct assertion in LDV_recordDead · b802a7b2
      Matthew Pickering authored
      It is possible that void_total is exactly equal to not_used and the
      other assertions for this check for <= rather than <.
      (cherry picked from commit a196d9c3)
    • Matthew Pickering's avatar
      rts: Correct handling of LARGE ARR_WORDS in LDV profiler · 11498aeb
      Matthew Pickering authored
      This implements the correct fix for #11627 by skipping over the slop
      (which is zeroed) rather than adding special case logic for LARGE
      ARR_WORDS which runs the risk of not performing a correct census by
      ignoring any subsequent blocks.
      This approach implements similar logic to that in Sanity.c
      (cherry picked from commit 808a87ff)
    • Simon Peyton Jones's avatar
      Fix erroneous float in CoreOpt · 2428986b
      Simon Peyton Jones authored
      The simple optimiser was making an invalid transformation
      to join points -- yikes.  The fix is easy.
      I also added some documentation about the fact that GHC uses
      a slightly more restrictive version of join points than does
      the paper.
      Fix #16918
      (cherry picked from commit d2e290d3)
    • Ömer Sinan Ağacan's avatar
      Minor refactoring in CoreSimpl · 91d12f4e
      Ömer Sinan Ağacan authored
      When `join_ids` is empty `extendVarSetList existing_joins join_ids` is
      already no-op, so no need to check whether `join_ids` is empty or not
      before extending the joins set.
      (cherry picked from commit 897a59a5)