1. 19 Mar, 2018 4 commits
    • Douglas Wilson's avatar
      rts: Add --internal-counters RTS flag and several counters · 2918abf7
      Douglas Wilson authored
      The existing internal counters:
      * gc_alloc_block_sync
      * whitehole_spin
      * gen[g].sync
      * gen[1].sync
      
      are now not shown in the -s report unless --internal-counters is also passed.
      
      If --internal-counters is passed we now show the counters above, reformatted, as
      well as several other counters. In particular, we now count the yieldThread()
      calls that SpinLocks do as well as their spins.
      
      The added counters are:
      * gc_spin (spin and yield)
      * mut_spin (spin and yield)
      * whitehole_threadPaused (spin only)
      * whitehole_executeMessage (spin only)
      * whitehole_lockClosure (spin only)
      * waitForGcThreadsd (spin and yield)
      
      As well as the following, which are not SpinLock-like things:
      * any_work
      * do_work
      * scav_find_work
      
      See the Note for descriptions of what these counters are.
      
      We add busy_wait_nops in these loops along with the counter increment where it
      was absent.
      
      Old internal counters output:
      ```
      gc_alloc_block_sync: 0
      whitehole_gc_spin: 0
      gen[0].sync: 0
      ...
      2918abf7
    • Mark Karpov's avatar
      Add a build with 32bit Ubuntu container · f9a6d420
      Mark Karpov authored
      f9a6d420
    • Ömer Sinan Ağacan's avatar
      Update test for #5129: · 5a1ad231
      Ömer Sinan Ağacan authored
      Make sure it runs with --fast validate with correct optimisation
      settings (-O1 or above) so that it actually tests the bug.
      
      Because the bug is in the simplifier running it with -O0 doesn't
      test it.
      5a1ad231
    • Simon Peyton Jones's avatar
      Comments and tiny refactor · 2a3702d8
      Simon Peyton Jones authored
      Related to Ryan's upcoming patch for Trac #14933
      2a3702d8
  2. 17 Mar, 2018 2 commits
    • Sergei Trofimovich's avatar
      aclocal.m4: add OSHurd (debian patch) · 0693b0b0
      Sergei Trofimovich authored
      
      
      ghc treats OSUnknown (and GNU/Hurd) as non-ELF target.
      This causes panic in native codegenerator when trying
      to build PIC code:
      
      ```
        ...
        -- all other platforms
        howToAccessLabel dflags _ _ _ _ _
              | not (positionIndependent dflags)
              = AccessDirectly
              | otherwise
              = panic "howToAccessLabel: PIC not defined for this platform"
      ```
      
      This change declares new 'OSHurd' and marks it as an
      ELF target. Fixes building ghc-stage2 on i686-unknown-gnu0.9.
      
      Patch provided by "Pino" via Samuel Thibault and taken from
      debian.
      Signed-off-by: default avatarSergei Trofimovich <slyfox@gentoo.org>
      0693b0b0
    • Sergei Trofimovich's avatar
      aclocal.m4: allow more GNU/Hurd tuples · 1522cf05
      Sergei Trofimovich authored
      
      
      Running plain ./configure fails on hurd because
      ./config.guess reports unrecognised tuple:
          $ ./config.guess
          i686-unknown-gnu0.9
      
      The change makes the following target configure:
      $ ./configure --target=i686-unknown-gnu0.9
      Signed-off-by: default avatarSergei Trofimovich <slyfox@gentoo.org>
      1522cf05
  3. 14 Mar, 2018 1 commit
    • Ömer Sinan Ağacan's avatar
      Slighly improve infix con app pattern errors · cb6d8589
      Ömer Sinan Ağacan authored
      Given this program:
      
          main = do
            f $ do
              a <- return 3
                c <- do
                return 5
      
      GHC previously gave this error message:
      
          Main.hs:2:7: error:
              Parse error in pattern: do a <- return 3 c
              Possibly caused by a missing 'do'?
            |
          2 |   f $ do
            |       ^^...
      
      What happened is GHC considered the whole `f $ do a <- return 3 c` as a
      pattern. When parsed as an expression it becomes an infix application of
      `($)`, and GHC checks left and right hand sides before checking if `($)`
      is a valid infix constructor name, and shows the first error it got.
      
      If instead we first check if the infix op is valid in pattern context,
      the error message becomes much clearer:
      
          Main.hs:2:3: error:
              Parse error in pattern: f $ do a <- return 3 c
              Possibly caused by a missing 'do'?
            |
          2 |   f $ do
            |   ^^^^^^...
      
      This may not entirely fix #11188 but I think it's an improvement.
      
      Reviewers: bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, carter
      
      GHC Trac Issues: #11188
      
      Differential Revision: https://phabricator.haskell.org/D4497
      cb6d8589
  4. 13 Mar, 2018 3 commits
  5. 12 Mar, 2018 2 commits
  6. 10 Mar, 2018 2 commits
  7. 09 Mar, 2018 2 commits
  8. 08 Mar, 2018 11 commits
  9. 07 Mar, 2018 3 commits
  10. 06 Mar, 2018 9 commits
    • Simon Marlow's avatar
      Fix interpreter with profiling · 488d63d6
      Simon Marlow authored
      This was broken by D3746 and/or D3809, but unfortunately we didn't
      notice because CI at the time wasn't building the profiling way.
      
      Test Plan:
      ```
      cd testsuite/test/profiling/should_run
      make WAY=ghci-ext-prof
      ```
      
      Reviewers: bgamari, michalt, hvr, erikd
      
      Subscribers: rwbarton, thomie, carter
      
      GHC Trac Issues: #14705
      
      Differential Revision: https://phabricator.haskell.org/D4437
      488d63d6
    • Ben Gamari's avatar
      Bump nofib submodule · 1488591a
      Ben Gamari authored
      1488591a
    • David Feuer's avatar
      Make accumArray and accum stricter · 08345bd0
      David Feuer authored
      `accumArray` was lazier than documented. `accum` did not have
      documented strictness. The extra laziness allowed thunks to build
      up in the array. Force the results of applying the accumulating
      function to resolve.
      
      Reviewers: hvr, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: alpmestan, rwbarton, thomie, carter
      
      GHC Trac Issues: #14785
      
      Differential Revision: https://phabricator.haskell.org/D4403
      08345bd0
    • Michal Terepeta's avatar
      cmm/: Avoid using lazy left folds · 64c0af75
      Michal Terepeta authored
      
      
      This basically replaces all uses of `foldl` with `foldl'`. I've looked
      at all the call sites and there doesn't seem to be any reason to prefer
      the lazy version.
      Signed-off-by: Michal Terepeta's avatarMichal Terepeta <michal.terepeta@gmail.com>
      
      Test Plan: ./validate
      
      Reviewers: bgamari, simonmar
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D4463
      64c0af75
    • niteria's avatar
      Correct -g flag description · 9bccfcdb
      niteria authored
      Since 7aaeaf81
      `-g1` and `-g2` are actually different.
      The tutorial below is correct.
      
      Test Plan: harbormaster
      
      Reviewers: bgamari, simonmar
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D4471
      9bccfcdb
    • niteria's avatar
      Allow top level ticked string literals · 5bc195a2
      niteria authored
      This reverts f5b275a2
      and changes the places that looked for `Lit (MachStr _))`
      to use `exprIsMbTickedLitString_maybe` to unwrap ticks as
      necessary.
      Also updated relevant comments.
      
      Test Plan:
      I added 3 new tests that previously reproduced.
      GHC HEAD now builds with -g
      
      Reviewers: simonpj, simonmar, bgamari, hvr, goldfire
      
      Subscribers: rwbarton, thomie, carter
      
      GHC Trac Issues: #14779
      
      Differential Revision: https://phabricator.haskell.org/D4470
      5bc195a2
    • Ömer Sinan Ağacan's avatar
      Schedule.c: remove a redundant CPP guard · ee597e9e
      Ömer Sinan Ağacan authored
      (the CPP guard is already wrapped with the same guard in line 1549)
      ee597e9e
    • Moritz Angermann's avatar
      add CCX=$(CXX) to integer-gmp · cf5bc96e
      Moritz Angermann authored
      Summary:
      This came up when trying to build GHC HEAD with nix. We
      do not set CCX for integer-gmp when running ./configure. We do
      this however for libffi.
      
      The result is, that if CCX is not set, we default to the system
      one, of which there might be none (as in nixos's case).  This
      will not show on a debian+nix or similar setup, where the system
      `cxx` is still in place, and only shows up when the system tries
      hard to sandbox everything (even cxx) as nixOS does.
      
      We use `CXX`, which is set to either `clang` or `CC_STAGE1`, and
      also usedfor `CC`, similar to what we do for libffi.c
      
      Test Plan: ./validate
      
      Reviewers: bgamari, hvr
      
      Reviewed By: hvr
      
      Subscribers: rwbarton, thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D4473
      cf5bc96e
    • Moritz Angermann's avatar
      `--via-asm` only for windows targets · f6cf4001
      Moritz Angermann authored
      Reviewers: trofi, bgamari
      
      Reviewed By: trofi, bgamari
      
      Subscribers: rwbarton, thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D4467
      f6cf4001
  11. 05 Mar, 2018 1 commit
    • Herbert Valerio Riedel's avatar
      Fixup include of gmp/config.mk to use new location · df7ac37d
      Herbert Valerio Riedel authored
      This wasn't spotted rightaway in
      8f0b2f5e
      because the include-site deliberately ignored include-errors as
      a Hack with the justification below:
      
      > Hack. The file gmp/config.mk doesn't exist yet after running ./configure in
      > the toplevel (ghc) directory. To let some toplevel make commands such as
      > sdist go through, right after ./configure, don't consider this an error.
      
      This may have contributed to #14891.
      df7ac37d