[Git][ghc/ghc][wip/pmcheck-ncon] 74 commits: Add PlainPanic for throwing exceptions without depending on pprint

Sebastian Graf gitlab at gitlab.haskell.org
Mon Jun 3 15:01:22 UTC 2019



Sebastian Graf pushed to branch wip/pmcheck-ncon at Glasgow Haskell Compiler / GHC


Commits:
d9dfbde3 by Michael Sloan at 2019-05-24T15:55:07Z
Add PlainPanic for throwing exceptions without depending on pprint

This commit splits out a subset of GhcException which do not depend on
pretty printing (SDoc), as a new datatype called
PlainGhcException. These exceptions can be caught as GhcException,
because 'fromException' will convert them.

The motivation for this change is that that the Panic module
transitively depends on many modules, primarily due to pretty printing
code.  It's on the order of about 130 modules.  This large set of
dependencies has a few implications:

1. To avoid cycles / use of boot files, these dependencies cannot
throw GhcException.

2. There are some utility modules that use UnboxedTuples and also use
`panic`. This means that when loading GHC into GHCi, about 130
additional modules would need to be compiled instead of
interpreted. Splitting the non-pprint exception throwing into a new
module resolves this issue. See #13101

- - - - -
70c24471 by Moritz Angermann at 2019-05-25T21:51:30Z
Add `keepCAFs` to RtsSymbols

- - - - -
9be1749d by David Eichmann at 2019-05-25T21:55:05Z
Hadrian: Add Mising Libffi Dependencies #16653

Libffi is ultimately built from a single archive file (e.g.
libffi-tarballs/libffi-3.99999+git20171002+77e130c.tar.gz).
The file can be seen as the shallow dependency for the whole
libffi build. Hence, in all libffi rules, the archive is
`need`ed and the build directory is `trackAllow`ed.

- - - - -
2d0cf625 by Sandy Maguire at 2019-05-26T12:57:20Z
Let the specialiser work on dicts under lambdas

Following the discussion under #16473, this change allows the
specializer to work on any dicts in a lambda, not just those that occur
at the beginning.

For example, if you use data types which contain dictionaries and
higher-rank functions then once these are erased by the optimiser you
end up with functions such as:

```
  go_s4K9
  Int#
  -> forall (m :: * -> *).
     Monad m =>
     (forall x. Union '[State (Sum Int)] x -> m x) -> m ()
```

The dictionary argument is after the Int# value argument, this patch
allows `go` to be specialised.

- - - - -
4b228768 by Moritz Angermann at 2019-05-27T05:19:49Z
Lowercase windows imports

While windows and macOS are currently on case-insensitive file
systems, this poses no issue on those.  When cross compiling from
linux with a case sensitive file system and mingw providing only
lowercase headers, this in fact produces an issue.  As such we just
lowercase the import headers, which should still work fine on a
case insensitive file system and also enable mingw's headers to
be usable porperly.

- - - - -
01f8e390 by Alp Mestanogullari at 2019-05-27T14:06:26Z
Hadrian: Fix problem with unlit path in settings file

e529c65e introduced a problem in the logic for generating the
path to the unlit command in the settings file, and this patches
fixes it.

This fixes many tests, the simplest of which is:

> _build/stage1/bin/ghc testsuite/tests/parser/should_fail/T8430.lhs

which failed because of a wrong path for unlit, and now fails for the right
reason, with the error message expected for this test.

This addresses #16659.

- - - - -
dcd843ac by mizunashi_mana at 2019-05-27T14:06:27Z
Fix typo of primop format
- - - - -
3f6e5b97 by Joshua Price at 2019-05-27T14:06:28Z
Correct the large tuples section in user's guide

Fixes #16644.

