| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There was an awful leak where GHC permitted standalone `deriving`
declarations to create instances for unboxed sum or tuple types. This
fortifies the checks that GHC performs to catch this scenario and give
an appropriate error message.
Fixes #11509.
Test Plan: ./validate
Reviewers: goldfire, austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2557
GHC Trac Issues: #11509
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When DuplicateRecordFields is enabled, the mangling of selector names
was causing them to be reported as unused even if prefixed by an
underscore. This corrects the OccName used by the check.
Test Plan: New test overloadedrecflds/should_compile/T12609
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2549
GHC Trac Issues: #12609
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously the renamer assumed that *any* time we renamed a pattern, the
pattern was introducing new binders. This isn't true in pattern synonym
declarations where the pattern is used as part of a definition.
We add a special case to not warn in this situation.
Reviewers: simonpj, austin, bgamari
Reviewed By: simonpj
Subscribers: simonpj, thomie
Differential Revision: https://phabricator.haskell.org/D2545
GHC Trac Issues: #12615
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We were missing an appropiate *ConLike lookup in the case when
the pattern synonym was defined in a different module.
Reviewers: austin, bgamari, simonpj
Reviewed By: simonpj
Subscribers: simonpj, thomie
Differential Revision: https://phabricator.haskell.org/D2544
GHC Trac Issues: #11987
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: `validate --slow`
Reviewers: austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2536
GHC Trac Issues: #12019
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The shadowed out bindings are accessible via qualified names like
Ghci1.foo. Since they are accessable in the renamer the typechecker
should be able to see them too. As a consequence they show up in :show
bindings.
This fixes T11547
Test Plan:
Fixed current tests to accomodate to new stuff in :show bindings
Added a test that verifies that the typechecker doesn't crash
Reviewers: austin, bgamari, simonpj
Reviewed By: simonpj
Subscribers: simonpj, thomie
Differential Revision: https://phabricator.haskell.org/D2447
GHC Trac Issues: #11547
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Foreign calls (unsafe and safe) interact badly with inlining and
register passing ABIs (see #11792 and #12614):
the inlined code to compute a parameter of the call may overwrite a
register already set to pass a preceding parameter.
With this patch, we compute all parameters which are not simple
expressions before assigning them to fixed registers required by the
ABI.
Test Plan:
- Add test (test both reg and stack parameters)
- Validate
Reviewers: osa1, bgamari, austin, simonmar
Reviewed By: simonmar
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2263
GHC Trac Issues: #11792, #12614
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Allows users to explicitly request which approach to `deriving` to use
via keywords, e.g.,
```
newtype Foo = Foo Bar
deriving Eq
deriving stock Ord
deriving newtype Show
```
Fixes #10598. Updates haddock submodule.
Test Plan: ./validate
Reviewers: hvr, kosmikus, goldfire, alanz, bgamari, simonpj, austin,
erikd, simonmar
Reviewed By: alanz, bgamari, simonpj
Subscribers: thomie, mpickering, oerjan
Differential Revision: https://phabricator.haskell.org/D2280
GHC Trac Issues: #10598
|
|
|
|
|
| |
This test uses wholesale impredicative polymorphism, and now fails.
That's ok.
|
|
|
|
| |
..accidentally omitted from previous commit.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch fixes Trac #12616.
Dignosis. In TcUnify.tc_sub_type_ds we were going to some trouble to
support co- and contra-variance even for impredicative types. With
-XImpredicativeTYpes, this allowed a unification variable to be
unified with a polytype (probably wrongly) and that caused later
trouble in the constraint solver, where -XImpredicativeTypes was /not/
on. In effect, -XImpredicativeTypes can't be switched on locally.
Why did we want ImpredicativeTypes locally? Because the program
generated by GND for a higher-rank method involved impredicative
instantation of 'coerce':
op = coerce op -- where op has a higher rank type
See Note [Newtype-deriving instances] in TcGenDeriv.
Cure.
1. It is ghastly to rely on ImpredicativeTypes (a 100% flaky
feature) to instantiate coerce polymorphically. Happily we
now have Visible Type Application, so I've used that instead
which should be solid and reliable.
2. I deleted the code in tc_sub_type_ds that allows the constraint
solver to "look through" a unification variable to find a
polytype. That used to be essential in the days of ReturnTv,
but it's utterly unreliable and should be consigned to the dustbin
of history. (We have ExpType now for the essential uses.)
Tests involving ImpredicativeTypes are affected, but I'm not worried
about them... it's advertised as a feature you can't rely on, and
I want to reform it outright.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1. Trac #12593 exposed a long-standing bug in the occurs
checking machinery. When unifying two type variables
a ~ b
where a /= b, we were assuming that there could be
no occurs-check error. But there can: 'a' can occur
in b's kind! When the RHS was a non-tyvar we used
occurCheckExpand, which /did/ look in kinds, but not
when the RHS was a tyvar.
This bug has been lurking ever since TypeInType, maybe
longer. And it was present both in TcUnify (the on-the-fly
unifier), and in TcInteract.
I ended up refactoring both so that the tyvar/tyvar
path naturally goes through the same occurs-check as
non-tyvar rhss. It's simpler and more robust now.
One good thing is that both unifiers now share
TcType.swapOverVars
TcType.canSolveByUnification
previously they had different logic for the same goals
2. Fixing this bug exposed another! In T11635 we end
up unifying
(alpha :: forall k. k->*) ~ (beta :: forall k. k->*)
Now that the occurs check is done for tyvars too, we
look inside beta's kind. And then reject the program
becuase of the forall inside there. But in fact that
forall is fine -- it does not count as impredicative
polymoprhism. See Note [Checking for foralls]
in TcType.
3. All this fuss around occurrence checking forced me
to look at TcUnify.checkTauTvUpdate
and TcType.occurCheckExpand
There's a lot of duplication there, and I managed
to elminate quite a bit of it. For example,
checkTauTvUpdate called a local 'defer_me'; and then
called occurCheckExpand, which then used a very
similar 'fast_check'.
Things are better, but there is more to do.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch fixes Trac #12595. The problem was with a
pattern binding like
!x = e
For a start it's silly to match that pattern and build
a unit tuple (the General Case of mkSelectorBinds); but
that's what was happening because the bang fell through
to the general case. But for a variable pattern building
any auxiliary bindings is stupid. So the patch
introduces a new case in mkSelectorBinds for variable
patterns.
Then it turned out that if 'e' was a plain variable, and
moreover was imported GlobalId, then matchSinglePat made
it a /bound/ variable, which should never happen. That
ultimately caused a linker error, but the original bug
was much earlier.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With this patch we stop generating virtual semicolons in MultiWayIf
guards. Fixes #10807.
Test Plan:
Reviewers: simonmar, austin, bgamari
Reviewed By: simonmar
Subscribers: mpickering, thomie
Differential Revision: https://phabricator.haskell.org/D2524
GHC Trac Issues: #10807
|
|
|
|
|
| |
This fixes Trac #12597: in RnNames.warnMissingSignatures,
use pprSigmaType not pprType
|
| |
|
|
|
|
|
|
|
|
|
|
| |
as the latter is the official, correct spelling, and the former just a
misspelling accepted by GHC.
Also document in the user’s guide that the alternative spelling is
accepted
This commit was brough to you by HIW 2016.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The problem is described in the ticket.
This patch adds new variants of the access points to the pure
unifier that allow unification of types only when the caller
wants this behavior. (The unifier used to also unify kinds.)
This behavior is appropriate when the kinds are either already
known to be the same, or the list of types provided are a
list of well-typed arguments to some type constructor. In the
latter case, unifying earlier types in the list will unify the
kinds of any later (dependent) types.
At use sites, I went through and chose the unification function
according to the criteria above.
This patch includes some modest performance improvements as we
are now doing less work.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Test T12504 does it's checking in the Makefile using grep but still specified an stdout.
the stdout has the old output and would always fail.
Since the stdout isn't needed, let's not check it.
Test Plan: make test TEST=T12504
Reviewers: bgamari, austin, erikd, rcook
Reviewed By: rcook
Subscribers: thomie, #ghc_windows_task_force
Differential Revision: https://phabricator.haskell.org/D2537
GHC Trac Issues: #12504
|
|
|
|
| |
basically using the machinery from the test case of #2110.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
* getNonClobberedReg instead of getSomeReg, because the reg needs to
survive across t_code
* Use a new reg for the table offset calculation instead of clobbering
the reg returned by expr (this was the bug affecting #12433)
Test Plan: New unit test; validate
Reviewers: rwbarton, bgamari, austin, erikd
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2529
GHC Trac Issues: #12433
|
|
|
|
|
|
| |
Sigh. I added some comments to the source files,
and failed to revalidate. But the comments change the
line number in the error messages. Doh.
|
|
|
|
|
|
|
|
|
|
|
| |
I must have failed to validate properly, sorry.
These testsuite wibbles belong with
commit 03541cbae50f0d1cdf99120ab88698f29a278159
Author: Simon Peyton Jones <simonpj@microsoft.com>
Date: Fri Sep 9 17:42:42 2016 +0100
Be less picky about reporing inaccessible code
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Triggered by the discussion on Trac #12466, this patch
makes GHC less aggressive about reporting an error when
there are insoluble Givens.
Being so agressive was making some libraries fail to
compile, and is arguably wrong in at least some cases.
See the discussion on the ticket.
Several test now pass when they failed before; see
the files-modified list for this patch.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This is a fast, non-blocking, asynchronous, interface to tryPutMVar that
can be called from C/C++.
It's useful for callback-based C/C++ APIs: the idea is that the callback
invokes hs_try_putmvar(), and the Haskell code waits for the callback to
run by blocking in takeMVar.
The callback doesn't block - this is often a requirement of
callback-based APIs. The callback wakes up the Haskell thread with
minimal overhead and no unnecessary context-switches.
There are a couple of benchmarks in
testsuite/tests/concurrent/should_run. Some example results comparing
hs_try_putmvar() with using a standard foreign export:
./hs_try_putmvar003 1 64 16 100 +RTS -s -N4 0.49s
./hs_try_putmvar003 2 64 16 100 +RTS -s -N4 2.30s
hs_try_putmvar() is 4x faster for this workload (see the source for
hs_try_putmvar003.hs for details of the workload).
An alternative solution is to use the IO Manager for this. We've tried
it, but there are problems with that approach:
* Need to create a new file descriptor for each callback
* The IO Manger thread(s) become a bottleneck
* More potential for things to go wrong, e.g. throwing an exception in
an IO Manager callback kills the IO Manager thread.
Test Plan: validate; new unit tests
Reviewers: niteria, erikd, ezyang, bgamari, austin, hvr
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2501
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Standalone-derived `Ix` instances would panic on GADTs with exactly
one constructor, since the list of fields was being passed to a function that
uses `foldl1` in order to generate an implementation for `inRange`. This adds a
simple check that makes `inRange` be `True` whenever a product type has no
fields.
Fixes #12583.
Test Plan: make test TEST=12583
Reviewers: simonpj, austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2521
GHC Trac Issues: #12583
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: Validate
Reviewers: austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2517
GHC Trac Issues: #11433
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change should close #11108 by fixing the test case.
This commit fixes two issues:
* Make sure that each weak pointer we allocate has a constructor as the
key, not a thunk. A failure to do so meant these weak pointers died
prematurely on the 'ghci' WAY.
* Don't print anything in the finalizer, because they are not guaranteed
to run.
Test Plan: validate
Reviewers: austin, simonmar, erikd, bgamari
Reviewed By: erikd, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2512
GHC Trac Issues: #11108
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
For some inexplicable reason, the `Generic` instance in
`perf/compiler/T5642` is written out entirely by hand. This is not only
strange, since Trac #5642 is about derived `Generic` instances, but it also
annoying to maintain, since it requires manually changing a bunch of code
whenever the algorithm behind `deriving Generic` changes. (See D2304 for a
recent example of this.)
It seems more sensible to just derive the `Generic` instance. It shifts the
goalposts of what allocations we're measuring a bit, since we no longer have
to parse a large amount of code (and as a knock-on effect, the allocations go
down a bit). But I think this program is morally equivalent to what we were
benchmarking before, so it's not too unreasonable to change.
Test Plan: make test TEST=T5642
Reviewers: austin, thomie, bgamari
Reviewed By: bgamari
Differential Revision: https://phabricator.haskell.org/D2511
GHC Trac Issues: #5642
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: simonpj, bgamari, RyanGlScott, austin
Reviewed By: simonpj
Subscribers: nomeata, simonpj, thomie
Differential Revision: https://phabricator.haskell.org/D2502
GHC Trac Issues: #10858
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: Corrected a few tests to include the new message.
Reviewers: goldfire, austin, bgamari
Reviewed By: bgamari
Subscribers: goldfire, thomie
Differential Revision: https://phabricator.haskell.org/D2484
GHC Trac Issues: #12546
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This implements #5615 for divInt# and modInt#.
I also included rules to do constant-folding when the both arguments
are known.
Test Plan: validate
Reviewers: austin, simonmar, bgamari
Reviewed By: bgamari
Subscribers: hvr, thomie
Differential Revision: https://phabricator.haskell.org/D2486
GHC Trac Issues: #5615
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Module finalizer could call addTopDecls, however, the declarations
added in this fashion were ignored. This patch makes sure to rename,
type check and incorporate this declarations.
Because a declaration may include a splice which calls addModFinalizer,
the list of finalizers is repeteadly checked after adding declarations
until no more finalizers remain.
Test Plan: ./validate
Reviewers: bgamari, goldfire, simonpj, austin
Reviewed By: bgamari, simonpj
Subscribers: simonmar, mboes, thomie
Differential Revision: https://phabricator.haskell.org/D2505
GHC Trac Issues: #12559
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: simonmar, austin, bgamari, thomie, rwbarton
Differential Revision: https://phabricator.haskell.org/D2509
GHC Trac Issues: #10923
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
With the introduction of 8.0.1 We've stopped supporting in GHCi
the use of POSIX functions under their deprecated names on Windows.
This to be compatible with object and libraries from the most
popular compilers on the platform (Microsoft and Intel compilers).
However this brings a confusing disparity between the compiled and
interpreted behavior since MingW-W64 does support the deprecated names.
Also It seems clear that package writers won't update their packages to
properly support Windows. As such I have added redirects in the RTS
for the deprecated functions as listed on
https://msdn.microsoft.com/en-us/library/ms235384.aspx.
This won't export the functions (as in, they won't be in the symbol table
of compiled code for the RTS.) but we inject them into the symbol table
of the dynamic linker at startup.
Test Plan:
./validate
and
make test TEST="ffi017 ffi021"
Reviewers: thomie, simonmar, RyanGlScott, bgamari, austin, hvr, erikd
Reviewed By: simonmar, bgamari
Subscribers: RyanGlScott, #ghc_windows_task_force
Differential Revision: https://phabricator.haskell.org/D2500
GHC Trac Issues: #12209, #12497, #12496
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
startsVarSym used isSymbol which does not recognize valid operators
beginning with OtherPunctuation generalCategory (e. g. (·)).
Move it to ghc-boot-th for reducing duplication.
This patch fixes template-haskell pretty printer, which is used by
-ddump-minimal-imports.
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2480
GHC Trac Issues: #4239
|
|
|
|
|
| |
This reverts commit 8d35e18d885e60f998a9dddb6db19762fe4c6d92.
arc butchered the authorship on this.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
startsVarSym used isSymbol which does not recognize valid operators
beginning with OtherPunctuation generalCategory (e. g. (·)).
Move it to ghc-boot-th for reducing duplication.
This patch fixes template-haskell pretty printer, which is used by
-ddump-minimal-imports.
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2480
GHC Trac Issues: #4239
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
maxWorkerArgs handling was accidentally lost 3 years ago
in a major update of demand analysis
commit 0831a12ea2fc73c33652eeec1adc79fa19700578
Old regression is noticeable as:
- code bloat (requires stack reshuffling)
- compilation slowdown (more code to optimise/generate)
- and increased heap usage (DynFlags unboxing/reboxing?)
On a simple compile benchmark this change causes heap
allocation drop from 70G don to 67G (ghc perf build).
Signed-off-by: Sergei Trofimovich <siarheit@google.com>
Reviewers: simonpj, ezyang, goldfire, austin, bgamari
Reviewed By: simonpj, ezyang
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2503
GHC Trac Issues: #11565
|
|
|
|
|
|
|
| |
This reverts commit ca6d0eb0f7d28b0245abc2b0783141101e51945f.
I'm really not sure what happened with the test build that lead me to
believe that this was necessary. Mysterious.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We need to compare against the local return and pure, not returnMName
and pureAName.
Fixes #12490.
Test Plan: Validate, add testcase
Reviewers: austin, simonmar
Reviewed By: simonmar
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2499
GHC Trac Issues: #12490
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Removes -Wredundant-constraints from -Wall, as per the
discussion in #10635.
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2498
GHC Trac Issues: #10635
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: simonpj, thomie, austin, bgamari
Reviewed By: simonpj, thomie, bgamari
Subscribers: simonpj, thomie
Differential Revision: https://phabricator.haskell.org/D2458
GHC Trac Issues: #12170
|
|
|
|
|
| |
Sadly I don't know precisely which commit regressed this, but it was
quite recent. I'm not sure how this wasn't caught by my test builds.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: it's just a testcase
Reviewers: ezyang, simonmar, bgamari, austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2450
GHC Trac Issues: #12485
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Just as it says on the can
Test Plan: validate
Reviewers: austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2489
GHC Trac Issues: #12091
|