1. 09 Dec, 2016 10 commits
    • 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
    • Peter Trommler's avatar
      NCG: Implement trivColorable for PowerPC 64-bit · 2823492e
      Peter Trommler authored
      Define constants for 64-bit PowerPC in graph coloring register
      allocator.
      
      Test Plan: ./validate
      
      Reviewers: simonmar, austin, erikd, bgamari, hvr
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2791
      2823492e
    • dobenour's avatar
      Fix LLVM TBAA metadata · 90fae01c
      dobenour authored
      Accesses through a Cmm local are currently reported as having the
      "other" type, which can only alias other "other" accesses.  However,
      this assumption is incorrect, which can result in silent bad LLVM
      codegen.
      
      Fixes #9308.
      Fixes #9504.
      
      Test Plan: GHC CI
      
      Reviewers: rwbarton, austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: michalt, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2758
      
      GHC Trac Issues: #9125, #9308, #9504
      90fae01c
    • 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
      Export `warningGroups' and `warningHierarchies' · 1c296c0c
      Sylvain Henry authored
      Reviewers: austin, mpickering, bgamari
      
      Reviewed By: mpickering, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2806
      1c296c0c
    • Rufflewind's avatar
      Disable colors unless printing to stderr · cee72d5c
      Rufflewind authored
      Only print colors when mkLocMessageAnn is called directly from
      defaultLogAction.  This prevents ANSI error codes from cluttering up the
      dump files.
      
      Test Plan: validate
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2792
      
      GHC Trac Issues: #12927
      cee72d5c
    • 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
    • Ben Gamari's avatar
      Bump haddock submodule · 61932cd3
      Ben Gamari authored
      Fixes Windows build.
      61932cd3
    • 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
    • Ben Gamari's avatar
      rts/PosixSource.h: Define __USE_MINGW_ANSI_STDIO on Windows · 6da62535
      Ben Gamari authored
      This was removed in 8dc72f3c which cleaned up
      PosixSource.h. Strangely, this only started breaking for me now.
      
      Test Plan: Validate on Windows
      
      Reviewers: simonmar, erikd, austin, Phyx
      
      Reviewed By: Phyx
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2812
      
      GHC Trac Issues: #12951
      6da62535
  2. 08 Dec, 2016 10 commits
  3. 07 Dec, 2016 11 commits
    • Alan Zimmerman's avatar
      Remove stray commented out line in all.T · 9bcc4e33
      Alan Zimmerman authored
      9bcc4e33
    • Alan Zimmerman's avatar
      Fix pretty printer test to nog generate stdout · 58d78dc0
      Alan Zimmerman authored
      It was doing a dump to stdout, which is not repeatable across platforms.
      58d78dc0
    • Alan Zimmerman's avatar
      Add HsSyn prettyprinter tests · 499e4382
      Alan Zimmerman authored
      Summary:
      Add prettyprinter tests, which take a file, parse it, pretty print it,
      re-parse the pretty printed version and then compare the original and
      new ASTs (ignoring locations)
      
      Updates haddock submodule to match the AST changes.
      
      There are three issues outstanding
      
      1. Extra parens around a context are not reproduced. This will require an
         AST change and will be done in a separate patch.
      
      2. Currently if an `HsTickPragma` is found, this is not pretty-printed,
         to prevent noise in the output.
      
         I am not sure what the desired behaviour in this case is, so have left
         it as before. Test Ppr047 is marked as expected fail for this.
      
      3. Apart from in a context, the ParsedSource AST keeps all the parens from
         the original source.  Something is happening in the renamer to remove the
         parens around visible type application, causing T12530 to fail, as the
         dumped splice decl is after the renamer.
      
         This needs to be fixed by keeping the parens, but I do not know where they
         are being removed.  I have amended the test to pass, by removing the parens
         in the expected output.
      
      Test Plan: ./validate
      
      Reviewers: goldfire, mpickering, simonpj, bgamari, austin
      
      Reviewed By: simonpj, bgamari
      
      Subscribers: simonpj, goldfire, thomie, mpickering
      
      Differential Revision: https://phabricator.haskell.org/D2752
      
      GHC Trac Issues: #3384
      499e4382
    • Ben Gamari's avatar
      Don't barf() on failures in loadArchive() · 83d69dca
      Ben Gamari authored
      This patch replaces calls to barf() in loadArchive() with proper
      error handling.
      
      Test Plan: GHC CI
      
      Reviewers: rwbarton, erikd, hvr, austin, simonmar, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Tags: #ghc
      
      Differential Revision: https://phabricator.haskell.org/D2652
      
      GHC Trac Issues: #12388
      83d69dca
    • Ben Gamari's avatar
      rts: Use pthread itimer implementation on Darwin · d70d452a
      Ben Gamari authored
      We want to avoid using SIGALRM whenever possible since we will interrupt
      long-running system calls. See #10840.
      
      Test Plan: Validate on Darwin
      
      Reviewers: austin, erikd, simonmar
      
      Reviewed By: simonmar
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2796
      
      GHC Trac Issues: #10840
      d70d452a
    • Simon Marlow's avatar
      Fix crashes in hash table scanning with THREADED_RTS · 9043a400
      Simon Marlow authored
      See comments.
      9043a400
    • Simon Marlow's avatar
      Fix the test with -O · 5aa9c750
      Simon Marlow authored
      Static string optimisation means we get a ForeignPtr with an IORef
      inside it, leading to a different error.
      5aa9c750
    • Simon Marlow's avatar
      c02aeb5c
    • Simon Marlow's avatar
      Overhaul of Compact Regions (#12455) · 7036fde9
      Simon Marlow authored
      Summary:
      This commit makes various improvements and addresses some issues with
      Compact Regions (aka Compact Normal Forms).
      
      This was the most important thing I wanted to fix.  Compaction
      previously prevented GC from running until it was complete, which
      would be a problem in a multicore setting.  Now, we compact using a
      hand-written Cmm routine that can be interrupted at any point.  When a
      GC is triggered during a sharing-enabled compaction, the GC has to
      traverse and update the hash table, so this hash table is now stored
      in the StgCompactNFData object.
      
      Previously, compaction consisted of a deepseq using the NFData class,
      followed by a traversal in C code to copy the data.  This is now done
      in a single pass with hand-written Cmm (see rts/Compact.cmm). We no
      longer use the NFData instances, instead the Cmm routine evaluates
      components directly as it compacts.
      
      The new compaction is about 50% faster than the old one with no
      sharing, and a little faster on average with sharing (the cost of the
      hash table dominates when we're doing sharing).
      
      Static objects that don't (transitively) refer to any CAFs don't need
      to be copied into the compact region.  In particular this means we
      often avoid copying Char values and small Int values, because these
      are static closures in the runtime.
      
      Each Compact# object can support a single compactAdd# operation at any
      given time, so the Data.Compact library now enforces mutual exclusion
      using an MVar stored in the Compact object.
      
      We now get exceptions rather than killing everything with a barf()
      when we encounter an object that cannot be compacted (a function, or a
      mutable object).  We now also detect pinned objects, which can't be
      compacted either.
      
      The Data.Compact API has been refactored and cleaned up.  A new
      compactSize operation returns the size (in bytes) of the compact
      object.
      
      Most of the documentation is in the Haddock docs for the compact
      library, which I've expanded and improved here.
      
      Various comments in the code have been improved, especially the main
      Note [Compact Normal Forms] in rts/sm/CNF.c.
      
      I've added a few tests, and expanded a few of the tests that were
      there.  We now also run the tests with GHCi, and in a new test way
      that enables sanity checking (+RTS -DS).
      
      There's a benchmark in libraries/compact/tests/compact_bench.hs for
      measuring compaction speed and comparing sharing vs. no sharing.
      
      The field totalDataW in StgCompactNFData was unnecessary.
      
      Test Plan:
      * new unit tests
      * validate
      * tested manually that we can compact Data.Aeson data
      
      Reviewers: gcampax, bgamari, ezyang, austin, niteria, hvr, erikd
      
      Subscribers: thomie, simonpj
      
      Differential Revision: https://phabricator.haskell.org/D2751
      
      GHC Trac Issues: #12455
      7036fde9
    • Ben Gamari's avatar
      Really mark T9577 as broken · 4dd6b37f
      Ben Gamari authored
      I failed at the last attempt.
      4dd6b37f
    • Ben Gamari's avatar
      Mark T9577 as broken on Darwin due to #12937 · 39143a47
      Ben Gamari authored
      39143a47
  4. 06 Dec, 2016 8 commits
    • Vladislav Zavialov's avatar
      Test Trac #12919 · 41ec722d
      Vladislav Zavialov authored
      Test Plan: make test TEST=T12919
      
      Reviewers: bgamari, austin
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2788
      
      GHC Trac Issues: #12919
      41ec722d
    • Thijs Alkemade's avatar
      Reduce the size of string literals in binaries. · b7e88ee0
      Thijs Alkemade authored
      Removed the alignment for strings and mark then as cstring sections in
      the generated asm so the linker can merge duplicate sections.
      
      Reviewers: rwbarton, trofi, austin, trommler, simonmar, hvr, bgamari
      
      Reviewed By: hvr, bgamari
      
      Subscribers: simonpj, hvr, thomie
      
      Differential Revision: https://phabricator.haskell.org/D1290
      
      GHC Trac Issues: #9577
      b7e88ee0
    • Matthew Pickering's avatar
      eafa06dc
    • Matthew Pickering's avatar
      Fix unsafe usage of `is_iloc` selector in Ord instance for ImportSpec · 6e4188ab
      Matthew Pickering authored
      Summary:
      This fixes tests rn017, T7672 and closed #12930.
      
      Both these tests were self referential module imports through hs-boot
      files. As a result, I am quite suspicious of what the ImpAll constructor is
      used for. I had a brief hunt around but couldn't immediately see whether
      it was necessary.
      
      Reviewers: austin, bgamari
      
      Subscribers: simonpj, thomie, nomeata
      
      Differential Revision: https://phabricator.haskell.org/D2793
      
      GHC Trac Issues: #12930
      6e4188ab
    • Simon Marlow's avatar
    • Simon Marlow's avatar
      Overhaul GC stats · 24e6594c
      Simon Marlow authored
      Summary:
      Visible API changes:
      
      * The C struct `GCDetails` gives the stats about a single GC.  This is
        passed to the `gcDone()` callback if one is set via the
        RtsConfig. (previously we just passed a collection of values, so this
        is more extensible, at the expense of breaking the existing API)
      
      * `RTSStats` gives cumulative stats since the start of the program,
        and includes the `GCDetails` for the most recent GC.  This struct
        can be obtained via `getRTSStats()` (the old `getGCStats()` has been
        removed, and `getGCStatsEnabled()` has been renamed to
        `getRTSStatsEnabled()`)
      
      Improvements:
      
      * The per-GC stats and cumulative stats are now cleanly separated.
      
      * Inside the RTS we have a top-level `RTSStats` struct to keep all our
        stats in, previously this was just a collection of strangely-named
        variables.  This struct is mostly just copied in `getRTSStats()`, so
        the implementation of that function is a lot shorter.
      
      * Types are more consistent.  We use a uint64_t byte count for all
        memory values, and Time for all time values.
      
      * Names are more consistent.  We use a suffix `_bytes` for all byte
        counts and `_ns` for all time values.
      
      * We now collect information about the amount of memory in large
        objects and compact objects in `GCDetails`. (the latter was the reason
        I started doing this patch but it seems to have ballooned a bit!)
      
      * I fixed a bug in the calculation of the elapsed MUT time, and added
        an ASSERT to stop the calculations going wrong in the future.
      
      For now I kept the Haskell API in `GHC.Stats` the same, by
      impedence-matching with the new API.  We could either break that API
      and make it match the C API more closely, or we could add a new API
      and deprecate the old one.  Opinions welcome.
      
      This stuff is very easy to get wrong, and it's hard to test.  Reviews
      welcome!
      
      Test Plan:
      manual testing
      validate
      
      Reviewers: bgamari, niteria, austin, ezyang, hvr, erikd, rwbarton, Phyx
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2756
      24e6594c
    • Ryan Scott's avatar
      Give concrete example for #12784 in 8.0.2 release notes · eec02ab7
      Ryan Scott authored
      Summary:
      We mentioned that there were "some programs" that failed to typecheck
      due to #12784, but given how surprisingly common this issue has been, it'd
      be prudent to at least give one example of the bug in the release notes.
      
      Reviewers: simonpj, bgamari, austin, rwbarton
      
      Reviewed By: rwbarton
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2786
      
      GHC Trac Issues: #12784
      eec02ab7
    • Tamar Christina's avatar
      Fix x86 Windows build and testsuite · b82f71b9
      Tamar Christina authored
      Summary:
      Fix issues preventing x86 GHC to build on Windows and
      fix segfault in the testsuite.
      
      Test Plan: ./validate
      
      Reviewers: austin, erikd, simonmar, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: #ghc_windows_task_force, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2789
      b82f71b9
  5. 05 Dec, 2016 1 commit
    • Tamar Christina's avatar
      Color output is wreaking havoc on test results · 847d2293
      Tamar Christina authored
      Summary:
      D2716 introduced colors into the output of GHC.
      These color ourputs are done using escape characters output
      to the terminal.
      
      These however are wreaking havoc on the testsuite output as now
      no stderr with a warning or error will match anymore.
      
      Instead of accepting the new codes as expected values instead I
      turn them off. So the testsuite is consistent on platforms/terminals we
      don't support colors on.
      
      Test Plan:
      any test that outputs colors. e.g.
      
      make test TEST=T9576
      
      Reviewers: austin, Rufflewind, bgamari
      
      Subscribers: thomie, #ghc_windows_task_force
      
      Differential Revision: https://phabricator.haskell.org/D2787
      
      GHC Trac Issues: #8809
      847d2293