- - - - -
1f51aad6 by Krzysztof Gogolewski at 2019-05-27T14:06:28Z
Fix tcfail158 (#15899)

As described in #15899, this test was broken, but now it's back
to normal.

- - - - -
723216e3 by Sebastian Graf at 2019-05-27T14:06:29Z
Add a pprTraceWith function

- - - - -
6d188dd5 by Simon Jakobi at 2019-05-27T14:06:31Z
base: Include (<$) in all exports of Functor

Previously the haddocks for Control.Monad and Data.Functor gave
the impression that `fmap` was the only Functor method.

Fixes #16681.

- - - - -
95b79173 by Jasper Van der Jeugt at 2019-05-27T14:06:32Z
Fix padding of entries in .prof files

When the number of entries of a cost centre reaches 11 digits, it takes
up the whole space reserved for it and the prof file ends up looking
like:

    ... no.        entries  %time %alloc   %time %alloc

        ...
    ... 120918     978250    0.0    0.0     0.0    0.0
    ... 118891          0    0.0    0.0    73.3   80.8
    ... 11890229702412351    8.9   13.5    73.3   80.8
    ... 118903  153799689    0.0    0.1     0.0    0.1
        ...

This results in tooling not being able to parse the .prof file.  I
realise we have the JSON output as well now, but still it'd be good to
fix this little weirdness.

Original bug report and full prof file can be seen here:
<https://github.com/jaspervdj/profiteur/issues/28>.

- - - - -
f80d3afd by John Ericson at 2019-05-27T14:06:33Z
hadrian: Fix generation of settings

I jumbled some lines in e529c65eacf595006dd5358491d28c202d673732,
messing up the leading underscores and rts ways settings. This broke at
least stage1 linking on macOS, but probably loads of other things too.

Should fix #16685 and #16658.

- - - - -
db8e3275 by Ömer Sinan Ağacan at 2019-05-27T14:06:37Z
Add missing opening braces in Cmm dumps

Previously -ddump-cmm was generating code with unbalanced curly braces:

     stg_atomically_entry() //  [R1]
             { info_tbls: [(cfl,
                            label: stg_atomically_info
                            rep: tag:16 HeapRep 1 ptrs { Thunk }
                            srt: Nothing)]
               stack_info: arg_space: 8 updfr_space: Just 8
             }
         {offset
           cfl: // cfk
               unwind Sp = Just Sp + 0;
               _cfk::P64 = R1;
               //tick src<rts/PrimOps.cmm:(1243,1)-(1245,1)>
               R1 = I64[_cfk::P64 + 8 + 8 + 0 * 8];
               call stg_atomicallyzh(R1) args: 8, res: 0, upd: 8;
         }
     }, <---- OPENING BRACE MISSING

After this patch:

     stg_atomically_entry() { //  [R1] <---- MISSING OPENING BRACE HERE
             { info_tbls: [(cfl,
                            label: stg_atomically_info
                            rep: tag:16 HeapRep 1 ptrs { Thunk }
                            srt: Nothing)]
               stack_info: arg_space: 8 updfr_space: Just 8
             }
         {offset
           cfl: // cfk
               unwind Sp = Just Sp + 0;
               _cfk::P64 = R1;
               //tick src<rts/PrimOps.cmm:(1243,1)-(1245,1)>
               R1 = I64[_cfk::P64 + 8 + 8 + 0 * 8];
               call stg_atomicallyzh(R1) args: 8, res: 0, upd: 8;
         }
     },

- - - - -
9334467f by Richard Eisenberg at 2019-05-28T04:24:50Z
Improve comments around injectivity checks

