1. 19 Mar, 2018 5 commits
    • Matthew Pickering's avatar
      Also check local rules with -frules-check · 3d378d98
      Matthew Pickering authored
      Reviewers: bgamari
      Reviewed By: bgamari
      Subscribers: rwbarton, thomie, carter
      Differential Revision: https://phabricator.haskell.org/D4255
    • 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
      gen[1].sync: 0
      New internal counters output:
      Internal Counters:
                                                 Spins        Yields
          gc_alloc_block_sync                      323             0
          gc_spin                              9016713           752
          mut_spin                            57360944         47716
          whitehole_gc                               0           n/a
          whitehole_threadPaused                     0           n/a
          whitehole_executeMessage                   0           n/a
          whitehole_lockClosure                      0             0
          waitForGcThreads                           2           415
          gen[0].sync                                6             0
          gen[1].sync                                1             0
          any_work                                2017
          no_work                                 2014
          scav_find_work                          1004
      Test Plan:
      Check it builds with #define PROF_SPIN removed from includes/rts/Config.h
      Reviewers: bgamari, erikd, simonmar, hvr
      Reviewed By: simonmar
      Subscribers: rwbarton, thomie, carter
      GHC Trac Issues: #3553, #9221
      Differential Revision: https://phabricator.haskell.org/D4302
    • Mark Karpov's avatar
      Add a build with 32bit Ubuntu container · f9a6d420
      Mark Karpov authored
    • Ö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.
    • Simon Peyton Jones's avatar
      Comments and tiny refactor · 2a3702d8
      Simon Peyton Jones authored
      Related to Ryan's upcoming patch for Trac #14933
  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
      Signed-off-by: default avatarSergei Trofimovich <slyfox@gentoo.org>
    • 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
      The change makes the following target configure:
      $ ./configure --target=i686-unknown-gnu0.9
      Signed-off-by: default avatarSergei Trofimovich <slyfox@gentoo.org>
  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
  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
    • Ben Gamari's avatar
      Bump nofib submodule · 1488591a
      Ben Gamari authored
    • 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
    • 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
    • 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
    • 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
      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
    • Ö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)
    • Moritz Angermann's avatar
      add CCX=$(CXX) to integer-gmp · cf5bc96e
      Moritz Angermann authored
      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
    • 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