1. 10 Jul, 2015 5 commits
    • Ben Gamari's avatar
      Add testcase for #10602 · 9938a40e
      Ben Gamari authored
    • Ben Gamari's avatar
      Recenter performance numbers · 73105e2f
      Ben Gamari authored
      These are fairly small changes. I'm just going to recenter these and
      then focus on identifying the reason for the drift on master
    • Simon Peyton Jones's avatar
      Add an ambient Id substitution to Subst · 1171d420
      Simon Peyton Jones authored
      After a struggle, I fixed Trac #5113 (again) on the 7.10 branch,
      by adding an ambient substitution to Subst; see CoreSubst,
      esp Note [IdSubstEnv].
      This allowed me to do the impedence-matching in SimplEnv.substExpr
      efficiently (fixing #10370) as well correctly (fixing the latest
      problem with #5113).
      This cost me more time than I like to say.  Sigh.
    • Sergei Trofimovich's avatar
      driver: pass '-fPIC' option to all CC invocations · 0e7e6114
      Sergei Trofimovich authored
      Reported by mitchty:
        When porting ghc to alpine linux (rumors say they build
        all binaries as Position Independent Executables
        to leverage global ASLR) linker issued obscure errors:
      Tiny example:
          $ echo 'main = print "hello"' > a.hs
          $ ghc -fforce-recomp a.hs -fPIC -dynamic -optl-pie -o a
              ld: /tmp/ghc2142_0/ghc2142_5.o: relocation R_X86_64_32 against `ZCMain_main_closure'
                  can not be used when making a shared object; recompile with -fPIC
              /tmp/ghc2142_0/ghc2142_5.o: error adding symbols: Bad value
              collect2: error: ld returned 1 exit status
      There is two entry points in CC driver:
          'runPhase' (CC) and 'mkExtraObj'
      'mkExtraObj' does not handle most of 'runPhase's complexity.
      Ideally it should.
      This patch only adds -fPIC propagation to 'mkExtraObj'.
      Please merge to stable branch.
      Signed-off-by: default avatarSergei Trofimovich <siarheit@google.com>
    • thomie's avatar
      Testsuite: mark T4945 as expect_broken (#4945) · 7fa3b23c
      thomie authored
      In commit 7d519dab, the file
      T4945.stdout was added to the repository, to make T4945 pass
      validatation presumably.
      When that test produces output however, there is a bug somewhere, and we
      shouldn't hide it. There is a comment in the Makefile which says:
          "When SpecConstr works there are no STUArrays at all"
      So here we remove T4945.stdout again, mark T4945 as expect_broken, and
      reopen the ticket.
      Differential Revision: https://phabricator.haskell.org/D976
  2. 07 Jul, 2015 3 commits
  3. 06 Jul, 2015 3 commits
    • Simon Peyton Jones's avatar
      Use lazy substitution in simplCast · 07a1f32e
      Simon Peyton Jones authored
      It turned out that the terrible compiler performance in
      Trac #10527 arose because we were simplifying a function
      argument that subseuqently was discarded, so the work was
      wasted.  Moreover, the work turned out to be substantial;
      indeed it made an asymptotic difference to compile time.
      Ths solution in this 7.10 branch is a bit brutal; just
      duplicate CoreSubst.substExpr to be SimplEnv.substExprS.
      It works fine I'm working on a better solution for HEAD.
    • Gabor Greif's avatar
      Fix typo in error message · df6665e0
      Gabor Greif authored
    • Ben Gamari's avatar
      Specialise: Avoid unnecessary recomputation of free variable information · f7ede672
      Ben Gamari authored
      When examining compile times for code with large ADTs (particularly those with
      many record constructors), I found that the specialiser contributed
      disproportionately to the compiler runtime. Some profiling suggested that
      the a great deal of time was being spent in `pair_fvs` being called from
      @simonpj pointed out that `flattenDictBinds` as called by `specBind` was
      unnecessarily discarding cached free variable information, which then needed to
      be recomputed by `pair_fvs`.
      Here I refactor the specializer to retain the free variable cache whenever
      **Open Qustions**
       * I used `fst` in a couple of places to extract the bindings from a `DictBind`.
         Perhaps this is a sign that `DictBind` has outgrown its type synonym status?
      Test Plan: validate
      Reviewers: austin, simonpj
      Reviewed By: simonpj
      Subscribers: thomie, bgamari, simonpj
      Differential Revision: https://phabricator.haskell.org/D1012
      GHC Trac Issues: #7450
  4. 04 Jul, 2015 1 commit
    • eir@cis.upenn.edu's avatar
      Fix some validation errors. · 93790bbc
      eir@cis.upenn.edu authored
      This fixes test cases T10019 and T10534
      The patch for T10019 should be back-ported to master as well.
      Posting via Phab as a way to distribute a patch against the
      ghc-7.10 branch, which I don't have push access to.
      Test Plan: validate
      Reviewers: austin, bgamari
      Reviewed By: bgamari
      Subscribers: thomie, bgamari, mzero
      Differential Revision: https://phabricator.haskell.org/D1036
  5. 30 Jun, 2015 1 commit
    • Matthew Pickering's avatar
      Correct BangPat SrcSpan calculation · 5560861e
      Matthew Pickering authored
      Previously when the split was performed in splitBang, `BangPat` was given the
      same SrcSpan as the whole of the LHS of the declaration. This patch
      correctly calculates the value.
      Reviewers: alanz, austin
      Reviewed By: alanz, austin
      Subscribers: thomie, bgamari
      Differential Revision: https://phabricator.haskell.org/D1020
      GHC Trac Issues: #10588
      (cherry picked from commit c6bb2fc5)
  6. 28 Jun, 2015 1 commit
  7. 27 Jun, 2015 1 commit
  8. 26 Jun, 2015 5 commits
    • Simon Marlow's avatar
      Fix deadlock (#10545) · a6ef59cd
      Simon Marlow authored
      yieldCapability() was not prepared to be called by a Task that is not
      either a worker or a bound Task.  This could happen if we ended up in
      yieldCapability via this call stack:
      and there were a few other ways this could happen via requestSync.
      The fix is to handle this case in yieldCapability(): when the Task is
      not a worker or a bound Task, we put it on the returning_workers
      queue, where it will be woken up again.
      Summary of changes:
      * `yieldCapability`: factored out subroutine waitForWorkerCapability`
      * `waitForReturnCapability` renamed to `waitForCapability`, and
        factored out subroutine `waitForReturnCapability`
      * `releaseCapabilityAndQueue` worker renamed to `enqueueWorker`, does
        not take a lock and no longer tests if `!isBoundTask()`
      * `yieldCapability` adjusted for refactorings, only change in behavior
        is when it is not a worker or bound task.
      Test Plan:
      * new test concurrent/should_run/performGC
      * validate
    • Simon Marlow's avatar
      Fix for crash in setnumcapabilities001 · 6de9b6eb
      Simon Marlow authored
      getNewNursery() was unconditionally incrementing next_nursery, which
      is normally fine but it broke an assumption in
      storageAddCapabilities().  This manifested as an occasional crash in
      the setnumcapabilities001 test.
      (cherry picked from commit be0ce871)
    • rwbarton's avatar
      Comments only · 0d939ca1
      rwbarton authored
      (cherry picked from commit a7eee0d8)
    • rwbarton's avatar
      Make enum01/enum02/enum03 tests clang-compatible · c6f8d11b
      rwbarton authored
      ... by entirely replacing the use of CPP by a custom preprocessor;
      clang -E -traditional has no stringification mechanism at all.
      Reviewed By: thomie, austin
      Differential Revision: https://phabricator.haskell.org/D957
      GHC Trac Issues: #9399
      (cherry picked from commit b98ca17e)
    • rwbarton's avatar
      Be aware of overlapping global STG registers in CmmSink (#10521) · 7707e54c
      rwbarton authored
      On x86_64, commit e2f6bbd3 assigned
      the STG registers F1 and D1 the same hardware register (xmm1), and
      the same for the registers F2 and D2, etc. When mixing calls to
      functions involving Float#s and Double#s, this can cause wrong Cmm
      optimizations that assume the F1 and D1 registers are independent.
      Reviewers: simonpj, austin
      Reviewed By: austin
      Subscribers: simonpj, thomie, bgamari
      Differential Revision: https://phabricator.haskell.org/D993
      GHC Trac Issues: #10521
      (cherry picked from commit a2f828a3)
  9. 23 Jun, 2015 2 commits
  10. 19 Jun, 2015 1 commit
    • Alan Zimmerman's avatar
      Parser: commas_tup_tail duplicate SrcSpan on "Missing" value · 6520dbfb
      Alan Zimmerman authored
          {-# LANGUAGE TupleSections #-}
          baz = (1, "hello", 6.5,,) 'a' (Just ())
      Results in the following AST fragment
          (L tests/examples/Tuple.hs:3:7-25
                [ L tests/examples/Tuple.hs:3:8
                       (L tests/examples/Tuple.hs:3:8
                                (HsIntegral [ '1' ] 1)
                , L tests/examples/Tuple.hs:3:11-17
                       (L tests/examples/Tuple.hs:3:11-17
                                [ '"'
                                , 'h'
                                , 'e'
                                , 'l'
                                , 'l'
                                , 'o'
                                , '"'
                , L tests/examples/Tuple.hs:3:20-22
                       (L tests/examples/Tuple.hs:3:20-22
                                      [ '6' , '.' , '5' ]
                                      (:% 13 2)))
                , L tests/examples/Tuple.hs:3:24
                    (Missing PlaceHolder)
                , L tests/examples/Tuple.hs:3:24
                    (Missing PlaceHolder)
      The final `Missing PlaceHolder` has a duplicated `SrcSpan`
      Test Plan: ./validate
      Reviewers: austin, hvr, bgamari
      Reviewed By: bgamari
      Subscribers: thomie, bgamari, mpickering
      Differential Revision: https://phabricator.haskell.org/D995
      GHC Trac Issues: #10537
      (cherry picked from commit 72b21c39)
  11. 18 Jun, 2015 2 commits
    • Austin Seipp's avatar
      Revert "Look inside synonyms for foralls when unifying" · 8fb101e4
      Austin Seipp authored
      As discussed in #10194, this patch - while fixing a bug - also causes a
      minor regression when compiling certain in-the-wild programs, meaning
      some extant programs now failed with 7.10.2 RC1. Womp womp.
      This reverts commit 681d82c0.
    • Simon Peyton Jones's avatar
      Care with impossible-cons in combineIdenticalAlts · 558eb050
      Simon Peyton Jones authored
      This was a nasty, long-standing bug exposed in Trac #10538.
      Symptoms were that we had an empty case
         case (x :: Either a) of {}
      Core Lint correctly picked this bogus code up.
      Here is what happened
      * In SimplUtils.prepareAlts, we call
      * We had    case x of { Left _ -> e1; Right _ -> e1 }
      * filterAlts did nothing, but correctly retuned imposs_deflt_cons
        saying that 'x' cannot be {Left, Right} in the DEFAULT branch,
        if any (there isn't one.)
      * combineIdentialAlts correctly combines the identical alts, to give
           case x of { DEFAULT -> e1 }
      * BUT combineIdenticalAlts did no adjust imposs_deft_cons
      * Result: when compiling e1 we did so in the belief that 'x'
        could not be {Left,Right}.  Disaster.
      Easily fixed.
      (It is hard to trigger; I can't construct a simple test case.)
      (cherry picked from commit 023a0ba9)
  12. 17 Jun, 2015 2 commits
    • thomie's avatar
      Fix ghc-pkg reports cache out date (#10205) · 4a87fe4d
      thomie authored
      See Note [writeAtomic leaky abstraction].
      GHC on Linux already received a patch for this bug in
      e0801a0f. On Windows several cabal tests
      were hitting the bug, causing validate failures, but we never noticed
      because of all the other tests that were failing on Windows. And it
      didn't start happening till `getModificationTime` received sub-second
      resolution support on Windows in
      Since there are regression tests already, I am not adding another one.
      But for good measure, here is a script that shows the bug without
      needing to do a full validate run:
        GHC_PKG=ghc-pkg #utils/ghc-pkg/dist/build/tmp/ghc-pkg
        LOCAL_GHC_PKG="${GHC_PKG} --no-user-package-db --global-package-db=${DB}"
        while true; do
          rm -rf ${DB}
          ${LOCAL_GHC_PKG} init "${DB}"
          ${LOCAL_GHC_PKG} list
      If you see "WARNING: cache is out of date" after a few seconds, the bug
      is not fixed.
      Reviewed By: austin
      Differential Revision: https://phabricator.haskell.org/D990
      GHC Trac Issues: #10205
      (cherry picked from commit f0636562)
    • Herbert Valerio Riedel's avatar
      Update Cabal submodule to Cabal-v1.22.4.0 rls tag · 007274e4
      Herbert Valerio Riedel authored
      This only fixes the version number, no code is changed
  13. 16 Jun, 2015 1 commit
  14. 15 Jun, 2015 4 commits
  15. 12 Jun, 2015 8 commits