- - - - -
c8380a4a by Krzysztof Gogolewski at 2019-05-29T14:35:50Z
Handle hs-boot files in -Wmissing-home-modules (#16551)

- - - - -
7a75a094 by Alp Mestanogullari at 2019-05-29T14:36:35Z
testsuite: introduce 'static_stats' tests

They are a particular type of perf tests. This patch introduces a
'stats_files_dir' configuration field in the testsuite driver where all
haddock timing files (and possibly others in the future) are assumed to live.
We also change both the Make and Hadrian build systems to pass respectively
$(TOP)/testsuite/tests/perf/haddock/ and
<build root>/stage1/haddock-timing-files/ as the value of that new
configuration field, and to generate the timing files in those directories
in the first place while generating documentation with haddock.

This new test type can be seen as one dedicated to examining stats files that
are generated while building a GHC distribution. This also lets us get rid of
the 'extra_files' directives in the all.T entries for haddock.base,
haddock.Cabal and haddock.compiler.

- - - - -
32acecc2 by P.C. Shyamshankar at 2019-05-29T14:37:16Z
Minor spelling fixes to users guide.

- - - - -
b58b389b by Oleg Grenrus at 2019-05-29T14:37:54Z
Remove stale 8.2.1-notes

- - - - -
5bfd28f5 by Oleg Grenrus at 2019-05-29T14:37:54Z
Fix some warnings in users_guide (incl #16640)

- short underline
- :ghc-flag:, not :ghc-flags:
- :since: have to be separate
- newline before code block
- workaround anchor generation so

    - pragma:SPECIALISE
    - pragma:SPECIALIZE-INLINE
    - pragma:SPECIALIZE-inline

  are different anchors, not all the same `pragma:SPECIALIZE`

- - - - -
a5b14ad4 by Kevin Buhr at 2019-05-29T14:38:30Z
Add test for old issue displaying unboxed tuples in error messages (#502)

- - - - -
f9d61ebb by Krzysztof Gogolewski at 2019-05-29T14:39:05Z
In hole fits, don't show VTA for inferred variables (#16456)

We fetch the ArgFlag for every argument by using splitForAllVarBndrs
instead of splitForAllTys in unwrapTypeVars.

- - - - -
69b16331 by Krzysztof Gogolewski at 2019-05-29T14:39:43Z
Fix missing unboxed tuple RuntimeReps (#16565)

Unboxed tuples and sums take extra RuntimeRep arguments,
which must be manually passed in a few places.
This was not done in deSugar/Check.

This error was hidden because zipping functions in TyCoRep
ignored lists with mismatching length. This is now fixed;
the lengths are now checked by calling zipEqual.

As suggested in #16565, I moved checking for isTyVar and
isCoVar to zipTyEnv and zipCoEnv.

- - - - -
9062b625 by Nathan Collins at 2019-05-29T14:40:21Z
Don't lose parentheses in show SomeAsyncException
- - - - -
cc0d05a7 by Daniel Gröber at 2019-05-29T14:41:02Z
Add hPutStringBuffer utility

- - - - -
5b90e0a1 by Daniel Gröber at 2019-05-29T14:41:02Z
Allow using tagetContents for modules needing preprocessing

This allows GHC API clients, most notably tooling such as
Haskell-IDE-Engine, to pass unsaved files to GHC more easily.

Currently when targetContents is used but the module requires preprocessing
'preprocessFile' simply throws an error because the pipeline does not
support passing a buffer.

This change extends `runPipeline` to allow passing the input buffer into
the pipeline. Before proceeding with the actual pipeline loop the input
buffer is immediately written out to a new tempfile.

I briefly considered refactoring the pipeline at large to pass around
in-memory buffers instead of files, but this seems needlessly complicated
since no pipeline stages other than Hsc could really support this at the
moment.

- - - - -
fb26d467 by Daniel Gröber at 2019-05-29T14:41:02Z
downsweep: Allow TargetFile not to exist when a buffer is given

Currently 'getRootSummary' will fail with an exception if a 'TargetFile' is
given but it does not exist even if an input buffer is passed along for
this target.

In this case it is not necessary for the file to exist since the buffer
will be used as input for the compilation pipeline instead of the file
anyways.

- - - - -
4d51e0d8 by Ömer Sinan Ağacan at 2019-05-29T14:41:44Z
CNF.c: Move debug functions behind ifdef

- - - - -
ae968d41 by Vladislav Zavialov at 2019-05-29T14:42:20Z
tcMatchesFun s/rho/sigma #16692

- - - - -
2d2aa203 by Josh Meredith at 2019-05-29T14:43:03Z
Provide details in `plusSimplCount` errors

- - - - -
ace2e335 by John Ericson at 2019-05-29T20:06:45Z
Break up `Settings` into smaller structs

As far as I can tell, the fields within `Settings` aren't *intrinsicly*
related. They just happen to be initialized the same way (in particular
prior to the rest of `DynFlags`), and that is why they are grouped
together.

Within `Settings`, however, there are groups of settings that clearly do
share something in common, regardless of how they anything is
initialized.

In the spirit of GHC being a library, where the end cosumer may choose
to initialize this configuration in arbitrary ways, I made some new data
types for thoses groups internal to `Settings`, and used them to define
`Settings` instead. Hopefully this is a baby step towards a general
decoupling of the stateful and stateless parts of GHC.

- - - - -
bfccd832 by John Ericson at 2019-05-29T20:06:45Z
Inline `Settings` into `DynFlags`

After the previous commit, `Settings` is just a thin wrapper around
other groups of settings. While `Settings` is used by GHC-the-executable
to initalize `DynFlags`, in principle another consumer of
GHC-the-library could initialize `DynFlags` a different way. It
therefore doesn't make sense for `DynFlags` itself (library code) to
separate the settings that typically come from `Settings` from the
settings that typically don't.

- - - - -
a1bf3413 by David Eichmann at 2019-05-29T20:07:24Z
Hadrian: Add note about Libffi's Indicating Inputs #16653

[skip ci]

- - - - -
3aa71a22 by Alp Mestanogullari at 2019-05-30T11:28:32Z
Hadrian: always generate the libffi dynlibs manifest with globbing

Instead of trying to deduce which dynlibs are expected to be found (and then
copied to the RTS's build dir) in libffi's build directory, with some OS
specific logic, we now always just use `getDirectoryFilesIO` to look for
those dynlibs and record their names in the manifest. The previous logic
ended up causing problems on Windows, where we don't build dynlibs at all
for now but the manifest file's logic didn't take that into account because
it was only partially reproducing the criterions that determine whether or not
we will be building shared libraries.

This patch also re-enables the Hadrian/Windows CI job, which was failing to
build GHC precisely because of libffi shared libraries and the aforementionned
duplicated logic.

- - - - -
ade53ce2 by Ben Gamari at 2019-05-30T11:29:10Z
CODEOWNERS: Use correct username for Richard Eisenberg

In !980 Richard noted that he could not approve the MR.
This mis-spelling was the reason.

[skip ci]

- - - - -
4ad37a32 by Ben Gamari at 2019-05-30T11:29:47Z
rts: Handle zero-sized mappings in MachO linker

As noted in #16701, it is possible that we will find that an object has
no segments needing to be mapped. Previously this would result in mmap
being called for a zero-length mapping, which would fail. We now simply
skip the mmap call in this case; the rest of the logic just works.

- - - - -
f81f3964 by Phuong Trinh at 2019-05-30T20:43:31Z
Use binary search to speedup checkUnload

We are iterating through all object code for each heap objects when
checking whether object code can be unloaded. For large projects in
GHCi, this can be very expensive due to the large number of object code
that needs to be loaded/unloaded. To speed it up, this arrangess all
mapped sections of unloaded object code in a sorted array and use binary
search to check if an address location fall on them.

- - - - -
42129180 by Trịnh Tuấn Phương at 2019-05-30T20:43:31Z
Apply suggestion to rts/CheckUnload.c
- - - - -
8e42e98e by Trịnh Tuấn Phương at 2019-05-30T20:43:31Z
Apply suggestion to rts/CheckUnload.c
- - - - -
70afa539 by Daniel Gröber at 2019-05-30T20:44:08Z
Export GhcMake.downsweep

This is to enable #10887 as well as to make it possible to test downsweep
on its own in the testsuite.

- - - - -
a8de5c5a by Daniel Gröber at 2019-05-30T20:44:08Z
Add failing test for #10887

- - - - -
8906bd66 by Daniel Gröber at 2019-05-30T20:44:08Z
Refactor downsweep to allow returning multiple errors per module

- - - - -
8e85ebf7 by Daniel Gröber at 2019-05-30T20:44:08Z
Refactor summarise{File,Module} to reduce code duplication

- - - - -
76c86fca by Daniel Gröber at 2019-05-30T20:44:08Z
Refactor summarise{File,Module} to extract checkSummaryTimestamp

This introduces a slight change of behaviour in the interrest of keeping
the code simple: Previously summariseModule would not call
addHomeModuleToFinder for summaries that are being re-used but now we do.

We're forced to to do this in summariseFile because the file being
summarised might not even be on the regular search path! So if GHC is to
find it at all we have to pre-populate the cache with its location. For
modules however the finder cache is really just a cache so we don't have to
pre-populate it with the module's location.

As straightforward as that seems I did almost manage to introduce a bug (or
so I thought) because the call to addHomeModuleToFinder I copied from
summariseFile used to use `ms_location old_summary` instead of the
`location` argument to checkSummaryTimestamp. If this call were to
overwrite the existing entry in the cache that would have resulted in us
using the old location of any module even if it was, say, moved to a
different directory between calls to 'depanal'.

However it turns out the cache just ignores the location if the module is
already in the cache. Since summariseModule has to search for the module,
which has the side effect of populating the cache, everything would have
been fine either way.

Well I'm adding a test for this anyways: tests/depanal/OldModLocation.hs.

- - - - -
18d3f01d by Daniel Gröber at 2019-05-30T20:44:08Z
Make downsweep return all errors per-module instead of throwing some

This enables API clients to handle such errors instead of immideately
crashing in the face of some kinds of user errors, which is arguably quite
bad UX.

Fixes #10887

- - - - -
99e72769 by Daniel Gröber at 2019-05-30T20:44:08Z
Catch preprocessor errors in downsweep

This changes the way preprocessor failures are presented to the
user. Previously the user would simply get an unlocated message on stderr
such as:

    `gcc' failed in phase `C pre-processor'. (Exit code: 1)

Now at the problematic source file is mentioned:

    A.hs:1:1: error:
        `gcc' failed in phase `C pre-processor'. (Exit code: 1)

This also makes live easier for GHC API clients as the preprocessor error
is now thrown as a SourceError exception.

- - - - -
b7ca94fd by Daniel Gröber at 2019-05-30T20:44:08Z
PartialDownsweep: Add test for import errors

- - - - -
98e39818 by Daniel Gröber at 2019-05-30T20:44:08Z
Add depanalPartial to make getting a partial modgraph easier

As per @mpickering's suggestion on IRC this is to make the partial
module-graph more easily accessible for API clients which don't intend to
re-implementing depanal.

- - - - -
d2784771 by Daniel Gröber at 2019-05-30T20:44:08Z
Improve targetContents code docs

- - - - -
424e85b2 by Ben Gamari at 2019-05-30T20:44:43Z
testsuite: Compile T9630 with +RTS -G1

For the reasons described in Note [residency] we run programs with -G1
when we care about the max_bytes_used metric.

- - - - -
4879d7af by Matthew Pickering at 2019-05-31T05:56:16Z
Eventlog: Document the fact timestamps are nanoseconds

[skip ci]

- - - - -
0b01a354 by Takenobu Tani at 2019-05-31T05:56:54Z
Update `$(TOP)/*.md` documents

I updated the top documents to the latest status:

  - HACKING.md:
    - Modify Phabricator to GitLab infomation
    - Remove old Trac information
    - Add link to GitLab activity

  - MAKEHELP.md:
    - Add link to hadrian wiki
    - Fix markdown format

  - INSTALL.md:
    - Modify boot command to remove python3
    - Fix markdown format

  - README.md:
    - Modify tarball file suffix
    - Fix markdown format

I checked the page display on the GitHub and GitLab web.

[skip ci]

- - - - -
973077ac by Sergei Trofimovich at 2019-05-31T05:57:31Z
powerpc32: fix 64-bit comparison (#16465)

On powerpc32 64-bit comparison code generated dangling
target labels. This caused ghc build failure as:

    $ ./configure --target=powerpc-unknown-linux-gnu && make
    ...
    SCCs aren't in reverse dependent order
    bad blockId n3U

This happened because condIntCode' in PPC codegen generated
label name but did not place the label into `cmp_lo` code block.

The change adds the `cmp_lo` label into the case of negative
comparison.

Signed-off-by: Sergei Trofimovich <slyfox at gentoo.org>

- - - - -
bb2ee86a by Sergei Trofimovich at 2019-05-31T05:57:31Z
powerpc32: fix stack allocation code generation

When ghc was built for powerpc32 built failed as:

It's a fallout of commit 3f46cffcc2850e68405a1
("PPC NCG: Refactor stack allocation code") where
word size used to be
    II32/II64
and changed to
    II8/panic "no width for given number of bytes"
    widthFromBytes ((platformWordSize platform) `quot` 8)

The change restores initial behaviour by removing extra division.

Signed-off-by: Sergei Trofimovich <slyfox at gentoo.org>

- - - - -
08b4c813 by Matthew Pickering at 2019-05-31T05:58:08Z
Use types already in AST when making .hie file

These were meant to be added in !214 but for some reason wasn't included
in the patch.

Update Haddock submodule for new Types.hs hyperlinker output

- - - - -
284cca51 by David Hewson at 2019-05-31T05:58:47Z
support small arrays and CONSTR_NOCAF in ghc-heap

- - - - -
f071576c by Neil Mitchell at 2019-05-31T05:59:24Z
Expose doCpp
- - - - -
c70d039e by Ömer Sinan Ağacan at 2019-05-31T06:00:02Z
Remove unused RTS function 'unmark'

- - - - -
bb929009 by Ömer Sinan Ağacan at 2019-05-31T06:00:40Z
Fix arity type of coerced types in CoreArity

Previously if we had

    f |> co

where `f` had arity type `ABot N` and `co` had arity M and M < N,
`arityType` would return `ABot M` which is wrong, because `f` is only
known to diverge when applied to `N` args, as described in Note
[ArityType]:

    If at = ABot n, then (f x1..xn) definitely diverges. Partial
    applications to fewer than n args may *or may not* diverge.

This caused incorrect eta expansion in the simplifier, causing #16066.

We now return `ATop M` for the same expression so the simplifier can't
assume partial applications of `f |> co` is divergent.

A regression test T16066 is also added.

- - - - -
e32786df by Ryan Scott at 2019-05-31T06:01:18Z
Put COMPLETE sigs into ModDetails with -fno-code (#16682)

`mkBootModDetailsTc`, which creates a special `ModDetails` when
`-fno-code` is enabled, was not properly filling in the `COMPLETE`
signatures from the `TcGblEnv`, resulting in incorrect pattern-match
coverage warnings. Easily fixed.

Fixes #16682.

- - - - -
0c6f7f7e by Simon Jakobi at 2019-05-31T06:01:55Z
Implement (Functor.<$) for Array

- - - - -
495a65cb by Simon Jakobi at 2019-05-31T06:02:33Z
Implement (Functor.<$) for Data.Functor.{Compose,Product,Sum}

This allows us to make use of the (<$) implementations of the
underlying functors.

- - - - -
0e0d87da by Zubin Duggal at 2019-05-31T06:34:57Z
Fix and enforce validation of header for .hie files

Implements #16686

The files version is automatically generated from the current GHC
version in the same manner as normal interface files.

This means that clients can first read the version and then decide how
to read the rest of the file.

- - - - -
1d43d4a3 by Nathan Collins at 2019-06-01T03:55:49Z
Improve ThreadId Show instance

By making it include parens when a derived instance would. For example, this changes the (hypothetical) code `show (Just (ThreadId 3))` to produce `"Just (ThreadId 3)"` instead of the current `"Just ThreadId 3"`.

- - - - -
45f88494 by Ryan Scott at 2019-06-01T03:56:27Z
Reject nested foralls in foreign imports (#16702)

This replaces a panic observed in #16702 with a simple error message
stating that nested `forall`s simply aren't allowed in the type
signature of a `foreign import` (at least, not at present).

Fixes #16702.

- - - - -
76e58890 by Ryan Scott at 2019-06-01T03:57:05Z
Fix space leaks in dynLoadObjs (#16708)

When running the test suite on a GHC built with the `quick` build
flavour, `-fghci-leak-check` noticed some space leaks. Careful
investigation led to `Linker.dynLoadObjs` being the culprit.
Pattern-matching on `PeristentLinkerState` and a dash of `$!` were
sufficient to fix the issue. (ht to mpickering for his suggestions,
which were crucial to discovering a fix)

Fixes #16708.

- - - - -
1503da32 by Ömer Sinan Ağacan at 2019-06-01T15:18:57Z
Fix rewriting invalid shifts to errors

Fixes #16449.

5341edf3 removed a code in rewrite rules for bit shifts, which broke the
"silly shift guard", causing generating invalid bit shifts or heap
overflow in compile time while trying to evaluate those invalid bit
shifts.

The "guard" is explained in Note [Guarding against silly shifts] in
PrelRules.hs.

More specifically, this was the breaking change:

    --- a/compiler/prelude/PrelRules.hs
    +++ b/compiler/prelude/PrelRules.hs
    @@ -474,12 +474,11 @@ shiftRule shift_op
            ; case e1 of
                _ | shift_len == 0
                  -> return e1
    -             | shift_len < 0 || wordSizeInBits dflags < shift_len
    -             -> return (mkRuntimeErrorApp rUNTIME_ERROR_ID wordPrimTy
    -                                        ("Bad shift length" ++ show shift_len))

This patch reverts this change.

Two new tests added:

- T16449_1: The original reproducer in #16449. This was previously
  casing a heap overflow in compile time when CmmOpt tries to evaluate
  the large (invalid) bit shift in compile time, using `Integer` as the
  result type. Now it builds as expected. We now generate an error for
  the shift as expected.

- T16449_2: Tests code generator for large (invalid) bit shifts.

- - - - -
2e297b36 by Ömer Sinan Ağacan at 2019-06-01T15:19:35Z
rts: Remove unused decls from CNF.h

- - - - -
33e37d06 by Takenobu Tani at 2019-06-03T02:54:43Z
Add `-haddock` option under ci condition to fix #16415

In order to use the `:doc` command in ghci, it is necessary
to compile for core libraries with `-haddock` option.

Especially, the `-haddock` option is essential for release building.

Note:
  * The `-haddock` option may affect compile time and binary size.
  * But hadrian has already set `-haddock` as the default.
  * This patch affects the make-based building.

This patch has been split from !532.

- - - - -
43a39c3c by Takenobu Tani at 2019-06-03T02:54:43Z
Add `-haddock` to perf.mk rather than prepare-system.sh

To cover ci conditions from ghc8.6 to 8.9, I add `-haddock` option
to `mk/flavours/perf.mk` rather than `.circleci/prepare-system.sh`.

Because in windows condition of ghc-8.9, `mk/flavours/*` is included
after `prepare-system.sh`.

In addition, in linux condition of ghc-8.6, `mk/flavors/perf.mk` is used.

- - - - -
c4f94320 by Takenobu Tani at 2019-06-03T02:54:43Z
Add `-haddock` to prepare-system.sh and .gitlab-ci.yml

To cover ci conditions from ghc8.6 to 8.9, I add `-haddock` option
to `.circleci/prepare-system.sh` and .gitlab-ci.yml.
after including `mk/flavours/*`.

- - - - -
799b1d26 by Ben Gamari at 2019-06-03T02:55:18Z
gitlab-ci: Use GHC 8.6.5 for Windows CI builds

- - - - -
affd1ceb by Sebastian Graf at 2019-06-03T13:33:41Z
TmOracle: Replace negative term equalities by refutable PmAltCons

The `PmExprEq` business was a huge hack and was at the same time vastly
too powerful and not powerful enough to encode negative term equalities,
i.e. facts of the form "forall y. x ≁ Just y".

This patch introduces the concept of 'refutable shapes': What matters
for the pattern match checker is being able to encode knowledge of the
kind "x can no longer be the literal 5". We encode this knowledge in a
`PmRefutEnv`, mapping a set of newly introduced `PmAltCon`s (which are
just `PmLit`s at the moment) to each variable denoting above
inequalities.

So, say we have `x ≁ 42 ∈ refuts` in the term oracle context and
try to solve an equality like `x ~ 42`. The entry in the refutable
environment will immediately lead to a contradiction.

This machinery renders the whole `PmExprEq` and `ComplexEq` business
unnecessary, getting rid of a lot of (mostly dead) code.

See the Note [Refutable shapes] in TmOracle for a place to start.

- - - - -
37a06c03 by Sebastian Graf at 2019-06-03T15:01:13Z
Add `PmNCons` to `Check` for correct warnings in the presence of `COMPLETE` groups

Previously, we had an elaborate mechanism for selecting the warnings to
generate in the presence of different `COMPLETE` matching groups that,
albeit finely-tuned, produced wrong results from an end user's
perspective in some cases (#13363).

The underlying issue is that at the point where the `ConVar` case has to
commit to a particular `COMPLETE` group, there's not enough information
to do so and the status quo was to just enumerate all possible complete
sets nondeterministically.
The `getResult` function would then pick the outcome according to
metrics defined in accordance to the user's guide. But crucially, it
lacked knowledge about the order in which affected clauses appear,
leading to the surprising behavior in #13363.

The introduction of an `PmNCons` variant in `PmPat` fixes this: Instead
of committing to a particular `COMPLETE` group in the `ConVar` case,
we now split off the matching constructor incrementally and record the
newly covered case in `PmNCons`.
After all clauses have been processed this way, we filter out any value
vector abstractions from the uncovered set involving `PmNCons` whose set
of covered constructors completely overlap a `COMPLETE` set.

- - - - -


30 changed files:

- .circleci/prepare-system.sh
- .gitlab-ci.yml
- CODEOWNERS
- HACKING.md
- INSTALL.md
- MAKEHELP.md
- README.md
- compiler/backpack/DriverBkp.hs
- compiler/basicTypes/NameEnv.hs
- compiler/basicTypes/UniqSupply.hs
- compiler/cmm/CLabel.hs
- compiler/cmm/CmmInfo.hs
- compiler/cmm/CmmType.hs
- compiler/cmm/PprCmmDecl.hs
- compiler/coreSyn/CoreArity.hs
- compiler/deSugar/Check.hs
- compiler/deSugar/DsForeign.hs
- compiler/deSugar/DsMonad.hs
- compiler/deSugar/PmExpr.hs
- + compiler/deSugar/PmPpr.hs
- compiler/deSugar/TmOracle.hs
- compiler/ghc.cabal.in
- compiler/ghci/Linker.hs
- compiler/hieFile/HieAst.hs
- compiler/hieFile/HieBin.hs
- compiler/hieFile/HieDebug.hs
- compiler/hieFile/HieTypes.hs
- compiler/iface/BinFingerprint.hs
- + compiler/main/CliOption.hs
- compiler/main/CodeOutput.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/compare/4e2f1875d8dd5c2fa92c9c84531c55b5b73e2dd6...37a06c03e24c3ef31bb7c643c3bb2c30bb3215c5

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/compare/4e2f1875d8dd5c2fa92c9c84531c55b5b73e2dd6...37a06c03e24c3ef31bb7c643c3bb2c30bb3215c5
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20190603/3da621cb/attachment-0001.html>


More information about the ghc-commits mailing list