Skip to content
Snippets Groups Projects
  1. Feb 23, 2020
    • Tamar Christina's avatar
      SysTools: Use "process job" when spawning processes on Windows · d0bab2e3
      Tamar Christina authored and Ben Gamari's avatar Ben Gamari committed
      GHC should make calls using process jobs when calling out to GCC and LD.
      The reason is these use the exec () family of posix functions.  Window's
      process model doesn't allow replacement of processes so this is emulated
      by creating a new process and immediately exiting the old one.  Because
      of this when using normal Windows wait functions you would return even
      without the child process having finished.  In this case if you are
      depending on data from the child you will enter a race condition.
      
      The usual fix for this is to use process jobs and wait for the
      termination of all children that have ever been spawn by the process you
      called. But also waiting for the freeing of all resources.
      
      (cherry picked from commit 584eee71)
  2. Feb 22, 2020
  3. Feb 21, 2020
  4. Feb 18, 2020
  5. Feb 15, 2020
  6. Feb 07, 2020
    • Artem Pelenitsyn's avatar
      Make all submodules have absolute URLs · 20484ae6
      Artem Pelenitsyn authored and Ben Gamari's avatar Ben Gamari committed
      The relative URLs were a workaround to let most contributors fork from
      Github due to a weakness in the haskell.org server.
      
      This workaround is no longer needed. And relative submodule URLs are
      an impediment to forking which makes contributions harder than they
      should be.
      
      The URLs are chosen to clone from https, because this makes sure that
      anybody, even not a registered Gitlab user, can clone a fork
      recursively.
      
      (cherry picked from commit a76b233d)
      20484ae6
  7. Feb 06, 2020
  8. Jan 20, 2020
  9. Jan 17, 2020
    • Ben Gamari's avatar
      Remove GHC_STAGE guards from MachDeps · 0c81de31
      Ben Gamari authored
      This allows the stage1 compiler (which needs to run on the build
      platform and produce code for the host) to depend upon properties of the
      target. This is wrong. However, it's no more wrong than it was
      previously and @Erichson2314 is working on fixing this so I'm going to
      remove the guard so we can finally bootstrap HEAD with ghc-8.8 (see
      issue #17146).
      
      (cherry picked from commit 5f2c49d8)
      0c81de31
  10. Jan 16, 2020
  11. Jan 15, 2020
  12. Jan 09, 2020
  13. Jan 07, 2020
    • Sergei Trofimovich's avatar
      configure.ac: fix '--disable-dwarf-debug' · dfc80021
      Sergei Trofimovich authored and Ben Gamari's avatar Ben Gamari committed
      
      Before the change
          ./configure --disable-dwarf-debug
      enabled DWARF debugging unconditionally.
      
      This happened due to use of 5-argument form of `AC_ARG_ENABLE`
      without actually checking the passed  `$enableval` parameter:
      
      ```
      AC_ARG_ENABLE(dwarf-unwind,
          [AC_HELP_STRING([--enable-dwarf-unwind],
              [Enable DWARF unwinding support in the runtime system via elfutils' libdw [default=no]])],
          [AC_CHECK_LIB(dw, dwfl_attach_state,
            [UseLibdw=YES],
            [AC_MSG_ERROR([Cannot find system libdw (required by --enable-dwarf-unwind)])])]
          [UseLibdw=NO]
      )
      ```
      
      Note:
      
      - `[UseLibdw=NO]` is called when `--{enable,disable}-dwarf-unwind`
        is not passed at all as a parameter (ok).
      - `[AC_CHECK_LIB(dw, dwfl_attach_state, [UseLibdw=YES],` is called
        for both:
      
        * `--enable-dwarf-unwind` being passed: `$enableval = "yes"` (ok).
        *  --disable-dwarf-unwind` being passed: `$enableval = "no"` (bad).
      
      The change is to use 3-argument `AC_ARG_ENABLE` and check for passed
      value as `"$enable_dwarf_unwind" = "yes"`.
      
      Signed-off-by: default avatarSergei Trofimovich <slyfox@gentoo.org>
      (cherry picked from commit cff44d86)
      dfc80021
    • Ben Gamari's avatar
      SysTools: Only apply Windows-specific workaround on Windows · b325d070
      Ben Gamari authored
      Issue #1110 was apparently due to a bug in Vista which prevented GCC
      from finding its binaries unless we explicitly added it to PATH.
      However, this workaround was incorrectly applied on non-Windows
      platforms as well, resulting in ill-formed PATHs (#17266).
      
      Fixes #17266.
      
      (cherry picked from commit 5fe49c6a)
      b325d070
    • Szymon Nowicki-Korgol's avatar
      532c8e71
    • Daniel Gröber (dxld)'s avatar
      rts: Fix -hT option with profiling rts · ba8c86ed
      Daniel Gröber (dxld) authored and Ben Gamari's avatar Ben Gamari committed
      In dumpCensus we switch/case on doHeapProfile twice. The second switch
      tries to barf on unknown doHeapProfile modes but HEAP_BY_CLOSURE_TYPE is
      checked by the first switch and not included in the second.
      
      So when trying to pass -hT to the profiling rts it barfs.
      
      This commit simply merges the two switches into one which fixes this
      problem.
      
      (cherry picked from commit ed662901)
      (cherry picked from commit bd46fbee)
      ba8c86ed
  14. Dec 23, 2019
  15. Dec 17, 2019
  16. Dec 13, 2019
  17. Dec 12, 2019
  18. Dec 11, 2019
  19. Dec 10, 2019
    • Ben Gamari's avatar
      base: Fix incorrect @since in GHC.Natural · 7e7e5a8e
      Ben Gamari authored
      Fixes #17547.
      7e7e5a8e
    • Ömer Sinan Ağacan's avatar
      Fix compacting GC bug when chaining tagged and non-tagged fields together · 815ee4bc
      Ömer Sinan Ağacan authored
      Currently compacting GC has the invariant that in a chain all fields are tagged
      the same. However this does not really hold: root pointers are not tagged, so
      when we thread a root we initialize a chain without a tag. When the pointed
      objects is evaluated and we have more pointers to it from the heap, we then add
      *tagged* fields to the chain (because pointers to it from the heap are tagged),
      ending up chaining fields with different tags (pointers from roots are NOT
      tagged, pointers from heap are). This breaks the invariant and as a result
      compacting GC turns tagged pointers into non-tagged.
      
      This later causes problem in the generated code where we do reads assuming that
      the pointer is aligned, e.g.
      
          0x7(%rax) -- assumes that pointer is tagged 1
      
      which causes misaligned reads. This caused #17088.
      
      We fix this using the "pointer tagging for large families" patch (#14373,
      !1742):
      
      - With the pointer tagging patch the GC can know what the tagged pointer to a
        CONSTR should be (previously we'd need to know the family size -- large
        families are always tagged 1, small families are tagged depending on the
        constructor).
      
      - Since we now know what the tags should be we no longer need to store the
        pointer tag in the info table pointers when forming chains in the compacting
        GC.
      
      As a result we no longer need to tag pointers in chains with 1/2 depending on
      whether the field points to an info table pointer, or to another field: an info
      table pointer is always tagged 0, everything else in the chain is tagged 1. The
      lost tags in pointers can be retrieved by looking at the info table.
      
      Finally, instead of using tag 1 for fields and tag 0 for info table pointers, we
      use two different tags for fields:
      
      - 1 for fields that have untagged pointers
      - 2 for fields that have tagged pointers
      
      When unchaining we then look at the pointer to a field, and depending on its tag
      we either leave a tagged pointer or an untagged pointer in the field.
      
      This allows chaining untagged and tagged fields together in compacting GC.
      
      Fixes #17088
      815ee4bc
    • Ömer Sinan Ağacan's avatar
      Refactor Compact.c: · 9b0348cf
      Ömer Sinan Ağacan authored
      - Remove forward declarations
      - Introduce UNTAG_PTR and GET_PTR_TAG for dealing with pointer tags
        without having to cast arguments to StgClosure*
      - Remove dead code
      - Use W_ instead of StgWord
      - Use P_ instead of StgPtr
      
      (cherry picked from commit b521e8b6)
      9b0348cf
    • Gabor Greif's avatar
      Implement pointer tagging for big families (#14373) · 14cb6472
      Gabor Greif authored
      Formerly we punted on these and evaluated constructors always got a tag
      of 1.
      
      We now cascade switches because we have to check the tag first and when
      it is MAX_PTR_TAG then get the precise tag from the info table and
      switch on that. The only technically tricky part is that the default
      case needs (logical) duplication. To do this we emit an extra label for
      it and branch to that from the second switch. This avoids duplicated
      codegen.
      
      Here's a simple example of the new code gen:
      
          data D = D1 | D2 | D3 | D4 | D5 | D6 | D7 | D8
      
      On a 64-bit system previously all constructors would be tagged 1. With
      the new code gen D7 and D8 are tagged 7:
      
          [Lib.D7_con_entry() {
               ...
               {offset
                 c1eu: // global
                     R1 = R1 + 7;
                     call (P64[Sp])(R1) args: 8, res: 0, upd: 8;
               }
           }]
      
          [Lib.D8_con_entry() {
               ...
               {offset
                 c1ez: // global
                     R1 = R1 + 7;
                     call (P64[Sp])(R1) args: 8, res: 0, upd: 8;
               }
           }]
      
      When switching we now look at the info table only when the tag is 7. For
      example, if we derive Enum for the type above, the Cmm looks like this:
      
          c2Le:
              _s2Js::P64 = R1;
              _c2Lq::P64 = _s2Js::P64 & 7;
              switch [1 .. 7] _c2Lq::P64 {
                  case 1 : goto c2Lk;
                  case 2 : goto c2Ll;
                  case 3 : goto c2Lm;
                  case 4 : goto c2Ln;
                  case 5 : goto c2Lo;
                  case 6 : goto c2Lp;
                  case 7 : goto c2Lj;
              }
      
          // Read info table for tag
          c2Lj:
              _c2Lv::I64 = %MO_UU_Conv_W32_W64(I32[I64[_s2Js::P64 & (-8)] - 4]);
              if (_c2Lv::I64 != 6) goto c2Lu; else goto c2Lt;
      
      Generated Cmm sizes do not change too much, but binaries are very
      slightly larger, due to the fact that the new instructions are longer in
      encoded form. E.g. previously entry code for D8 above would be
      
          00000000000001c0 <Lib_D8_con_info>:
           1c0:	48 ff c3             	inc    %rbx
           1c3:	ff 65 00             	jmpq   *0x0(%rbp)
      
      With this patch
      
          00000000000001d0 <Lib_D8_con_info>:
           1d0:	48 83 c3 07          	add    $0x7,%rbx
           1d4:	ff 65 00             	jmpq   *0x0(%rbp)
      
      This is one byte longer.
      
      Secondly, reading info table directly and then switching is shorter
      
          _c1co:
                  movq -1(%rbx),%rax
                  movl -4(%rax),%eax
                  // Switch on info table tag
                  jmp *_n1d5(,%rax,8)
      
      than doing the same switch, and then for the tag 7 doing another switch:
      
          // When tag is 7
          _c1ct:
                  andq $-8,%rbx
                  movq (%rbx),%rax
                  movl -4(%rax),%eax
                  // Switch on info table tag
                  ...
      
      Some changes of binary sizes in actual programs:
      
      - In NoFib the worst case is 0.1% increase in benchmark "parser" (see
        NoFib results below). All programs get slightly larger.
      
      - Stage 2 compiler size does not change.
      
      - In "containers" (the library) size of all object files increases
        0.0005%. Size of the test program "bitqueue-properties" increases
        0.03%.
      
      nofib benchmarks kindly provided by Ömer (@osa1):
      
      NoFib Results
      =============
      
      --------------------------------------------------------------------------------
              Program           Size    Allocs    Instrs     Reads    Writes
      --------------------------------------------------------------------------------
                   CS          +0.0%      0.0%     -0.0%     -0.0%     -0.0%
                  CSD          +0.0%      0.0%      0.0%     +0.0%     +0.0%
                   FS          +0.0%      0.0%      0.0%     +0.0%      0.0%
                    S          +0.0%      0.0%     -0.0%      0.0%      0.0%
                   VS          +0.0%      0.0%     -0.0%     +0.0%     +0.0%
                  VSD          +0.0%      0.0%     -0.0%     +0.0%     -0.0%
                  VSM          +0.0%      0.0%      0.0%      0.0%      0.0%
                 anna          +0.0%      0.0%     +0.1%     -0.9%     -0.0%
                 ansi          +0.0%      0.0%     -0.0%     +0.0%     +0.0%
                 atom          +0.0%      0.0%      0.0%      0.0%      0.0%
               awards          +0.0%      0.0%     -0.0%     +0.0%      0.0%
               banner          +0.0%      0.0%     -0.0%     +0.0%      0.0%
           bernouilli          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
         binary-trees          +0.0%      0.0%     -0.0%     -0.0%     -0.0%
                boyer          +0.0%      0.0%     +0.0%      0.0%     -0.0%
               boyer2          +0.0%      0.0%     +0.0%      0.0%     -0.0%
                 bspt          +0.0%      0.0%     +0.0%     +0.0%      0.0%
            cacheprof          +0.0%      0.0%     +0.1%     -0.8%      0.0%
             calendar          +0.0%      0.0%     -0.0%     +0.0%     -0.0%
             cichelli          +0.0%      0.0%     +0.0%      0.0%      0.0%
              circsim          +0.0%      0.0%     -0.0%     -0.1%     -0.0%
             clausify          +0.0%      0.0%     +0.0%     +0.0%      0.0%
        comp_lab_zift          +0.0%      0.0%     +0.0%      0.0%     -0.0%
             compress          +0.0%      0.0%     +0.0%     +0.0%      0.0%
            compress2          +0.0%      0.0%      0.0%      0.0%      0.0%
          constraints          +0.0%      0.0%     -0.0%     -0.0%     -0.0%
         cryptarithm1          +0.0%      0.0%     +0.0%      0.0%      0.0%
         cryptarithm2          +0.0%      0.0%     +0.0%     -0.0%      0.0%
                  cse          +0.0%      0.0%     +0.0%     +0.0%      0.0%
         digits-of-e1          +0.0%      0.0%     -0.0%     -0.0%     -0.0%
         digits-of-e2          +0.0%      0.0%     +0.0%     -0.0%     -0.0%
               dom-lt          +0.0%      0.0%     +0.0%     +0.0%      0.0%
                eliza          +0.0%      0.0%     -0.0%     +0.0%      0.0%
                event          +0.0%      0.0%     -0.0%     -0.0%     -0.0%
          exact-reals          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
               exp3_8          +0.0%      0.0%     -0.0%     -0.0%     -0.0%
               expert          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
       fannkuch-redux          +0.0%      0.0%     +0.0%      0.0%      0.0%
                fasta          +0.0%      0.0%     -0.0%     -0.0%     -0.0%
                  fem          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
                  fft          +0.0%      0.0%     +0.0%     -0.0%     -0.0%
                 fft2          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
             fibheaps          +0.0%      0.0%     +0.0%     +0.0%      0.0%
                 fish          +0.0%      0.0%     +0.0%     +0.0%      0.0%
                fluid          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
               fulsom          +0.0%      0.0%     +0.0%     -0.0%     +0.0%
               gamteb          +0.0%      0.0%     +0.0%     -0.0%     -0.0%
                  gcd          +0.0%      0.0%     +0.0%     +0.0%      0.0%
          gen_regexps          +0.0%      0.0%     +0.0%     -0.0%     -0.0%
               genfft          +0.0%      0.0%     -0.0%     -0.0%     -0.0%
                   gg          +0.0%      0.0%      0.0%     -0.0%      0.0%
                 grep          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
               hidden          +0.0%      0.0%     +0.0%     -0.0%     -0.0%
                  hpg          +0.0%      0.0%     +0.0%     -0.1%     -0.0%
                  ida          +0.0%      0.0%     +0.0%     -0.0%     -0.0%
                infer          +0.0%      0.0%     -0.0%     -0.0%     -0.0%
              integer          +0.0%      0.0%     -0.0%     -0.0%     -0.0%
            integrate          +0.0%      0.0%      0.0%     +0.0%      0.0%
         k-nucleotide          +0.0%      0.0%     -0.0%     -0.0%     -0.0%
                kahan          +0.0%      0.0%     -0.0%     -0.0%     -0.0%
              knights          +0.0%      0.0%     +0.0%     -0.0%     -0.0%
               lambda          +0.0%      0.0%     +1.2%     -6.1%     -0.0%
           last-piece          +0.0%      0.0%     +0.0%     -0.0%     -0.0%
                 lcss          +0.0%      0.0%     +0.0%     -0.0%     -0.0%
                 life          +0.0%      0.0%     +0.0%     -0.0%     -0.0%
                 lift          +0.0%      0.0%     +0.0%     +0.0%      0.0%
               linear          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
            listcompr          +0.0%      0.0%     -0.0%     -0.0%     -0.0%
             listcopy          +0.0%      0.0%     -0.0%     -0.0%     -0.0%
             maillist          +0.0%      0.0%     +0.0%     -0.0%     -0.0%
               mandel          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
              mandel2          +0.0%      0.0%     +0.0%     +0.0%     -0.0%
                 mate          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
              minimax          +0.0%      0.0%     -0.0%     +0.0%     -0.0%
              mkhprog          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
           multiplier          +0.0%      0.0%      0.0%     +0.0%     -0.0%
               n-body          +0.0%      0.0%     +0.0%     -0.0%     -0.0%
             nucleic2          +0.0%      0.0%     +0.0%     +0.0%     -0.0%
                 para          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
            paraffins          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
               parser          +0.1%      0.0%     +0.4%     -1.7%     -0.0%
              parstof          +0.0%      0.0%     -0.0%     -0.0%     -0.0%
                  pic          +0.0%      0.0%     +0.0%      0.0%     -0.0%
             pidigits          +0.0%      0.0%     -0.0%     -0.0%     -0.0%
                power          +0.0%      0.0%     +0.0%     -0.0%     -0.0%
               pretty          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
               primes          +0.0%      0.0%     +0.0%      0.0%      0.0%
            primetest          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
               prolog          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
               puzzle          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
               queens          +0.0%      0.0%      0.0%     +0.0%     +0.0%
              reptile          +0.0%      0.0%     +0.0%     +0.0%      0.0%
      reverse-complem          +0.0%      0.0%     -0.0%     -0.0%     -0.0%
              rewrite          +0.0%      0.0%     +0.0%      0.0%     -0.0%
                 rfib          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
                  rsa          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
                  scc          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
                sched          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
                  scs          +0.0%      0.0%     +0.0%     +0.0%      0.0%
               simple          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
                solid          +0.0%      0.0%     +0.0%     +0.0%      0.0%
              sorting          +0.0%      0.0%     +0.0%     -0.0%      0.0%
        spectral-norm          +0.0%      0.0%     -0.0%     -0.0%     -0.0%
               sphere          +0.0%      0.0%     +0.0%     -1.0%      0.0%
               symalg          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
                  tak          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
            transform          +0.0%      0.0%     +0.4%     -1.3%     +0.0%
             treejoin          +0.0%      0.0%     +0.0%     -0.0%      0.0%
            typecheck          +0.0%      0.0%     -0.0%     +0.0%      0.0%
              veritas          +0.0%      0.0%     +0.0%     -0.1%     +0.0%
                 wang          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
            wave4main          +0.0%      0.0%     +0.0%      0.0%     -0.0%
         wheel-sieve1          +0.0%      0.0%     +0.0%     +0.0%     +0.0%
         wheel-sieve2          +0.0%      0.0%     +0.0%     +0.0%      0.0%
                 x2n1          +0.0%      0.0%     +0.0%     +0.0%      0.0%
      --------------------------------------------------------------------------------
                  Min          +0.0%      0.0%     -0.0%     -6.1%     -0.0%
                  Max          +0.1%      0.0%     +1.2%     +0.0%     +0.0%
       Geometric Mean          +0.0%     -0.0%     +0.0%     -0.1%     -0.0%
      
      NoFib GC Results
      ================
      
      --------------------------------------------------------------------------------
              Program           Size    Allocs    Instrs     Reads    Writes
      --------------------------------------------------------------------------------
              circsim          +0.0%      0.0%     -0.0%     -0.0%     -0.0%
          constraints          +0.0%      0.0%     -0.0%      0.0%     -0.0%
             fibheaps          +0.0%      0.0%      0.0%     -0.0%     -0.0%
               fulsom          +0.0%      0.0%      0.0%     -0.6%     -0.0%
             gc_bench          +0.0%      0.0%      0.0%      0.0%     -0.0%
                 hash          +0.0%      0.0%     -0.0%     -0.0%     -0.0%
                 lcss          +0.0%      0.0%      0.0%     -0.0%      0.0%
            mutstore1          +0.0%      0.0%      0.0%     -0.0%     -0.0%
            mutstore2          +0.0%      0.0%     +0.0%     -0.0%     -0.0%
                power          +0.0%      0.0%     -0.0%      0.0%     -0.0%
           spellcheck          +0.0%      0.0%     -0.0%     -0.0%     -0.0%
      --------------------------------------------------------------------------------
                  Min          +0.0%      0.0%     -0.0%     -0.6%     -0.0%
                  Max          +0.0%      0.0%     +0.0%      0.0%      0.0%
       Geometric Mean          +0.0%     +0.0%     +0.0%     -0.1%     +0.0%
      
      Fixes #14373
      
      These performance regressions appear to be a fluke in CI. See the
      discussion in !1742 for details.
      
      Metric Increase:
          T6048
          T12234
          T12425
          Naperian
          T12150
          T5837
          T13035
      14cb6472
    • Ben Gamari's avatar
      Add 8.8.2 release notes · 8effe99b
      Ben Gamari authored
      8effe99b
    • Ben Gamari's avatar
      Colorize changelog check · 07de674a
      Ben Gamari authored
      07de674a
    • Ben Gamari's avatar
      gitlab-ci: Move changelog linting logic to shell script · 9ed95740
      Ben Gamari authored
      Allowing it to be easily used locally.
      9ed95740
    • Oleg Grenrus's avatar
      Advance Cabal to 3.0.1.0-rc1 tag · 2037e286
      Oleg Grenrus authored and Ben Gamari's avatar Ben Gamari committed
      2037e286
  20. Dec 06, 2019
Loading