1. 18 Dec, 2016 4 commits
  2. 17 Dec, 2016 16 commits
    • siddhanathan's avatar
      Docs: Delete duplicate paragraph in user guide · e0fe7c31
      siddhanathan authored
      Removes duplicate paragraph in user guide. The same paragraph is
      repeated below this one.
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2874
      e0fe7c31
    • Rufflewind's avatar
      Improve StringBuffer and FastString docs · 21dde812
      Rufflewind authored
      This area of code contains a lot of unsafe functionality, so it might be
      worth documenting to reduce the risk of misuse.
      
      Test Plan: inspection
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2872
      21dde812
    • Simon Marlow's avatar
      Run some tests with -fexternal-interpreter -prof · 90cfa849
      Simon Marlow authored
      We don't have any other tests for this, except one Template Haskell
      test.  This would have caught the bug I just fixed in D2868, at least
      when validating with profiling on.
      
      Test Plan: Ran tests
      
      Reviewers: niteria, austin, erikd, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2869
      
      GHC Trac Issues: #5654
      90cfa849
    • Simon Marlow's avatar
      Fix bug in previous fix for #5654 · 2a02040b
      Simon Marlow authored
      I forgot to account for BCOs, which have a different layout from
      functions.  This caused crashes when using profiling with GHCi (via
      -fexternal-interpreter -prof), which unfortunately is not tested at all
      by validate, even when profiling is enabled.  I'm going to add some
      testing that would have caught this in a separate patch.
      
      Test Plan:
      ```
      cd nofib/spectral/puzzle && make NoFibWithGHCi=YES
      EXTRA_RUNTEST_OPTS='-fexternal-interpreter -prof'
      ```
      New testsuite tests coming in a separate diff.
      
      Reviewers: niteria, austin, erikd, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2868
      
      GHC Trac Issues: #5654
      2a02040b
    • Ryan Scott's avatar
      Reexport Language.Haskell.TH.Lib from Language.Haskell.TH · 343b1473
      Ryan Scott authored
      Reexporting `Language.Haskell.TH.Lib` from `Language.Haskell.TH` ensures
      that `Language.Haskell.TH` will continue to expose all of the functions
      that `Language.Haskell.TH.Lib` does in the future.
      
      Fixes #12992.
      
      Test Plan: ./validate
      
      Reviewers: austin, bgamari, goldfire
      
      Reviewed By: bgamari, goldfire
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2867
      
      GHC Trac Issues: #12992
      343b1473
    • Ben Gamari's avatar
      rts/win32/IOManager: Fix integer types · 2d1beb1e
      Ben Gamari authored
      This code has been broken on 64-bit systems for some time: the length
      and timeout arguments of `addIORequest` and `addDelayRequest`,
      respectively, were declared as `int`. However, they were passed Haskell
      integers from their respective primops. Integer overflow and madness
      ensued. This resulted in #7325 and who knows what else.
      
      Also, there were a few left-over `BOOL`s in here which were not passed
      to Windows system calls; these were changed to C99 `bool`s.
      
      However, there is still a bit of signedness inconsistency within the
      `delay#` call-chain,
      
       * `GHC.Conc.IO.threadDelay` and the `delay#` primop accept `Int`
         arguments
      
       * The `delay#` implementation in `PrimOps.cmm` expects the timeout as
         a `W_`
      
       * `AsyncIO.c:addDelayRequest` expects an `HsInt` (was `int` prior to
         this patch)
      
       * `IOManager.c:AddDelayRequest` expects an `HsInt`` (was `int`)
      
       * The Windows `Sleep` function expects a `DWORD` (which is unsigned)
      
      Test Plan: Validate on Windows
      
      Reviewers: erikd, austin, simonmar, Phyx
      
      Reviewed By: Phyx
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2861
      
      GHC Trac Issues: #7325
      2d1beb1e
    • Rufflewind's avatar
      Windows: Improve terminal detection mechanism · 3dbd2b09
      Rufflewind authored
      The previous detection mechanism allowed environment variables (ANSICON,
      ConEmuANSI, TERM) to supersede the fact that the stderr is not a
      terminal, which is probably what led to color codes appearing in the
      stderr of the tests (see: 847d2293).
      
      This commit changes the detection mechanism to detect Cygwin/MSYS2
      terminals in a more reliable manner, avoiding the use of environment
      variables entirely.
      
      Test Plan: validate
      
      Reviewers: Phyx, austin, erikd, bgamari
      
      Reviewed By: Phyx, bgamari
      
      Subscribers: RyanGlScott, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2809
      3dbd2b09
    • eir@cis.upenn.edu's avatar
      Reshuffle levity polymorphism checks. · 8906e7b7
      eir@cis.upenn.edu authored
      Previously, GHC checked for bad levity polymorphism to the left of all
      arrows in data constructors. This was wrong, as reported in #12911
      (where an example is also shown). The solution is to check each
      individual argument for bad levity polymorphism.  Thus the check has
      been moved from TcValidity to TcTyClsDecls.
      
      A similar situation exists with pattern synonyms, also fixed here.
      
      This patch also nabs #12819 while I was in town.
      
      Test cases: typecheck/should_compile/T12911, patsyn/should_fail/T12819
      
      Test Plan: ./validate
      
      Reviewers: simonpj, austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2783
      
      GHC Trac Issues: #12819, #12911
      8906e7b7
    • Sergei Trofimovich's avatar
      utils/genargs: delete unused tool · 6c816c56
      Sergei Trofimovich authored
      The tool was added in 2003 but never used at least in ghc tree.
      Signed-off-by: default avatarSergei Trofimovich <siarheit@google.com>
      6c816c56
    • Sergei Trofimovich's avatar
      fix OpenBSD linkage (wxneeded) · 87c3b1d4
      Sergei Trofimovich authored
      There is two types of options passed directly to 'ld'
      (and not to 'gcc' driver):
          - CONF_LD_LINKER_OPTS_STAGE$4
          - EXTRA_LD_OPTS
      
      This changedoes two things:
      
      - split 'EXTRA_LD_OPTS' into two variables:
          - EXTRA_LD_OPTS (accepts 'gcc' wrapper options)
          - EXTRA_LD_LINKER_OPTS (accepts raw 'ld' options)
      
      - wraps all LD_LINKER options as '-Wl,' when passed
        to 'gcc' driver.
      
      Fixes https://phabricator.haskell.org/D2776Signed-off-by: default avatarSergei Trofimovich <siarheit@google.com>
      87c3b1d4
    • Ben Gamari's avatar
      Revert "Do not init record accessors as exported" · 0af959b1
      Ben Gamari authored
      This reverts commit 3a00ff92 due
      to #12993
      0af959b1
    • Tamar Christina's avatar
      Fix Pretty printer tests on Windows · d88efb70
      Tamar Christina authored
      Summary:
      D2752 added some tests which escapes string literals. This means newlines are converted
      before they get normalized by the IO functions. So on Windows \r\n would be in the output
      while \n was expected.
      
      Test Plan: make test -C testsuite/tests/printer
      
      Reviewers: austin, bgamari, alanz
      
      Reviewed By: alanz
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2873
      
      GHC Trac Issues: #3384
      d88efb70
    • Sergei Trofimovich's avatar
      rts/Compact.cmm: fix UNREG build failure · c4808602
      Sergei Trofimovich authored
      The change does the following:
      - Add explicit declaration of exception closures
        from base. C backend needs those symbols to be
        visible.
      - Reorder cmm functions in use order. Again C
        backend needs symbol declaration/definition
        before use. even for module-local cmm functions.
      
      Fixes the following build failure:
      
        rts_dist_HC rts/dist/build/Compact.o
          In file included from /tmp/ghc3348_0/ghc_4.hc:3:0: error:
          /tmp/ghc3348_0/ghc_4.hc: In function 'stg_compactAddWithSharingzh':
      
          /tmp/ghc3348_0/ghc_4.hc:27:11: error:
           error: 'stg_compactAddWorkerzh' undeclared (first use in this function)
           JMP_((W_)&stg_compactAddWorkerzh);
                     ^
          ...
          /tmp/ghc3348_0/ghc_4.hc:230:13: error:
           error: 'base_GHCziIOziException_cannotCompactMutable_closure'
           undeclared (first use in this function)
           R1.w = (W_)&base_GHCziIOziException_cannotCompactMutable_closure;
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      Signed-off-by: default avatarSergei Trofimovich <siarheit@google.com>
      c4808602
    • Sergei Trofimovich's avatar
      revert '-Wl' prefixing to *_LD_OPTS · a6657bd0
      Sergei Trofimovich authored
      This reverts f48f5a9e
      
      The prefixing does not work as comma
      is stripped by $(addprefix) macro:
      
      The following call
          $$(addprefix -optl-Wl, $$($1_$2_$3_ALL_LD_OPTS))
      
      prefixes options with "-optl-Wl" not with "-optl-Wl,"
      
      The simplest breakage can be seen by adding
          SRC_LD_OPTS += -O1
      to mk/build.mk:
      
        <no location info>: error:
          Warning: Couldn't figure out linker information!
                   Make sure you're using GNU ld, GNU gold
                   or the built in OS X linker, etc.
        gcc: error: unrecognized command line option '-Wl-O1'
      
      Another problem with original change is loss of ability
      to pass options to gcc as a linker driver, for example:
          SRC_LD_OPTS += -flto
      Signed-off-by: default avatarSergei Trofimovich <siarheit@google.com>
      a6657bd0
    • Sergei Trofimovich's avatar
      UNREG: include CCS_OVERHEAD to STG · 2fa00f5b
      Sergei Trofimovich authored
      Commit 394231b3 aded
      CCS_OVERHEAD annotation to 'rts/Apply.cmm'.
      
      Before the change CCS_OVERHEAD was used only in C code.
      
      The change exports CCS_OVERHEAD to STG.
      
      Fixes UNREG build failure:
        rts_dist_HC rts/dist/build/Apply.p_o
          /tmp/ghc29563_0/ghc_4.hc: In function 'cm_entry':
      
          /tmp/ghc29563_0/ghc_4.hc:73:13: error:
           error: 'CCS_OVERHEAD' undeclared (first use in this function)
           *((P_)((W_)&CCS_OVERHEAD+72)) = ...
                       ^~~~~~~~~~~~
      Signed-off-by: default avatarSergei Trofimovich <siarheit@google.com>
      2fa00f5b
    • Ben Gamari's avatar
      testsuite: Add test for #12993 · c8ed1bdc
      Ben Gamari authored
      c8ed1bdc
  3. 16 Dec, 2016 9 commits
  4. 15 Dec, 2016 11 commits
    • Ben Gamari's avatar
      UniqSupply: Use full range of machine word · 0d213c18
      Ben Gamari authored
      Currently uniques are 32-bits wide. 8 of these bits are for the unique
      class, leaving only 24 for the unique number itself. This seems
      dangerously small for a large project. Let's use the full range of the
      native machine word.
      
      We also add (now largely unnecessary) overflow check to ensure that the
      unique number doesn't overflow.
      
      Test Plan: Validate
      
      Reviewers: simonmar, austin, niteria
      
      Reviewed By: niteria
      
      Subscribers: mpickering, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2844
      
      GHC Trac Issues: #12944
      0d213c18
    • Ben Gamari's avatar
      array: Check for integer overflow during allocation · cd4b202f
      Ben Gamari authored
      This fixes #229, where creating a new array can cause array to allocate
      a smaller array than it thinks it allocates due to integer overflow,
      resulting in memory unsafety.
      
      This breaks the rts/overflow1 test, which relied on this unchecked
      overflow. I fix it by reimplementing the test in terms of newByteArray#
      directly.
      
      Updates the array submodule.
      cd4b202f
    • Ben Gamari's avatar
      testsuite: Add test for #12966 · 81c49562
      Ben Gamari authored
      This isn't exactly a typechecker test, but it was the most appropriate
      directory I could think of. The issue being tested is fixed.
      
      Test Plan: Validate
      
      Reviewers: austin
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2857
      
      GHC Trac Issues: #12966
      81c49562
    • Ben Gamari's avatar
      testsuite: Mark T10294 as fixed · 0cad52d6
      Ben Gamari authored
      It seems that c3c70244 resolved #10301.
      It took a while to notice this since it only broke when tested against a
      statically linked GHC, a configuration which Harbormaster doesn't test.
      
      Test Plan: Validate
      
      Reviewers: angerman, austin
      
      Subscribers: thomie, nomeata
      
      Differential Revision: https://phabricator.haskell.org/D2856
      
      GHC Trac Issues: #10294, #10301
      0cad52d6
    • Ben Gamari's avatar
      testsuite: Add test for #12971 · 8f0546bf
      Ben Gamari authored
      Test Plan: Validate
      
      Reviewers: austin
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2855
      
      GHC Trac Issues: #12971
      8f0546bf
    • Ben Gamari's avatar
      base: Bump version to 4.10.0.0 · 4d683fa1
      Ben Gamari authored
      Updates a number of submodules.
      4d683fa1
    • Ben Gamari's avatar
      testsuite: Separate out Windows results for T5205 · d3981628
      Ben Gamari authored
      This test seems to have much different allocation behavior on Windows
      and Linux.  Previously we had widened the acceptance window to 7% to
      accomodate this, but even this isn't enough any more. Instead of further
      widening the window let's just give an expected number for each
      platform. Really, this is precisely the issue with our performance
      testing model which I've been complaining about in #12758.
      
      Fixes test for #5205 on 64-bit Windows.
      
      Test Plan: Validate on Windows
      
      Reviewers: austin
      
      Subscribers: thomie, Phyx
      
      Differential Revision: https://phabricator.haskell.org/D2848
      
      GHC Trac Issues: #5205
      d3981628
    • Ryan Scott's avatar
      Warn about missing instance methods that start with an underscore · 503219e3
      Ryan Scott authored
      Previously, GHC would not warn whenever there was a class instance that
      didn't implement a class method whose name begins with an underscore.
      
      Fixes #12959.
      
      Test Plan: make test TEST=WarnMinimal
      
      Reviewers: austin, bgamari, simonpj
      
      Reviewed By: bgamari, simonpj
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2849
      
      GHC Trac Issues: #12959
      503219e3
    • Matthew Pickering's avatar
      Fix pretty printing of MINIMAL signatures · 1ec632f8
      Matthew Pickering authored
      Reviewers: austin, alanz, bgamari
      
      Reviewed By: alanz, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2836
      1ec632f8
    • Simon Marlow's avatar
      Fix cost-centre-stacks bug (#5654) · 394231b3
      Simon Marlow authored
      This fixes some cases of wrong stacks being generated by the profiler.
      For background and details on the fix see
      `Note [Evaluating functions with profiling]` in `rts/Apply.cmm`.
      
      This does have an impact on allocations for some programs when
      profiling.  nofib results:
      
      ```
         k-nucleotide          +0.0%     +8.8%    +11.0%    +11.0%      0.0%
               puzzle          +0.0%    +12.5%     0.244     0.246      0.0%
            typecheck           0.0%     +8.7%    +16.1%    +16.2%      0.0%
      ------------------------------------------------------------------------
      --------
                  Min          -0.0%     -0.0%    -34.4%    -35.5%    -25.0%
                  Max          +0.0%    +12.5%    +48.9%    +49.4%    +10.6%
       Geometric Mean          +0.0%     +0.6%     +2.0%     +1.8%     -0.3%
      
      ```
      
      But runtimes don't seem to be affected much, and the examples I looked
      at were completely legitimate.  For example, in puzzle we have this:
      
      ```
      position :: ItemType -> StateType ->  BankType
      position Bono = bonoPos
      position Edge = edgePos
      position Larry = larryPos
      position Adam = adamPos
      ```
      
      where the identifiers on the rhs are all record selectors.  Previously
      the profiler gave a stack that looked like
      
      ```
        position
        bonoPos
        ...
      ```
      
      i.e. `bonoPos` was at the same level of the call stack as `position`,
      but now it looks like
      
      ```
        position
         bonoPos
         ...
      ```
      
      I used the normaliser from the testsuite to diff the profiling output
      from other nofib programs and they all looked better.
      
      Test Plan:
      * the broken test passes
      * validate
      * compiled and ran all of nofib, measured perf, diff'd several .prof
      files
      
      Reviewers: niteria, erikd, austin, scpmw, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2804
      
      GHC Trac Issues: #5654, #10007
      394231b3
    • Ben Gamari's avatar
      check-ppr: Add a --dump flag to aid in debugging · 5c76f834
      Ben Gamari authored
      Currently tracking down where two ASTs disagree is quite difficult. Add a --dump
      flag to check-ppr which dumps the respective ASTs to files, which can then be
      easily compared with diff, etc.
      5c76f834