| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
In 0d3bf62092de83375025edca6f7242812338542d, I handled lazy @(Int -> Int) f x
correctly, but failed to handle lazy @Int (f x) (we need
to collect arguments in f x). Additionally, if we have
lazy @Int (case ...) (or anything that's not an application,
we have to bounce back to cpeRhsE.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: simonpj, nomeata, austin, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2471
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Back when derived `Generic` instances used to generate auxiliary datatypes,
they would also generate instances for those datatypes. Nowadays, GHC generics
uses a `DataKinds`-based encoding that requires neither auxiliary datatypes
(corresponding to the `DerivTyCon` constructor of `DerivStuff`) nor instances
for them (the `DerivInst` constructor of `DerivStuff`). It appears that
`DerivTyCon` constructor was removed at some point, but `DerivInst` never was.
No `DerivInst` values are ever constructed, so we can safely remove it.
Test Plan: It builds
Reviewers: austin, hvr, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2481
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Fixes #12530.
Test Plan: make test TEST=12530
Reviewers: austin, bgamari, hvr, goldfire
Reviewed By: goldfire
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2472
GHC Trac Issues: #12530
|
|
|
|
| |
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes Trac #12531:
class Foo x where
foo :: forall a . x a -> x a
default foo :: forall b . x b -> x b
foo x = go
where go :: x b
go = undefined
We want 'b' to scope over the code for 'foo', but we were
using 'a' instead.
|
|
|
|
| |
The import of UniqFM in HscTypes was only needed in stage2
|
|
|
|
|
|
| |
This one-line change fixes Trac #12531. Hooray.
Simple, non-invasive; can merge to 8.0.2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove the doc targets completely not partially when disabled.
Otherwise even though we are able to build the targets but we will see
some strange errors.
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2470
|
|
|
|
|
| |
indicating that it is bottom. This should help making the "empty cases"
lint error give less false alarms.
|
|
|
|
|
| |
as proposed in #12435, as it easily gets in the way of development when
it reports false positives.
|
|
|
|
|
|
|
| |
Any variable with useful information (strict or used-once) will not be
included in lazy_fv (according to splitFVs). If we now also remove them
from the strictness signatures, their uses are not recorded anywhere –
and then probably considered absent.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
this fixes #12368.
It also refactors dmdFix a bit, removes some redundancies (such as
passing around an strictness signature right next to an id, when that id
is guaranteed to have been annotated with that strictness signature).
Note that when fixed-point iteration does not terminate, we
conservatively delete their strictness signatures (set them to nopSig).
But this loses the information on how its strict free variables are
used!
Lazily used variables already escape via lazy_fvs. We ensure that in the
case of an aborted fixed-point iteration, also the strict variables are
put there (with a conservative demand of topDmd).
Differential Revision: https://phabricator.haskell.org/D2392
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds new constructors `UnboxedSumE`, `UnboxedSumT`, and
`UnboxedSumP` to represent unboxed sums in Template Haskell.
One thing you can't currently do is, e.g., `reify ''(#||#)`, since I
don't believe unboxed sum type/data constructors can be written in
prefix form. I will look at fixing that as part of #12514.
Fixes #12478.
Test Plan: make test TEST=T12478_{1,2,3}
Reviewers: osa1, goldfire, austin, bgamari
Reviewed By: goldfire, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2448
GHC Trac Issues: #12478
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replaced error-prone index manipulation on a pointer array with
a simple fold on the array elements.
Test Plan: Added a test case that triggers the bug
Reviewers: hvr, austin, bgamari
Reviewed By: bgamari
Subscribers: simonpj, thomie
Differential Revision: https://phabricator.haskell.org/D2439
GHC Trac Issues: #12458
|
|
|
|
| |
#12520 was already fixed in HEAD. Adding a test to make sure it stays fixed.
|
|
|
|
|
|
|
|
| |
The changes in #12403 and #12513 subtly changed the behavior of Template
Haskell reification and splicing. While the old behavior was certainly buggy,
it's possible that there's code in the wild that depended on the old behavior
to work. To err on the side of caution, I'll postpone these changes to GHC
8.2.1 instead of having them merged into GHC 8.0.2.
|
|
|
|
| |
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Previously, TH would implicitly remove the parentheses when splicing in
singleton unboxed tuple types (e.g., turning `(# Int #)` into `Int`). Luckily,
the fix is simply to delete some code.
Fixes #12513.
Test Plan: make test TEST=T12513
Reviewers: hvr, bgamari, austin, goldfire
Reviewed By: goldfire
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2462
GHC Trac Issues: #12513
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This patch fixes issue with abort in GHCi on OpenBSD current
as of Aug 12 2016. The OpenBSD is more and more strict about usage
of writable and executable memory. Programs/applications which
requires such functionality need to be linked with -z wxneeded linker
flag and need to be run from the file-system mounted with wxallowed
mount option. If either of those options in not met, then problematic
program/application usually fail on some mmap/mprotect call which fail.
Reviewers: bgamari, austin, hvr
Subscribers: thomie, erikd
Differential Revision: https://phabricator.haskell.org/D2454
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: simonpj, austin, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2444
GHC Trac Issues: #12472
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Kept this seperate from the previous patch for clarity.
Comes with a test.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: simonpj, austin, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2220
GHC Trac Issues: #12035
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This makes ghc --make's retypecheck behavior more in line
with ghc -c, which is able to tie the knot as we are typechecking.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: simonpj, austin, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2213
GHC Trac Issues: #12035
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This also drops the parked fix from
efa7b3a474bc373201ab145c129262a73c86f959
(though I didn't revert the refactoring).
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: simonpj, austin, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2211
GHC Trac Issues: #10083
|
|
|
|
|
|
|
|
|
|
|
|
| |
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: simonpj, austin, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2246
|
|
|
|
|
|
|
|
|
|
|
|
| |
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: simonpj, austin, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2209
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
initIfaceTc was originally used to make sure when we typecheck
an interface, it can find the TyThings for things it itself
defined. However, in the case of retypecheckLoop, this wasn't
necessary because we ALREADY tied the knot through the HPT.
This commit removes initIfaceTc, instead relying on the HPT
to tie the knot. genModDetails' caller needed to be modified
to tie the knot, but there are not that many call-sites of
typecheckIface so the change is quite reasonable.
We also introduce a new 'initIfaceLoad', which does
NOT set up 'if_rec_types'. It's used when we're
typechecking old, up-to-date interfaces in, since we're
never going to update the type environment.
The full details are in Note [Knot-tying typecheckIface].
Displeasingly, we need a special case to handle DFuns in
the case of tcHiBootIface, see
Note [DFun knot-tying special case] for the gory details.
I also added another test which tickles a bug in a buggy
version of this patch (see "Why the seq?")
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: simonpj, austin, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2349
|
|
|
|
| |
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
|
|
|
|
|
|
|
| |
This reverts commit e3e2e49a8f6952e1c8a19321c729c17b294d8c92.
I'm reverting because it makes ghc-stage2 seg-fault on
64-bit Windows machines. Even ghc-stage2 --version seg-faults.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
For symmetry with `gcastWith` in `Data.Type.Equality`.
Fixes #12493.
Test Plan: It compiles
Reviewers: bgamari, goldfire, hvr, austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2456
GHC Trac Issues: #12493
|
|
|
|
| |
This reverts commit 773e3aadac4bbee9a0173ebc90ffdc9458a2a3a9.
|
|
|
|
|
| |
Simpler code, and simpler to understand.
No change in behaviour.
|
|
|
|
|
|
|
|
|
| |
defaultCallStacks generates evidence bindings for call stacks,
but wasn't setting the binding site correctly. As a result
they were simply discarded in the case of pattern synonyms,
giving rise to Trac #12489.
The fix is easy; and I added an ASSERT to catch the error earlier.
|
|
|
|
|
| |
This fixes Trac #12406. A not-in-scope error shoudl be an error
even if you have -fdefer-typed-holes.
|
| |
|
|
|
|
| |
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
|
|
|
|
| |
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
malloc'd memory is not guaranteed to be zeroed. On Linux, however,
it is often zeroed, leading to latent bugs. In fact, with this
patch I fix two uninitialized memory bugs stemming from this.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: simonmar, austin, Phyx, bgamari, erikd
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2455
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some recent versions of XCode ship a broken version of `nm`. Detect this
at configure time, and error out with a suggestion to rerun configure
with a `--with-nm=...` argument.
Test Plan: Test of Linux and OS X
Reviewers: carter, hvr, austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2425
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This patch refactors GNU C version test (for 4.5 and more modern)
due to usage of __builtin_unreachable done in the CNF.c code directly
into the new RTS_UNREACHABLE macro placed into Rts.h
Reviewers: bgamari, austin, simonmar, erikd
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2457
|
|
|
|
| |
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This patch fixes compilation failure on OpenBSD. The OpenBSD's
GNU C compiler is of 4.2.1 version and problematic __builtin_unreachable
was added in GNU C 4.5 release. Let's use pure abort() call
on OpenBSD instead of __builtin_unreachable
Reviewers: bgamari, austin, erikd, simonmar
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2453
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
GHC's configure script seems to normalize the values returned from config.guess.
So for Windows it turns x86_64-pc-mingw64 into x86_64-unknown-mingw32.
These mangled names are stored in the values $BuildPlatform, $HostPlatform
and $TargetPlatform.
However further down the file when the comparison is done between the stage0
compiler and the host the normalized versions are not used.
So when normalization actually changes the triple this check will fail.
Not sure why it's worked for all this time.. Nor if this is the right fix?
Does it still work for cross compiling correctly?
Test Plan: ./configure
Reviewers: hvr, austin, thomie, bgamari, erikd
Reviewed By: erikd
Subscribers: erikd, #ghc_windows_task_force
Differential Revision: https://phabricator.haskell.org/D2452
GHC Trac Issues: #12487
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With BuildFlavour set to `perf-llvm`, GHCi would fail as soon as it
was run with:
ghc-stage2: .../ghc-prim/dist-install/build/HSghc-prim-0.5.0.0.o:
unknown symbol `__udivti3'
ghc-stage2: unable to load package `ghc-prim-0.5.0.0'
Fix this by adding `__udivti3` and `__umodti3` to RtsSymbols.c.
Test Plan: Validate
Reviewers: simonmar, austin, bgamari, Phyx, trofi
Reviewed By: Phyx, trofi
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2449
GHC Trac Issues: #11981
|
|
|
|
| |
Fixes Trac #12484
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The idea behind adding special "rubbish" arguments was in unboxed sum types
depending on the tag some arguments are not used and we don't want to move some
special values (like 0 for literals and some special pointer for boxed slots)
for those arguments (to stack locations or registers). "StgRubbishArg" was an
indicator to the code generator that the value won't be used. During Stg-to-Cmm
we were then not generating any move or store instructions at all.
This caused problems in the register allocator because some variables were only
initialized in some code paths. As an example, suppose we have this STG: (after
unarise)
Lib.$WT =
\r [dt_sit]
case
case dt_sit of {
Lib.F dt_siv [Occ=Once] ->
(#,,#) [1# dt_siv StgRubbishArg::GHC.Prim.Int#];
Lib.I dt_siw [Occ=Once] ->
(#,,#) [2# StgRubbishArg::GHC.Types.Any dt_siw];
}
of
dt_six
{ (#,,#) us_giC us_giD us_giE -> Lib.T [us_giC us_giD us_giE];
};
This basically unpacks a sum type to an unboxed sum with 3 fields, and then
moves the unboxed sum to a constructor (`Lib.T`).
This is the Cmm for the inner case expression (case expression in the scrutinee
position of the outer case):
ciN:
...
-- look at dt_sit's tag
if (_ciT::P64 != 1) goto ciS; else goto ciR;
ciS: -- Tag is 2, i.e. Lib.F
_siw::I64 = I64[_siu::P64 + 6];
_giE::I64 = _siw::I64;
_giD::P64 = stg_RUBBISH_ENTRY_info;
_giC::I64 = 2;
goto ciU;
ciR: -- Tag is 1, i.e. Lib.I
_siv::P64 = P64[_siu::P64 + 7];
_giD::P64 = _siv::P64;
_giC::I64 = 1;
goto ciU;
Here one of the blocks `ciS` and `ciR` is executed and then the execution
continues to `ciR`, but only `ciS` initializes `_giE`, in the other branch
`_giE` is not initialized, because it's "rubbish" in the STG and so we don't
generate an assignment during code generator. The code generator then panics
during the register allocations:
ghc-stage1: panic! (the 'impossible' happened)
(GHC version 8.1.20160722 for x86_64-unknown-linux):
LocalReg's live-in to graph ciY {_giE::I64}
(`_giD` is also "rubbish" in `ciS`, but it's still initialized because it's a
pointer slot, we have to initialize it otherwise garbage collector follows the
pointer to some random place. So we only remove assignment if the "rubbish" arg
has unboxed type.)
This patch removes `StgRubbishArg` and `CmmArg`. We now always initialize
rubbish slots. If the slot is for boxed types we use the existing `absentError`,
otherwise we initialize the slot with literal 0.
Reviewers: simonpj, erikd, austin, simonmar, bgamari
Reviewed By: erikd
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2446
|
|
|
|
|
|
| |
We need to maintain the invariant that the layout fields are always sorted.
Two tests that were previously broken are added.
|