- 05 Dec, 2016 4 commits
-
-
Simon Peyton Jones authored
-
Simon Peyton Jones authored
Refactoring only
-
Simon Peyton Jones authored
The used-variable calculation for pattern synonyms is a little tricky, for reasons described in RnBinds Note [Pattern synonym builders don't yield dependencies] It was right semantically, but the "unused-variable warning" was wrong, which led to Trac #12548.
-
Simon Peyton Jones authored
Trac #12425 and #12234 showed up a major and long-standing bug in the occurrence analyser, whereby it could generate explonentially large program! There's a lot of commentary on #12425; and it's all described in Note [Loop breakers, node scoring, and stability] I did quite a lot of refactoring to make the code comprehensibe again (its structure had bit-rotted rather), so the patch looks bigger than it really is. Hurrah! I did a nofib run to check that I hadn't inadertently ruined anything: -------------------------------------------------------------------------------- Program Size Allocs Runtime Elapsed TotalMem -------------------------------------------------------------------------------- fluid -0.3% -1.5% 0.01 0.01 +0.0% parser -0.9% +0.6% 0.04 0.04 +0.0% prolog -0.1% +1.2% 0.00 0.00 +0.0% -------------------------------------------------------------------------------- Min -0.9% -1.5% -8.6% -8.7% +0.0% Max +0.1% +1.2% +7.7% +7.8% +2.4% Geometric Mean -0.2% -0.0% -0.2% -0.3% +0.0% I checked what happened in 'prolog'. It seems that we have a recursive data structure something like this f :: [blah] f x = build (\cn. ...g... ) g :: [blah2] g y = ....(foldr k z (f y)).... If we inline 'f' into 'g' we get better fusion than the other way round, but we don't have any way to spot that at the moment. (I wonder if we could do worker/wrapper for functions returning a 'build'?) It was happening before by a fluke. Anyway I decided to accept this; it's relatively rare I think.
-
- 02 Dec, 2016 7 commits
-
-
Joachim Breitner authored
Previously, it would substitute e for n without an e being around. I clarify that by naming the scrutinee e.
-
Sergei Trofimovich authored
It's 2.27 (-2), not 1.27.2. Dropped stray '\r'. Signed-off-by:
Sergei Trofimovich <siarheit@google.com>
-
johnleo authored
Maintain in-scope set in deeply_instantiate (Fixes T12549). lint fixes Test Plan: validate Reviewers: simonpj, austin, goldfire, bgamari Reviewed By: simonpj, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2757 GHC Trac Issues: #12549
-
Alexander Vershilov authored
When rts is forked it doesn't update toplevel handler, so UserInterrupt exception is sent to Thread1 that doesn't exist in forked process. We install toplevel handler when fork so signal will be delivered to the new main thread. Fixes #12903 Reviewers: simonmar, austin, erikd, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2770 GHC Trac Issues: #12903
-
Simon Marlow authored
select() is limited to 1024 file descriptors. This actually blew up in a very hard-to-debug way in our production system when using the hinotify package. Test Plan: libraries/tests pass, paricularly hGetBuf001 which exercises this code. Reviewers: niteria, erikd, austin, hvr, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2785 GHC Trac Issues: #12912
-
Ryan Scott authored
Mention that many GHC testsuite tests will fail with a compiler built with the quickest profile. See Trac #12141.
-
Ben Gamari authored
The testsuite now requires python >=3.0. See #12909.
-
- 01 Dec, 2016 12 commits
-
-
Kai Ruemmler authored
textEncodingName is notjust a string, it must be a valid input for mkTextEncoding, as stated in libraries/base/GHC/IO/Encoding/Types.hs. Test Plan: A working latin1 locale is required on the system. Reason: ghc's initial locale encoding defaults to ASCII, if either an unknown locale or unknown charset is used. For the bug to show up, ghc must start up using the latin1 encoding. From main directory in ghc do: $ ./configure && make clean && make boot && make inplace/bin/ghc-stage2 $ LC_CTYPE="de_DE.ISO-8859-1" ./inplace/bin/ghc-stage2 Before the patch, the last line leads to the exception thrown: ghc-stage2: mkTextEncoding: does not exist (unknown encoding:ISO8859-1(checked)//TRANSLIT) After the patch, ghc-stage2 prints a short usage summary as expected. Moreover, $ make test TEST=encoding005 continues to pass after the patch. Reviewers: austin, hvr, rwbarton, bgamari Reviewed By: bgamari Subscribers: mpickering, rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D2667
-
Ben Gamari authored
Test Plan: Validate on 64-bit Windows Reviewers: geekosaur, austin, erikd, Phyx Reviewed By: Phyx Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2781
-
Ben Gamari authored
The previous attempt updated the comment but not the value. Silly me.
-
Gabor Greif authored
-
Ben Gamari authored
As described in #12865, newer Linux kernels support both MADV_FREE and MADV_DONTNEED. Previously a runtime would fail to try MADV_DONTNEED if MADV_FREE failed (e.g. since the kernel which the image is running on doesn't support the latter). Now we try MADV_DONTNEED if MADV_FREE failed to ensure that binaries compiled on a kernel supporting MADV_FREE don't fail on decommit. Test Plan: Validate Reviewers: austin, erikd, simonmar Reviewed By: simonmar Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2780 GHC Trac Issues: #12865
-
Ben Gamari authored
They are not supported by Python 3.0, 3.1, and 3.2 (but are supported by >= 3.3; silliness!) Test Plan: Validate on python 3.2 Reviewers: austin Subscribers: simonpj, thomie Differential Revision: https://phabricator.haskell.org/D2778 GHC Trac Issues: #12909, #9184
-
Ben Gamari authored
Test Plan: Build `p` way Reviewers: austin, erikd, simonmar Reviewed By: simonmar Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2779
-
Ryan Scott authored
Test Plan: Read it, commit it, merge it, ship it Reviewers: goldfire, bgamari, austin, hvr, simonpj Reviewed By: simonpj Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2774 GHC Trac Issues: #12907
-
Sylvain Henry authored
Reviewers: simonpj, austin, bgamari Reviewed By: simonpj, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2769 GHC Trac Issues: #12901
-
Ben Gamari authored
GHC uses gcc, not ld, for linking. Consequently all flags to be interpreted by ld need to be prefixed by -optl,-Wl on the GHC command line. Test Plan: Validate on OpenBSD Reviewers: austin, rwbarton Reviewed By: rwbarton Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2776
-
Chris Martin authored
Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2772
-
Ben Gamari authored
-
- 30 Nov, 2016 9 commits
-
-
Tamar Christina authored
This reverts commit ef37580d. Now that commit e2330b6d has been reverted this change is now needed.
-
Ben Gamari authored
This reverts commit 6f7ed1e5 due to breakage of the build on Windows.
-
Simon Peyton Jones authored
Richard and I decided to make this change in our paper, and I'm just propagating it to GHC
-
Gabor Greif authored
-
Tamar Christina authored
-
Tamar Christina authored
This updates the binary dists for windows to GCC 6.2.0 and binutils 2.27.2 which has fixes required for LLVM. Test Plan: ./validate Reviewers: simonmar, erikd, austin, bgamari Reviewed By: simonmar, bgamari Subscribers: thomie, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D2749 GHC Trac Issues: #12871, #8974
-
Ben Gamari authored
Summary: It turns out that Phyx's fix for #12554 (D2684) still fails with mingw-w64 python 2.7. However, Python 3 (both msys2 and mingw-w64) work fine. Given that supporting Python 2 has already become rather tiresome (as @thomie warned it would), let's just move to python3 by default. Test Plan: Validate Reviewers: austin, Phyx Reviewed By: Phyx Subscribers: Phyx, thomie Differential Revision: https://phabricator.haskell.org/D2766 GHC Trac Issues: #12554
-
Tamar Christina authored
Following D2684 these two tests need to be updated: * T7037: timeout.exe now waits until all processes are finished. this makes T7037 reliable. So enabled. * T876: Unknown reason, allocations are much lower than before. Test Plan: ./validate Reviewers: austin, simonmar, bgamari Reviewed By: bgamari Subscribers: thomie, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D2759 GHC Trac Issues: #12725, #12004
-
Tamar Christina authored
In a land far far away, a project called Cygwin was born. Cygwin used newlib as it's standard C library implementation. But Cygwin wanted to emulate POSIX systems as closely as possible. So it implemented `execv` using the Windows function `spawnve`. Specifically ``` spawnve (_P_OVERLAY, path, argv, cur_environ ()) ``` `_P_OVERLAY` is crucial, as it makes the function behave *sort of* like execv on linux. the child process replaces the original process. With one major difference because of the difference in process models on Windows: the original process signals the caller that it's done. this is why the file is still locked. because it's still running, control was returned because the parent process was destroyed, but the child is still running. I think it's just pure dumb luck, that the older runtimes are slow enough to give the process time to terminate before we tried deleting the file. Which explains why you do have sporadic failures even on older runtimes like 2.5.0, of a test or two (like T7307). So this patch fixes a couple of things. I leverage the existing `timeout.exe` to implement a workaround for this issue. a) The old timeout used to start the process then assign it to the job. This is slightly faulty since child processes are only assigned to a job is their parent were assigned at the time they started. So this was a race condition. I now create the process suspended, assign it to the job and then resume it. Which means all child processes are not running under the same job. b) First things, Is to prevent dangling child processes. I mark the job with `JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE` so when the last process in the job is done, it insures all processes under the job are killed. c) Secondly, I change the way we wait for results. Instead of waiting for the parent process to terminate, I wait for the job itself to terminate. There's a slight subtlety there, we can't wait on the job itself. Instead we have to create an I/O Completion port and wait for signals on it. See https://blogs.msdn.microsoft.com/oldnewthing/20130405-00/?p=4743 This fixes the issues on all runtimes for me and makes T7307 pass consistenly. The threading was also simplified by hiding all the locking in a single semaphore and a completion class. Futhermore some additional error reporting was added. For encoding the testsuite now no longer passes a file handle to the subprocess since on windows, sh.exe seems to acquire a lock on the file that is not released in a timely fashion. I suspect this because cygwin seems to emulate console handles by creating file handles and using those for std handles. So when we give it an existing file handle it just locks the file. I what's happening is that it's not releasing the handle until all shared cygwin processes are dead. Which explains why it worked in single threaded mode. So now instead we pass a pipe and do not interpret the resulting data. Any bytes written to stdin or read out of stdout/stderr are done so in binary mode and we do not interpret the data. The reason for this is that we have encoding tests in GHC which pass invalid utf-8. If we try to handle the data as text then python will throw an exception instead of a test comparison failing. Also I have fixed the ability to override `PYTHON` when calling `make tests`. This now works the same as with `.\validate`. Finally, after cleaning up the locks I was able to make the abort behavior work correctly as I believe it was intended: when you press Ctrl+C and send an interrupt signal, the testsuite finishes the active tests and then gracefully exits showing you a report of the progress it did make. So using Ctrl+C will not just *die* as it did before. These changes lift the restriction on which python version you use (msys/mingw) or which runtime or python 3 or python 2. All combinations should now be supported. Test Plan: PATH=/usr/local/bin:/mingw64/bin:$APPDATA/cabal/bin:$PATH && PYTHON=/usr/bin/python THREADS=9 make test THREADS=9 make test PATH=/usr/local/bin:/mingw64/bin:$APPDATA/cabal/bin:$PATH && PYTHON=/usr/bin/python ./validate --quiet --testsuite-only Reviewers: erikd, RyanGlScott, bgamari, austin Subscribers: jrtc27, mpickering, thomie, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D2684 GHC Trac Issues: #12725, #12554, #12661, #12004
-
- 29 Nov, 2016 8 commits
-
-
Michal Terepeta authored
This introduces the new interface for dataflow analysis, where transfer functions operate on a whole basic block. The main changes are: - Hoopl.Dataflow: implement the new interface and remove the old code; expose a utility function to do a strict fold over the nodes of a basic block (for analyses that do want to look at all the nodes) - Refactor all the analyses to use the new interface. One of the nice effects is that we can remove the `analyzeFwdBlocks` hack that ignored the middle nodes (that existed for analyses that didn't need to go over all the nodes). Now this is no longer a special case and fits well with the new interface. Signed-off-by:
Michal Terepeta <michal.terepeta@gmail.com> Test Plan: validate, earlier version of the patch had assertions comparing the results with the old implementation Reviewers: erikd, austin, simonmar, hvr, goldfire, bgamari Reviewed By: bgamari Subscribers: goldfire, erikd, thomie Differential Revision: https://phabricator.haskell.org/D2754
-
duairc authored
Reviewers: austin, hvr, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2755
-
Michal Terepeta authored
It seems that `BlockId` module could simply go away in favor of Hoopl's `Label`. This is the first step to do that. In a few places I had to add some type signatures, but most of them seem to help with code readability. Signed-off-by:
Michal Terepeta <michal.terepeta@gmail.com> Test Plan: ./validate Reviewers: austin, simonmar, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2765
-
Ben Gamari authored
-
Ben Gamari authored
Test Plan: Validate on lots of platforms Reviewers: erikd, simonmar, austin Reviewed By: erikd, simonmar Subscribers: michalt, thomie Differential Revision: https://phabricator.haskell.org/D2699
-
Ben Gamari authored
Test Plan: Validate Reviewers: simonmar, austin, erikd Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2764
-
Moritz Angermann authored
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. Reviewers: rwbarton, simonmar, austin, hvr, erikd, bgamari Reviewed By: simonmar, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2575
-
Ben Gamari authored
Consider the case of building a stage1 compiler. `hschooks.c` will be built by stage0 `ghc` and linked against the `stage0` RTS. Despite this it was #including the stage1 `Rts.h`. There is, of course, no guarantee that this is ABI-compatible with the stage0 RTS and when they diverge Bad Things happen (e.g. bells ringing at inappropriate times in D2699). Test Plan: Validate Reviewers: simonmar, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2763
-