summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-12-01Reshuffle levity polymorphism checks.wip/T12819Richard Eisenberg
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
2016-12-01testsuite: Actually update haddock.compiler allocationsBen Gamari
The previous attempt updated the comment but not the value. Silly me.
2016-12-01Typos in commentsGabor Greif
2016-12-01rts: Ensure we always give MADV_DONTNEED a chance in osDecommitMemoryBen Gamari
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
2016-12-01testsuite: Remove Unicode literals from driverBen Gamari
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
2016-12-01rts: Fix type of bool literalBen Gamari
Test Plan: Build `p` way Reviewers: austin, erikd, simonmar Reviewed By: simonmar Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2779
2016-12-01Make note of #12907 in 8.0.2 release notesRyan Scott
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
2016-12-01Levity polymorphic expressions mustn't be floated-out in let-bindings.Sylvain Henry
Reviewers: simonpj, austin, bgamari Reviewed By: simonpj, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2769 GHC Trac Issues: #12901
2016-12-01Ensure flags destined for ld are properly passedBen Gamari
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
2016-12-01Fix typo in functional dependencies docChris Martin
Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2772
2016-12-01testsuite: Add another testcase for #11821Ben Gamari
2016-11-30Revert "Fix windows validate."Tamar Christina
This reverts commit ef37580d16a23d1601795548b13b88b9f5373010. Now that commit e2330b6dde805a5507898c3c4ddf38599df969da has been reverted this change is now needed.
2016-11-30Revert "Make globals use sharedCAF"Ben Gamari
This reverts commit 6f7ed1e51bf360621a3c2a447045ab3012f68575 due to breakage of the build on Windows.
2016-11-30Rename RuntimeRepPolymorphism to LevityPolymorphismSimon Peyton Jones
Richard and I decided to make this change in our paper, and I'm just propagating it to GHC
2016-11-30Tweaks to grammar and such.Gabor Greif
2016-11-30Fix windows validate.Tamar Christina
2016-11-30Update Mingw-w64 bindist for WindowsTamar Christina
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
2016-11-30testsuite: Use python3 by defaultBen Gamari
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
2016-11-30Update test output for WindowsTamar Christina
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
2016-11-30Fix testsuite threading, timeout, encoding and performance issues on WindowsTamar Christina
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
2016-11-29Hoopl/Dataflow: use block-oriented interfaceMichal Terepeta
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
2016-11-29Added Eq1, Ord1, Read1 and Show1 instances for NonEmptyShane
Reviewers: austin, hvr, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2755
2016-11-29Remove most functions from cmm/BlockIdMichal Terepeta
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
2016-11-29rts: Add missing #include <stdbool.h>Ben Gamari
2016-11-29Use C99's boolBen Gamari
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
2016-11-29Fix type of GarbageCollect declarationBen Gamari
Test Plan: Validate Reviewers: simonmar, austin, erikd Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2764
2016-11-29Make globals use sharedCAFMoritz Angermann
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
2016-11-29hschooks.c: Ensure correct header file is includedBen Gamari
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
2016-11-29testsuite: Bump haddock.compiler allocationsBen Gamari
Unfortunately it's quite unclear what caused this.
2016-11-29OrdList: Add Foldable, Traversable instancesBen Gamari
Test Plan: Validate Reviewers: austin, simonmar Reviewed By: simonmar Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2740
2016-11-29NCGMonad: Add MonadUnique NatM instanceBen Gamari
Test Plan: Validate Reviewers: austin, simonmar Reviewed By: simonmar Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2737
2016-11-29AsmCodeGen: Refactor worker in cmmNativeGensBen Gamari
Test Plan: Validate Reviewers: austin, simonmar, michalt Reviewed By: simonmar, michalt Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2736
2016-11-29Use newBlockId instead of newLabelCBen Gamari
This seems like a clearer name and the fewer functions that one needs to remember, the better. Test Plan: validate Reviewers: austin, simonmar, michalt Reviewed By: simonmar, michalt Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2735
2016-11-29Purge GHC of literate PerlDemi Obenour
Test Plan: GHC CI Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: snowleopard, thomie Maniphest Tasks: T74 Differential Revision: https://phabricator.haskell.org/D2732
2016-11-29Refactor Pattern Match Checker to use ListTMatthew Pickering
Reviewers: bgamari, austin Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2725
2016-11-29Replace -fshow-source-paths with -fhide-source-pathsSylvain Henry
This patch reverts the change introduced with 587dcccfdfa7a319e27300a4f3885071060b1f8e and restores the previous default output of GHC (i.e., show source path and object path for each compiled module). The -fhide-source-paths flag can be used to hide these paths and reduce the line noise. Reviewers: gracjan, nomeata, austin, bgamari, simonmar, hvr Reviewed By: hvr Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2728 GHC Trac Issues: #12851
2016-11-29testsuite: Mention CLEANUP option in READMEBen Gamari
Test Plan: Read it Reviewers: austin Subscribers: mpickering, thomie Differential Revision: https://phabricator.haskell.org/D2747
2016-11-29Minor cleanup of foldRegs{Used,Defd}Michal Terepeta
This makes the two functions strict in the accumulator - it seems that there are only two users of those functions: `CmmLive` and `CmmSink` and in both cases the strict fold fits better. The commit also removes a few unused functions (`filterRegsUsed`), instances (for `Maybe` and `RegSet`) and gets rid of unnecessary inculde of `HsVersions.h`. The performance effect of avoiding unnecessary thunks is mostly negligible, although we do allocate a tiny bit less (nofib's section on compile allocations): ``` -1 s.d. ----- -0.2% +1 s.d. ----- -0.1% Average ----- -0.2% ``` Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com> Test Plan: validate Reviewers: simonmar, austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2723
2016-11-29Detect color supportPhil Ruffwind
Test Plan: validate Reviewers: erikd, Phyx, austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2717 GHC Trac Issues: #8809
2016-11-29Make diagnostics slightly more colorfulPhil Ruffwind
This is a preliminary commit to add colors to diagnostics (warning and error messages). The aesthetic changes are: - 'warning', 'error', and 'fatal' are all colored magenta, red, and red respectively. - The warning annotation [-Wsomething] shares the same color. - Warnings and errors are also bolded (this is consistent with what other compilers do). A new flag has been added to control the behavior: -fdiagnostics-color=(always|auto|never) This flag is 'auto' by default. However, auto-detection is not implemented yet, so it effectively it defaults to off. Test Plan: validate Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2716 GHC Trac Issues: #8809
2016-11-29users_guide: Bring 8.0.2 release notes up-to-date with ghc-8.0 branchBen Gamari
I've been editing the release notes on the `ghc-8.0` branch; fold those changes into `master`.
2016-11-29Define thread primitives if they're supported.Shea Levy
On iOS, we use the pthread-based implementation of Itimer.c even for a non-threaded RTS. Since 999c464, this relies on synchronization primitives like Mutex, so ensure those primitives are defined whenever they are supported, even if !THREADED_RTS. Fixes #12799. Reviewers: erikd, austin, simonmar, bgamari Reviewed By: simonmar, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2712 GHC Trac Issues: #12799
2016-11-29Store string as parsed in SourceText for CImportAlan Zimmerman
2016-11-29Typos in commentsGabor Greif
2016-11-29Zonk the free tvs of a RULE lhs to TyVarsSimon Peyton Jones
Previously we were making them into skolem TcTyVars, which is wrong for the output of the type checker, which no TcTyVars should surive. See Note [Zonking the LHS of a RULE] in TcHsSyn This was flushed out by the new IfaceTcTyVar thing; I found some more TcTyVars that were being serialised into an interface file, which is wrong wrong wrong.
2016-11-29Make note of #12881 in 8.0.2 release notesRyan Scott
Summary: Resolves #12881. Test Plan: Read it, commit it, merge it, ship it Reviewers: hvr, simonpj, austin, bgamari Reviewed By: simonpj Subscribers: simonpj, thomie Differential Revision: https://phabricator.haskell.org/D2760 GHC Trac Issues: #12881
2016-11-28Comments only (related to #12789)Simon Peyton Jones
It took me some time to find the right Note for the fix to #12789. This comment patch tries to add pointers from relevant places.
2016-11-28Test Trac #12885Simon Peyton Jones
...which is fixed by commit 0476a64e70c91b326b53db2fc55adbbaa8e5c270 Author: Simon Peyton Jones <simonpj@microsoft.com> Date: Tue Oct 25 15:22:17 2016 +0100 Fix a bug in mk_superclasses_of
2016-11-28Test Trac #12776Simon Peyton Jones
2016-11-28Typos in comments only [ci skip]Gabor Greif