1. 18 Dec, 2016 2 commits
    • Ryan Scott's avatar
      Introduce unboxedSum{Data,Type}Name to template-haskell · b5d788aa
      Ryan Scott authored
      Summary:
      In D2448 (which introduced Template Haskell support for unboxed
      sums), I neglected to add `unboxedSumDataName` and `unboxedSumTypeName`
      functions, since there wasn't any way you could write unboxed sum data or type
      constructors in prefix form to begin with (see #12514). But even if you can't
      write these `Name`s directly in source code, it would still be nice to be able
      to use these `Name`s in Template Haskell (for instance, to be able to treat
      unboxed sum type constructors like any other type constructors).
      
      Along the way, this uncovered a minor bug in `isBuiltInOcc_maybe` in
      `TysWiredIn`, which was calculating the arity of unboxed sum data constructors
      incorrectly.
      
      Test Plan: make test TEST=T12478_5
      
      Reviewers: osa1, goldfire, austin, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2854
      
      GHC Trac Issues: #12478, #12514
      b5d788aa
    • Edward Z. Yang's avatar
      Check family instance consistency of hs-boot families later, fixes #11062. · 25b70a29
      Edward Z. Yang authored
      Summary:
      With hs-boot files, some type families may be defined in the
      module we are typechecking.  In this case, we are not allowed
      to poke these families until after we typecheck our local
      declarations.  So we first check everything involving non-recursive
      families, and then check the recursive families as we finish
      kind-checking them.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate
      
      Reviewers: goldfire, austin, simonpj, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2859
      
      GHC Trac Issues: #11062
      25b70a29
  2. 17 Dec, 2016 4 commits
  3. 15 Dec, 2016 14 commits
    • 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
      testsuite: Specify expected allocations of T12877 for Windows · 2940a617
      Ben Gamari authored
      This deviated by 12% from the expected allocations on Windows.
      Yet another case of #12758.
      2940a617
    • Ryan Scott's avatar
      Make unboxedTuple{Type,Data}Name support 0- and 1-tuples · 9550b8d8
      Ryan Scott authored
      Previously, these functions were hardcoded so as to always `error`
      whenever given an argument of 0 or 1. This restriction can be lifted
      pretty easily, however.
      
      This requires a slight tweak to `isBuiltInOcc_maybe` in `TysWiredIn` to
      allow it to recognize `Unit#` (which is the hard-wired `OccName` for
      unboxed 1-tuples).
      
      Fixes #12977.
      
      Test Plan: make test TEST=12977
      
      Reviewers: austin, goldfire, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2847
      
      GHC Trac Issues: #12977
      9550b8d8
    • Ben Gamari's avatar
      testsuite: Mark T9577 as broken due to #12965 · be5384ce
      Ben Gamari authored
      Test Plan: validate
      
      Reviewers: austin, Phyx
      
      Reviewed By: Phyx
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2835
      
      GHC Trac Issues: #12965
      be5384ce
    • Tamar Christina's avatar
      Reset FPU precision back to MSVCRT defaults · 6f7d8279
      Tamar Christina authored
      Mingw-w64 does a stupid thing. They set the FPU precision to extended
      mode by default.  The reasoning is that it's for compatibility with GNU
      Linux ported libraries. However the problem is this is incompatible with
      the standard Windows double precision mode.  In fact, if we create a new
      OS thread then Windows will reset the FPU to double precision mode.  So
      we end up with a weird state where the main thread by default has a
      different precision than any child threads.
      
      Test Plan: ./validate new test T7289
      
      Reviewers: simonmar, austin, bgamari, erikd
      
      Reviewed By: simonmar
      
      Subscribers: thomie, #ghc_windows_task_force
      
      Differential Revision: https://phabricator.haskell.org/D2819
      
      GHC Trac Issues: #7289
      6f7d8279
    • Maciej Bielecki's avatar
      Show constraints when reporting typed holes · 0c3341b2
      Maciej Bielecki authored
      This patch implements the display of constraints in the error message
      for typed holes.
      
      Test Plan: validate, read docs
      
      Reviewers: simonpj, austin, bgamari
      
      Reviewed By: simonpj, bgamari
      
      Subscribers: simonpj, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2767
      
      GHC Trac Issues: #10614
      0c3341b2
  4. 14 Dec, 2016 1 commit
  5. 13 Dec, 2016 6 commits
  6. 12 Dec, 2016 3 commits
  7. 11 Dec, 2016 1 commit
    • Moritz Angermann's avatar
      Make globals use sharedCAF · c3c70244
      Moritz Angermann authored
      Summary:
      The use of globals is quite painful when multiple rts are loaded, e.g.
      when plugins are loaded, which bring in a second rts. The sharedCAF
      appraoch was employed for the FastStringTable; I've taken the libery
      to extend this to the other globals I could find.
      
      This is a reboot of D2575, that should hopefully not exhibit the same
      windows build issues.
      
      Reviewers: Phyx, simonmar, goldfire, bgamari, austin, hvr, erikd
      
      Reviewed By: Phyx, simonmar, bgamari
      
      Subscribers: mpickering, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2773
      c3c70244
  8. 10 Dec, 2016 1 commit
  9. 09 Dec, 2016 7 commits
    • Ben Gamari's avatar
      testsuite: Mark prog003 as broken on Windows · 24a4fe29
      Ben Gamari authored
      Due to #11317.
      24a4fe29
    • Ryan Scott's avatar
      Rename TH constructors for deriving strategies · 5349d648
      Ryan Scott authored
      After talking to Richard, he and I concluded that choosing the rather
      common name `Newtype` to represent the corresponding deriving strategy
      in Template Haskell was a poor choice of name. I've opted to rename it
      to something less common (`NewtypeStrategy`) while we still have time. I
      also renamed the corrsponding datatype in the GHC internals so as to
      match it.
      
      Reviewers: austin, goldfire, hvr, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie, mpickering
      
      Differential Revision: https://phabricator.haskell.org/D2814
      
      GHC Trac Issues: #10598
      5349d648
    • Rufflewind's avatar
      Ensure each test inherits the TEST_HC_OPTS · d1df8d1c
      Rufflewind authored
      This is so that global test flags that control the error formatting are
      propagated correctly.  This patch is kind of related to: D2718
      
      The stderr for API annotations is ignored entirely now per @alanz's
      suggestion.
      
      Test Plan: validate
      
      Reviewers: thomie, alanz, austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: alanz
      
      Differential Revision: https://phabricator.haskell.org/D2808
      d1df8d1c
    • Rufflewind's avatar
      testsuite: make tests respond to SIGINT properly · ca593c7d
      Rufflewind authored
      The `std*_buffer` need to be bytes to avoid breaking Python 3.
      
      Also, using a blanket `except` in Python without specifying the
      exception types will catch special exceptions such as
      `KeyboardInterrupt`, which can prevent the program from being
      interrupted properly.
      
      Test Plan: validate
      
      Reviewers: thomie, austin, bgamari
      
      Reviewed By: bgamari
      
      Differential Revision: https://phabricator.haskell.org/D2805
      ca593c7d
    • Ben Gamari's avatar
      Mark T12903 as broken on OS X · 62418b87
      Ben Gamari authored
      Something has recently broken it. See #12956.
      62418b87
    • Sylvain Henry's avatar
      Scrutinee Constant Folding · d3b546b1
      Sylvain Henry authored
      This patch introduces new rules to perform constant folding through
      case-expressions.
      
      E.g.,
      ```
      case t -# 10# of _ {  ===> case t of _ {
               5#      -> e1              15#     -> e1
               8#      -> e2              18#     -> e2
               DEFAULT -> e               DEFAULT -> e
      ```
      
      The initial motivation is that it allows "Merge Nested Cases"
      optimization to kick in and to further simplify the code
      (see Trac #12877).
      
      Currently we recognize the following operations for Word# and Int#: Add,
      Sub, Xor, Not and Negate (for Int# only).
      
      Test Plan: validate
      
      Reviewers: simonpj, austin, bgamari
      
      Reviewed By: simonpj, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2762
      
      GHC Trac Issues: #12877
      d3b546b1
    • Ryan Scott's avatar
      Disambiguate reified closed type family kinds in TH · f65ff2c4
      Ryan Scott authored
      Summary:
      A continuation of #8953. This fixes an oversight in which the
      left-hand sides of closed type families, when reified in Template Haskell,
      would not be given kind annotations, even when they are necessary for
      disambiguation purposes in the presence of `PolyKinds`.
      
      Fixes #8953 and #12646.
      
      Test Plan: ./validate
      
      Reviewers: hvr, bgamari, austin, goldfire
      
      Reviewed By: goldfire
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2795
      
      GHC Trac Issues: #8953, #12646
      f65ff2c4
  10. 08 Dec, 2016 1 commit