| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Trac #15445 showed that, as a result of CSE, a function with an
automatically generated specialisation RULE could be inlined
before the RULE had a chance to fire.
This patch attaches a NOINLINE[2] activation to the Id, during
CSE, to stop this happening.
See Note [Delay inlining after CSE]
---- Historical note ---
This patch is simpler and more direct than an earlier
version:
commit 2110738b280543698407924a16ac92b6d804dc36
Author: Simon Peyton Jones <simonpj@microsoft.com>
Date: Mon Jul 30 13:43:56 2018 +0100
Don't inline functions with RULES too early
We had to revert this patch because it made GHC itself slower.
Why? It delayed inlining of /all/ functions with RULES, and that was
very bad in TcFlatten.flatten_ty_con_app
* It delayed inlining of liftM
* That delayed the unravelling of the recursion in some dictionary
bindings.
* That delayed some eta expansion, leaving
flatten_ty_con_app = \x y. let <stuff> in \z. blah
* That allowed the float-out pass to put sguff between
the \y and \z.
* And that permanently stopped eta expasion of the function,
even once <stuff> was simplified.
-- End of historical note ---
|
|
|
|
|
|
|
| |
This is pure refactoring, just adding a couple of
definitions to BasicTypes, and using them.
Plus some whitespace stuff.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Having direct access to this field is going to enable Haddock to
compute in batch which modules to load before looking up instances
of external packages.
Reviewers: bgamari, monoidal
Reviewed By: monoidal
Subscribers: rwbarton, carter
Differential Revision: https://phabricator.haskell.org/D5100
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: After a parse error in OPTIONS_GHC issue an error message instead of a compiler panic.
Test Plan: make test TEST=T15053
Reviewers: Phyx, thomie, bgamari, monoidal, osa1
Reviewed By: Phyx, monoidal, osa1
Subscribers: tdammers, osa1, rwbarton, carter
GHC Trac Issues: #15053
Differential Revision: https://phabricator.haskell.org/D5093
|
|
|
|
|
|
|
|
|
| |
As Trac #15577 showed, it was possible for a /homo-kinded/
constraint to trigger the /hetero-kinded/ branch of canCFunEqCan,
and that triggered an infinite loop.
The fix is easier, but there remains a deeper questions: why is
the flattener producing giant refexive coercions?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
hadrian's support for dynamic ways is currently broken (see hadrian#641 [1]).
The stage 1 GHCs that hadrian produces end up producing bad code for
the `iToBase62` function after a few optimisation passes.
In the case where `quotRem` returns (overflowError, 0),
GHC isn't careful enough to realise q is _|_ and happily inlines,
distributes and floats code around until we end up trying to access
index `minBound :: Int` of an array of 62 chars, as a result of inlining
the definition of `quotRem` for Ints, in particular the minBound branch [2].
I will separately look into reproducing the bad transformation on a small
self-contained example and filling a ticket.
[1]: https://github.com/snowleopard/hadrian/issues/641
[2]: https://git.haskell.org/ghc.git/blob/HEAD:/libraries/base/GHC/Real.hs#l366
Test Plan: fixes hadrian#641
Reviewers: bgamari, tdammers
Reviewed By: tdammers
Subscribers: tdammers, rwbarton, carter
Differential Revision: https://phabricator.haskell.org/D5106
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
GHC doesn't know how to handle type families that appear in
class instances. Unfortunately, GHC didn't reject instances where
type families appear in //kinds//, leading to #15515. This is easily
rectified by calling `checkValidTypePat` on all arguments to a class
in an instance (and not just the type arguments).
Test Plan: make test TEST=T15515
Reviewers: bgamari, goldfire, simonpj
Reviewed By: simonpj
Subscribers: simonpj, rwbarton, carter
GHC Trac Issues: #15515
Differential Revision: https://phabricator.haskell.org/D5068
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There was a subtle knot-tying bug in TcHsSyn.zonkTyVarOcc, revealed
in Trac #15552.
I fixed it by
* Eliminating the short-circuiting optimisation in zonkTyVarOcc,
instead adding a finite map to get sharing of zonked unification
variables.
See Note [Sharing when zonking to Type] in TcHsSyn
* On the way I /added/ the short-circuiting optimisation to
TcMType.zonkTcTyVar, which has no such problem. This turned
out (based on non-systematic measurements) to be a modest win.
See Note [Sharing in zonking] in TcMType
On the way I renamed some of the functions in TcHsSyn:
* Ones ending in "X" (like zonkTcTypeToTypeX) take a ZonkEnv
* Ones that do not end in "x" (like zonkTcTypeToType), don't.
Instead they whiz up an empty ZonkEnv.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
GHC 8.4 corresponds to 804, not 840.
Found by Gabor Greif.
Test Plan: Harbormaster
Reviewers: ggreif, bgamari, mpickering
Reviewed By: ggreif
Subscribers: rwbarton, carter
Differential Revision: https://phabricator.haskell.org/D5064
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Long ago, the stable name table and stable pointer tables were one.
Now, they are separate, and have significantly different
implementations. I believe the time has come to finish the split
that began in #7674.
* Divide `rts/Stable` into `rts/StableName` and `rts/StablePtr`.
* Give each table its own mutex.
* Add FFI functions `hs_lock_stable_ptr_table` and
`hs_unlock_stable_ptr_table` and document them.
These are intended to replace the previously undocumented
`hs_lock_stable_tables` and `hs_lock_stable_tables`,
which are now documented as deprecated synonyms.
* Make `eqStableName#` use pointer equality instead of unnecessarily
comparing stable name table indices.
Reviewers: simonmar, bgamari, erikd
Reviewed By: bgamari
Subscribers: rwbarton, carter
GHC Trac Issues: #15555
Differential Revision: https://phabricator.haskell.org/D5084
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
One of the constant folding rules introduced in D2858 is:
```
(L y :-: v) :-: (L x :-: w) -> return $ mkL (y-x) `add` (w `add` v)
```
Or, after removing syntactic noise: `(y - v) - (x - w) ==> (y - x) + (w + v)`.
This is incorrect, since the sign of `v` is changed from negative to positive.
As a consequence, the following program prints `3` when compiled with `-O`:
```
-- This is just subtraction in disguise
minus :: Int -> Int -> Int
minus x y = (8 - y) - (8 - x)
{-# NOINLINE minus #-}
main :: IO ()
main = print (2 `minus` 1)
```
The correct rule is: `(y - v) - (x - w) ==> (y - x) + (w - v)`.
This commit does the fix. I haven't found any other issues with the constant
folding code, but it's difficult to be certain without some automated checking.
Reviewers: bgamari, tdammers
Subscribers: hsyl20, tdammers, rwbarton, carter
GHC Trac Issues: #15569
Differential Revision: https://phabricator.haskell.org/D5109
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
When renaming kind variables in an `LHsQTyVars`, we were
erroneously putting all of the kind variables in the binders
//after// the kind variables in the body, resulting in #15568. The
fix is simple: just swap the order of these two around.
Test Plan: make test TEST=T15568
Reviewers: simonpj, bgamari, goldfire
Reviewed By: goldfire
Subscribers: goldfire, rwbarton, carter
GHC Trac Issues: #15568
Differential Revision: https://phabricator.haskell.org/D5108
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
When converting `ConT`s to `HsTyVar`s in `Convert`, we were
failing to account for the possibility of promoted data constructor
names appearing in a `ConT`, which could result in improper
pretty-printing results (as observed in #15572). The fix is
straightforward: use `Promoted` instead of `NotPromoted` when the
name of a `ConT` is a data constructor name.
Test Plan: make test TEST=T15572
Reviewers: goldfire, bgamari, simonpj, monoidal
Reviewed By: goldfire, simonpj
Subscribers: monoidal, rwbarton, carter
GHC Trac Issues: #15572
Differential Revision: https://phabricator.haskell.org/D5112
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
PrefixPred and AnySuffixPred are not used
since static flags were removed in bbd3c399939.
Test Plan: validate
Reviewers: bgamari, tdammers
Reviewed By: tdammers
Subscribers: rwbarton, carter
Differential Revision: https://phabricator.haskell.org/D5111
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Previously, we were using foldl1 instead, which led to the derived
code to be wrongly associated.
Test Plan: ./validate
Reviewers: RyanGlScott, nomeata, simonpj, bgamari
Reviewed By: RyanGlScott, nomeata
Subscribers: rwbarton, carter
GHC Trac Issues: #10859
Differential Revision: https://phabricator.haskell.org/D5104
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Currently, reifying classes produces class methods with
redundant tyvars and class contexts in their type signatures, such
as in the following:
```lang=haskell
class C a where
method :: forall a. C a => a
```
Fixing this is very straightforward: just apply `tcSplitMethodTy` to
the type of each class method to lop off the redundant parts.
It's possible that this could break some TH code in the wild that
assumes the existence of these tyvars and class contexts, so I'll
advertise this change in the release notes just to be safe.
Test Plan: make test TEST="TH_reifyDecl1 T9064 T10891 T14888"
Reviewers: goldfire, bgamari, simonpj
Reviewed By: simonpj
Subscribers: simonpj, rwbarton, carter
GHC Trac Issues: #15551
Differential Revision: https://phabricator.haskell.org/D5088
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The current pattern-match coverage checker implements the
formalism presented in the //GADTs Meet Their Match// paper in a
fairly faithful matter. However, it was discovered recently that
there is a class of unreachable patterns that
//GADTs Meet Their Match// does not handle: unreachable code due to
strict argument types, as demonstrated in #15305. This patch
therefore goes off-script a little and implements an extension to
the formalism presented in the paper to handle this case.
Essentially, when determining if each constructor can be matched on,
GHC checks if its associated term and type constraints are
satisfiable. This patch introduces a new form of constraint,
`NonVoid(ty)`, and checks if each constructor's strict argument types
satisfy `NonVoid`. If any of them do not, then that constructor is
deemed uninhabitable, and thus cannot be matched on. For the full
story of how this works, see
`Note [Extensions to GADTs Meet Their Match]`.
Along the way, I did a little bit of much-needed refactoring. In
particular, several functions in `Check` were passing a triple of
`(ValAbs, ComplexEq, Bag EvVar)` around to represent a constructor
and its constraints. Now that we're adding yet another form of
constraint to the mix, I thought it appropriate to turn this into
a proper data type, which I call `InhabitationCandidate`.
Test Plan: make test TEST=T15305
Reviewers: simonpj, bgamari
Reviewed By: simonpj
Subscribers: rwbarton, carter
GHC Trac Issues: #15305
Differential Revision: https://phabricator.haskell.org/D5087
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
When turning an `IntegerL` to an `IntegralLit` during TH
conversion, we were stupidly casting an `Integer` to an `Int` in
order to determine how it should be pretty-printed. Unsurprisingly,
this causes problems when the `Integer` doesn't lie within the bounds
of an `Int`, as demonstrated in #15502.
The fix is simple: don't cast to an `Int`.
Test Plan: make test TEST=T15502
Reviewers: bgamari, simonpj
Reviewed By: simonpj
Subscribers: simonpj, rwbarton, carter
GHC Trac Issues: #15502
Differential Revision: https://phabricator.haskell.org/D5089
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
When converting a `RuleP` to a GHC source `RuleD` during TH
conversion, we were stupidly not double-quoting the name of the rule.
Easily fixed.
Test Plan: make test TEST=T15550
Reviewers: goldfire, bgamari, simonpj
Reviewed By: simonpj
Subscribers: simonpj, rwbarton, carter
GHC Trac Issues: #15550
Differential Revision: https://phabricator.haskell.org/D5090
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This completes the work started in D4227 by using just 'getExecutablePath'
in ghc and ghc-pkg when building with base >= 4.11.0.
On the long term, we will be able to simply kill the existing code that
follows (or not) symlinks and just get this behaviour for free from
getExecutable. For now we however have to require base >= 4.11.0 to be able
to just use getExecutablePath under Windows, and use the current code when
building with an older base.
Original code by @alpmestan commandeering since patch has been stale
and bug remains open.
Test Plan: Validate
Reviewers: angerman, bgamari, erikd, alpmestan
Reviewed By: bgamari
Subscribers: carter, rwbarton, thomie
GHC Trac Issues: #14483
Differential Revision: https://phabricator.haskell.org/D4229
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch fixes Trac #15558. There turned out to be
two distinct problems
* In TcExpr.tc_poly_expr_nc we had
tc_poly_expr_nc (L loc expr) res_ty
= do { traceTc "tcPolyExprNC" (ppr res_ty)
; (wrap, expr')
<- tcSkolemiseET GenSigCtxt res_ty $ \ res_ty ->
setSrcSpan loc $
-- NB: setSrcSpan *after* skolemising,
-- so we get better skolem locations
tcExpr expr res_ty
Putting the setSrcSpan inside the tcSkolemise means that
the location on the Implication constraint is the /call/
to the function rather than the /argument/ to the call,
and that is really quite wrong.
I don't know what Richard's comment NB means -- I moved the
setSrcSpan outside, and the "binding site" info in error
messages actually improved.
The reason I found this is that it affects the span reported
for Trac #15558.
* In TcErrors.mkGivenErrorReporter we carefully munge the location
for an insoluble Given constraint (Note [Inaccessible code]).
But the 'implic' passed in wasn't necesarily the immediately-
enclosing implication -- but for location-munging purposes
it jolly well should be.
Solution: use the innermost implication. This actually
simplifies the code -- no need to pass an implication in to
mkGivenErrorReporter.
|
|
|
|
|
| |
Provoked by discussion on Phab:D5097 (Trac #15546), I'm adding
a big Note explaing the strategy of pretty-printing via IfaceSyn
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Triggered by Trac #15552, I'd been looking at ZonkEnv in TcHsSyn.
This patch does some minor refactoring
* Make ZonkEnv into a record with named fields, and use them.
(I'm planning to add a new field, for TyCons, so this prepares
the way.)
* Replace UnboundTyVarZonker (a higer order function) with the
simpler and more self-descriptive ZonkFlexi data type, below.
It's just much more perspicuous and direct, and (I suspect)
a tiny bit faster too -- no unknown function calls.
data ZonkFlexi -- See Note [Un-unified unification variables]
= DefaultFlexi -- Default unbound unificaiton variables to Any
| SkolemiseFlexi -- Skolemise unbound unification variables
-- See Note [Zonking the LHS of a RULE]
| RuntimeUnkFlexi -- Used in the GHCi debugger
There was one knock-on effect in the GHCi debugger -- the
RuntimeUnkFlexi case. Somehow previously, these RuntimeUnk
variables were sometimes getting SystemNames (and hence
printed as 'a0', 'a1', etc) and sometimes not (and hence
printed as 'a', 'b' etc). I'm not sure precisely why, but
the new behaviour seems more uniform, so I just accepted the
(small) renaming wibbles in some ghci.debugger tests.
I had a quick look at perf: any changes are tiny.
|
|
|
|
|
| |
Sadly macOS's C preprocessor gets angry at the sight of multi-line macro
invocations.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In this patch
commit 6eabb6ddb7c53784792ee26b1e0657bde7eee7fb
Author: Simon Peyton Jones <simonpj@microsoft.com>
Date: Tue Dec 15 14:26:13 2015 +0000
Allow recursive (undecidable) superclasses
I changed (transSuperClasses p) to return only the
superclasses of p, but not p itself. (Previously it always
returned p as well.)
The use of transSuperClasses in TcErrors.warnRedundantConstraints
really needs 'p' in the result -- but I faild to fix this
call site, and instead crippled the test for Trac #10100.
This patch sets things right
* Accomodates the API change
* Re-enables T10100
* And thereby fixes Trac #11474
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In error message generation we were using the wrong
type constructor in inst_head. Result: the type became
ill-kinded, and that sent the compiler into a loop.
A separate patch fixes the loop. This patch fixes the
actual bug -- Trac #15473.
I also improved the "occurs more often" error message
a bit. But it's still pretty terrible:
* Variable ‘a’ occurs more often
in the type family application ‘Undefined’
than in the instance head ‘LetInterleave xs t ts is y z’
It looks like nonsense, but all becomes clear if you use
-fprint-explicit-kinds. Really we should fix this by spotting
when invisible arguments are involved and at least suggesting
-fprint-explicit-kinds.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In these two functions
* TcIface.toIfaceAppTyArgsX
* Type.piResultTys
we take a type application (f t1 .. tn) and try to find
its kind. It turned out that, if (f t1 .. tn) was ill-kinded
the function would go into an infinite loop.
That's not good: it caused the loop in Trac #15473.
This patch doesn't fix the bug in #15473, but it does turn the
loop into a decent panic, which is a step forward.
|
|
|
|
|
|
|
|
| |
This reverts commit 1cc9061fce4270739677d475190fd6e890e8b1f9.
This appears to break a clean build with certain versions of
`ld.gold`. See
https://phabricator.haskell.org/rGHC1cc9061fce42#132967.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds a new primop called traceBinaryEvent# that takes the length
of binary data and a pointer to the data, then emits it to the eventlog.
There is some example code that uses this primop and the new event:
* [traceBinaryEventIO][1] that calls `traceBinaryEvent#`
* [A patch to ghc-events][2] that parses the new `EVENT_USER_BINARY_MSG`
There's no corresponding issue on Trac but it was discussed at
ghc-devs [3].
[1] https://github.com/maoe/ghc-trace-events/blob
/fb226011ef1f85a97b4da7cc9d5f98f9fe6316ae/src/Debug/Trace/Binary.hs#L29)
[2] https://github.com/maoe/ghc-events/commit
/239ca77c24d18cdd10d6d85a0aef98e4a7c56ae6)
[3] https://mail.haskell.org/pipermail/ghc-devs/2018-May/015791.html
Reviewers: bgamari, erikd, simonmar
Reviewed By: bgamari
Subscribers: rwbarton, thomie, carter
Differential Revision: https://phabricator.haskell.org/D5007
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: hvr, bgamari, simonmar, jrtc27
Reviewed By: bgamari
Subscribers: alpmestan, rwbarton, thomie, carter
Differential Revision: https://phabricator.haskell.org/D5034
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Calculating which modules to load based on the InteractiveContext means
maintaining a potentially very large GblRdrEnv.
In Haddock's case, it is much cheaper (from a memory perspective) to
just keep track of which modules interfaces we want loaded then hand
these off explicitly to 'getNameToInstancesIndex'.
Bumps haddock submodule.
Reviewers: alexbiehl, bgamari
Reviewed By: alexbiehl
Subscribers: rwbarton, thomie, carter
Differential Revision: https://phabricator.haskell.org/D5003
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch has virtually no effect on anything (according to a
nofib run). But it simplifies the definition of interesting_call
by being a bit less gung-ho about inlining nested function
bindings. See Note [Nested functions]
-----------------------------------------------------------------------
Program Size Allocs Runtime Elapsed TotalMem
-----------------------------------------------------------------------
anna +0.2% -0.0% 0.163 0.163 0.0%
binary-trees +0.1% +0.0% -4.5% -4.5% 0.0%
cacheprof -0.1% +0.1% -4.7% -4.8% +2.7%
fasta +0.2% 0.0% +2.6% +3.0% 0.0%
fluid -0.0% -0.6% 0.011 0.011 0.0%
gamteb -0.1% -0.0% 0.069 0.070 0.0%
hpg +0.1% +0.0% +0.7% +0.7% 0.0%
infer +0.3% +0.2% 0.097 0.098 0.0%
lambda -0.1% -0.0% +2.0% +2.0% 0.0%
n-body +0.1% -0.1% -0.1% -0.1% 0.0%
simple -0.2% -0.2% +0.6% +0.6% 0.0%
spectral-norm +0.1% -0.0% -0.1% -0.1% 0.0%
tak -0.0% -0.1% 0.024 0.024 0.0%
--------------------------------------------------------------------------------
Min -0.4% -0.6% -5.3% -5.3% 0.0%
Max +0.3% +0.2% +3.3% +3.3% +15.0%
Geometric Mean -0.0% -0.0% -0.3% -0.3% +0.2%
(cherry picked from commit 33de71fa06d03e6da396a7c0a314fea3b492ab91)
(This reverts the previous reversion in commit
9dbf66d74e65309d02c9d700094e363f59c94096)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: `make test=T10869`
Reviewers: mpickering, thomie, ezyang, bgamari
Reviewed By: thomie, bgamari
Subscribers: rwbarton, carter
GHC Trac Issues: #10869
Differential Revision: https://phabricator.haskell.org/D4861
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds foldl' to GhcPrelude and changes must occurences
of foldl to foldl'. This leads to better performance especially
for quick builds where GHC does not perform strictness analysis.
It does change strictness behaviour when we use foldl' to turn
a argument list into function applications. But this is only a
drawback if code looks ONLY at the last argument but not at the first.
And as the benchmarks show leads to fewer allocations in practice
at O2.
Compiler performance for Nofib:
O2 Allocations:
-1 s.d. ----- -0.0%
+1 s.d. ----- -0.0%
Average ----- -0.0%
O2 Compile Time:
-1 s.d. ----- -2.8%
+1 s.d. ----- +1.3%
Average ----- -0.8%
O0 Allocations:
-1 s.d. ----- -0.2%
+1 s.d. ----- -0.1%
Average ----- -0.2%
Test Plan: ci
Reviewers: goldfire, bgamari, simonmar, tdammers, monoidal
Reviewed By: bgamari, monoidal
Subscribers: tdammers, rwbarton, thomie, carter
Differential Revision: https://phabricator.haskell.org/D4929
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When parsing a nested comment or nested doc comment in the lexer, if we
see a line starting with '#' we attempt to parse a #line pragma. This
fixes how ghc handles output of the C preproccesor (-cpp flag) when the
original source has C comments or pragmas inside haskell comments.
Updates haddock submodule.
Test Plan: ./validate
Reviewers: bgamari
Reviewed By: bgamari
Subscribers: rwbarton, thomie, carter
GHC Trac Issues: #314
Differential Revision: https://phabricator.haskell.org/D4934
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In https://github.com/gentoo-haskell/gentoo-haskell/issues/704
user explicitly uses -Wl,--relax for most built binaries.
Most of the time this works fine except for capi haskell code
similar to the following:
```haskell
{-# LANGUAGE CApiFFI #-}
module Z where
import Foreign.C
foreign import capi "unistd.h close" c_close :: CInt -> IO CInt
```
In this case compilation fails as:
```
$ inplace/bin/ghc-stage2 -c Z.hs -optl-Wl,--relax -fforce-recomp
ld: --relax and -r may not be used together
```
GHC's driver already disables relaxation on sparc as there relaxation
is already a default mode.
This change disables relaxation on partial linking for all platforms
where linker is binutils linker.
Reported-by: wmyrda
Bug: https://github.com/gentoo-haskell/gentoo-haskell/issues/704
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Test Plan: pass -optl-Wl,--relax in test above
Reviewers: bgamari
Reviewed By: bgamari
Subscribers: rwbarton, thomie, carter
Differential Revision: https://phabricator.haskell.org/D4888
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Trac #15505 showed that, when we have a type error, we
could have an unfilled-in coercion hole. We don't want an
assertion error in that case.
The underlying cause is that tcClassDecl1 should call
solveEqualities to fully solve all top-level equalities
(or fail in the attempt).
I also refactored the ClassDecl case for tcTyClDecl1 into
a new function tcClassDecl1. That makes it symmetrical
with the others.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Trac #15487 correctly reported that the qualification
of a Name in an ambiguous-occurrence error message was
wrong. This patch fixes it.
It's easily done, in RnUtils.addNameClashErrRn
The problem was that in complaining about M.x we must
enusre that 'M' part is the same as that used in
pprNameProvenance.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We were failing to keep correct strictness info when eta-expanding
join points; Trac #15517. The situation was something like
\q v eta ->
let j x = error "blah
-- STR Lx bottoming!
in case y of
A -> j x eta
B -> blah
C -> j x eta
So we spot j as a join point and eta-expand it. But we must
also adjust the stricness info, else it vlaimes to bottom after
one arg is applied but now it has become two.
I fixed this in two places:
- In CoreOpt.joinPointBinding_maybe, adjust strictness info
- In SimplUtils.tryEtaExpandRhs, return consistent values
for arity and bottom-ness
|
|
|
|
|
|
|
|
|
|
|
| |
In TcErrors, cec_suppress is used to suppress low-priority
errors in favour of truly insoluble ones.
But I was failing to initialise it correcly at top level, which
resulted in Trac #15539. Easy to fix.
A few regression tests have fewer errors reported, but that seems to
be an improvement.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
After commit ef26182e2014b0a2a029ae466a4b121bf235e4e4,
the type variable binders in GADT constructor type signatures
are now quantified in toposorted order, instead of always having
all the universals before all the existentials. Unfortunately, that
commit forgot to update some code (which was assuming the latter
scenario) in `DsExpr` which desugars record updates. This wound
up being the cause of #15499.
This patch makes up for lost time by desugaring record updates in
a way such that the desugared expression applies type arguments to
the right-hand side constructor in the correct order—that is, the
order in which they were quantified by the user.
Test Plan: make test TEST=T15499
Reviewers: simonpj, bgamari
Reviewed By: simonpj
Subscribers: rwbarton, carter
GHC Trac Issues: #15499
Differential Revision: https://phabricator.haskell.org/D5060
|