Skip to content

Commit

Permalink
Squashed 'ocaml/' changes from b11eea1..a09392d
Browse files Browse the repository at this point in the history
a09392d Set Menhir version back to 20210419 again (ocaml#89)
cc63992 Merge pull request ocaml#88 from mshinwell/flambda-backend-changes-2022-12-27
3e49df3 HACKING.jst.adoc
1866676 Merge flambda-backend changes
e012992 Merge pull request ocaml#87 from mshinwell/merge-4.14.1
ac5c7c8 Merge tag '4.14.1' into main
3da21bc add a useful debug printer
83b7c72 Document the debug_printers script
98896e0 Remove a tiny code stutter I came across
99cb5d9 release 4.14.1
b49060f last commit before tagging 4.14.1
fae9aef Add documentation
708e5a9 Add tests
c609eee Bootstrap
7f922d0 Polymorphic parameters
51aeb04 Keep generalized structure from patterns when typing let
4b68bb3 Add test of princiaplity from polymorphic type constraints
82c7afe fix wong raise
aca252f x86: Force result of Icomp to be in a register (ocaml#11808)
985725b Add dynlink_compilerlibs.mli to .gitignore (ocaml#79)
2b1fa24 Regenerate parser (ocaml#80)
1bb6c79 Merge pull request ocaml#78 from mshinwell/flambda-backend-patches-2022-12-13
9029581 Update otherlibs/dynlink/Makefile
3e4f1b9 Revert toplevel/native/dune to ocaml-jst version
6061e4c Regenerate configure using autoconf 2.71
888d4b1 Back out patch which disables alloc-check in ocaml-jst
a6d5796 Fix dynlink build
3e46daf Update .depend files
a5c547e Bootstrap
a6a9031 Merge flambda-backend changes
0ac7fdd temp fix for linker error (ocaml#77)
1018602 Remove references to 32-bit Cygwin (ocaml#11797)
e2d0d9e Enable individual testing with Makefile.jst (ocaml#76)
f10cbf6 increment version number after tagging 4.14.1~rc1
11c5ab7 release 4.14.1~rc1
e4c3920 last commit before tagging 4.14.1~rc1
9e598ca Merge pull request ocaml#11793 from dra27/then-than
2a7e501 Use a more relaxed mode for unification in Ctype.subst (ocaml#11771) (ocaml#73)
7b35ef7 Statically initialize `caml_global_data` with a valid value (ocaml#11788)
cbd791a Allow immediates to cross modes (ocaml#58)
85a0817 Merge pull request ocaml#11534 from gasche/follow-synonyms-in-show-module-type
699f43c Changes
e54e9bc fix the 'stuttering' issue in #show
d9799d3 test comments
fec3b23 follow synonyms when #show-ing module types
06a1ad7 regression tests for ocaml#11533 (still failing)
549d757 Run "misplaced attributes" check when compiling mlis (ocaml#72)
b2b74bf Fix bug in `Mtype.strengthen_lazy` causing spurious typing errors (ocaml#11776)
a6c0e75 Ensure that Ctype.nongen always calls remove_mode_variables (ocaml#70)
6c50831 array elements are global (ocaml#67)
bc510ed Ensure that types from packed modules are always generalised (ocaml#11732)
4d47036 Fix ocaml#10768
8788ff6 Add/move some documentation
9891a36 Propagate location information to `local_` in expressions
988306d Add support for `global_` and `nonlocal_` constructor arguments (ocaml#50)
6729eb8 Missing CAMLparam in win32's Unix.stat (ocaml#11737)
e7dd740 Add debug_printers.ml (ocaml#63)
65f2896 more entries in gitignore (ocaml#62)
a9a84d0 Move `global_flag` to `Asttypes` (ocaml#60)
fac5896 Minor attribute fixes from flambda-backend
75f402e Note about make install and Makefile.jst (ocaml#56)
fb5b1e4 Remove the -force-tmc flag (ocaml#11661)
bd87a61 ocamlmklib: use `ar rcs` instead of `ar rc` (ocaml#11670)
83762af Merge pull request ocaml#11622 from Octachron/fix_recursive_types_in_constructor_mismatch
ca48730 Merge pull request ocaml#11609 from Octachron/pr11194_unbound_and_printing_context

git-subtree-dir: ocaml
git-subtree-split: a09392d
  • Loading branch information
mshinwell committed Dec 28, 2022
1 parent f97a773 commit 64caa59
Show file tree
Hide file tree
Showing 55 changed files with 9,535 additions and 4,578 deletions.
50 changes: 49 additions & 1 deletion Changes
@@ -1,6 +1,22 @@
OCaml 4.14 maintenance branch
OCaml 4.14.1 (20 December 2022)
------------------------------

### Bug fixes:

- #11803, #11808: on x86, the destination of an integer comparison must be
a register, it cannot be a stack slot.
(Vincent Laviron, review by Xavier Leroy, report by
Emilio Jesús Gallego Arias)


OCaml 4.14.1
-----------------------------

### Compiler user-interface and warnings:

- #11184, #11670: Stop calling ranlib on created / installed libraries
(Sébastien Hinderer and Xavier Leroy, review by the same)

### Build system:

- #11370, #11373: Don't pass CFLAGS to flexlink during configure.
Expand All @@ -12,6 +28,10 @@ OCaml 4.14 maintenance branch

### Bug fixes:

- #10768, #11340: Fix typechecking regression when combining first class
modules and GADTs.
(Jacques Garrigue, report by François Thiré, review by Matthew Ryan)

- #11204: Fix regression introduced in 4.14.0 that would trigger Warning 17 when
calling virtual methods introduced by constraining the self type from within
the class definition.
Expand Down Expand Up @@ -50,6 +70,34 @@ OCaml 4.14 maintenance branch
- #11516, #11524: Fix the `deprecated_mutable` attribute.
(Chris Casinghino, review by Nicolás Ojeda Bär and Florian Angeletti)

- #11194, #11609: Fix inconsistent type variable names in "unbound type var"
messages
(Ulysse Gérard and Florian Angeletti, review Florian Angeletti and
Gabriel Scherer)

- #11622: Prevent stack overflow when printing a constructor or record
mismatch error involving recursive types.
(Florian Angeletti, review by Gabriel Scherer)

- #11732: Ensure that types from packed modules are always generalised
(Stephen Dolan and Leo White, review by Jacques Garrigue)

- #11737: Fix segfault condition in Unix.stat under Windows in the presence of
multiple threads.
(Marc Lasson, Nicolás Ojeda Bär, review by Gabriel Scherer and David Allsopp)

- #11776: Extend environment with functor parameters in `strengthen_lazy`.
(Chris Casinghino and Luke Maurer, review by Gabriel Scherer)

- #11533, #11534: follow synonyms again in #show_module_type
(this had stopped working in 4.14.0)
(Gabriel Scherer, review by Jacques Garrigue, report by Yaron Minsky)

- #11768, #11788: Fix crash at start-up of bytecode programs in
no-naked-pointers mode caused by wrong initialization of caml_global_data
(Xavier Leroy, report by Etienne Millon, review by Gabriel Scherer)


OCaml 4.14.0 (28 March 2022)
----------------------------

Expand Down
16 changes: 16 additions & 0 deletions HACKING.jst.adoc
Expand Up @@ -54,3 +54,19 @@ where the test file or test dir are specified with respect to the
$ make -f Makefile.jst test-one TEST=typing-local/local.ml
$ make -f Makefile.jst test-one DIR=typing-local

## Debugging

OCaml 4.14 makes `type_expr` abstract, and thus normal debug printing
of types no longer works. However, there is now an installable printer
for types, which we can use to see the types. Here are the instructions:

1. Use the old `Makefile`, not the new `Makefile.jst`. This is an infelicity
we hope to fix.

2. In the `tools` directory, run `make debug_printers.cmo`.

3. In the debugger, execute some instructions, with e.g. `run` or `step`. This forces
the debugger to load the compiler code, required for the next
step.

4. Execute `source tools/debug_printers` to install the printers.
8 changes: 3 additions & 5 deletions README.win32.adoc
Expand Up @@ -63,9 +63,7 @@ Only the `make` Cygwin package is required. `diffutils` is required if you wish
to be able to run the test suite.

Unless you are also compiling the Cygwin port of OCaml, you do not need the
`gcc-core` or `flexdll` packages. If you do install them, care may be required
to ensure that a particular build is using the correct installation of
`flexlink`.
`gcc-core` or `flexdll` packages.

[[bmflex]]
In addition to Cygwin, FlexDLL must also be installed, which is available from
Expand Down Expand Up @@ -197,7 +195,7 @@ quickly as it will be unable to link `ocamlrun`.

Now run:

./configure --build=i686-pc-cygwin --host=i686-pc-windows
./configure --build=x86_64-pc-cygwin --host=i686-pc-windows

for 32-bit, or:

Expand Down Expand Up @@ -262,7 +260,7 @@ the WinZip Options Window.)

Now run:

./configure --build=i686-pc-cygwin --host=i686-w64-mingw32
./configure --build=x86_64-pc-cygwin --host=i686-w64-mingw32

for 32-bit, or:

Expand Down
2 changes: 1 addition & 1 deletion VERSION
@@ -1,4 +1,4 @@
4.14.0+jst
4.14.1+jst

# Starting with OCaml 4.14, although the version string that appears above is
# still correct and this file can thus still be used to figure it out,
Expand Down
15 changes: 13 additions & 2 deletions asmcomp/amd64/reload.ml
Expand Up @@ -33,14 +33,15 @@ open Mach
Iload R R R
Istore R R
Iintop(Icomp) R R S
or S S R
or R S R
Iintop(Imul|Idiv|Imod) R R S
Iintop(Imulh) R R S
Iintop(shift) S S R
Iintop(others) R R S
or S S R
Iintop_imm(Iadd, n)/lea R R
Iintop_imm(Imul, n) R R
Iintop_imm(Icomp, n) R S
Iintop_imm(others) S S
Inegf...Idivf R R S
Ifloatofint R S
Expand All @@ -66,7 +67,14 @@ inherit Reloadgen.reload_generic as super

method! reload_operation op arg res =
match op with
| Iintop(Iadd|Isub|Iand|Ior|Ixor|Icomp _|Icheckbound) ->
| Iintop(Iadd|Isub|Iand|Ior|Ixor|Icheckbound) ->
(* One of the two arguments can reside in the stack, but not both *)
if stackp arg.(0) && stackp arg.(1)
then ([|arg.(0); self#makereg arg.(1)|], res)
else (arg, res)
| Iintop(Icomp _) ->
(* The result must be a register (PR#11803) *)
let res = self#makeregs res in
(* One of the two arguments can reside in the stack, but not both *)
if stackp arg.(0) && stackp arg.(1)
then ([|arg.(0); self#makereg arg.(1)|], res)
Expand All @@ -80,6 +88,9 @@ method! reload_operation op arg res =
if stackp arg.(0)
then (let r = self#makereg arg.(0) in ([|r|], [|r|]))
else (arg, res)
| Iintop_imm(Icomp _, _) ->
(* The result must be in a register (PR#11803) *)
(arg, self#makeregs res)
| Iintop(Imulh | Idiv | Imod | Ilsl | Ilsr | Iasr)
| Iintop_imm(_, _) ->
(* The argument(s) and results can be either in register or on stack *)
Expand Down
12 changes: 11 additions & 1 deletion asmcomp/i386/reload.ml
Expand Up @@ -40,7 +40,14 @@ method! makereg r =

method! reload_operation op arg res =
match op with
Iintop(Iadd|Isub|Iand|Ior|Ixor|Icomp _|Icheckbound) ->
Iintop(Iadd|Isub|Iand|Ior|Ixor|Icheckbound) ->
(* One of the two arguments can reside in the stack *)
if stackp arg.(0) && stackp arg.(1)
then ([|arg.(0); self#makereg arg.(1)|], res)
else (arg, res)
| Iintop(Icomp _) ->
(* The result must be a register (PR#11803) *)
let res = self#makeregs res in
(* One of the two arguments can reside in the stack *)
if stackp arg.(0) && stackp arg.(1)
then ([|arg.(0); self#makereg arg.(1)|], res)
Expand All @@ -60,6 +67,9 @@ method! reload_operation op arg res =
if stackp arg.(0)
then let r = self#makereg arg.(0) in ([|r|], [|r|])
else (arg, res)
| Iintop_imm(Icomp _, _) ->
(* The result must be in a register (PR#11803) *)
(arg, self#makeregs res)
| Iintop(Imulh | Ilsl | Ilsr | Iasr) | Iintop_imm(_, _)
| Ifloatofint | Iintoffloat | Ispecific(Ipush) ->
(* The argument(s) can be either in register or on stack *)
Expand Down
2 changes: 1 addition & 1 deletion asmcomp/reloadgen.ml
Expand Up @@ -46,7 +46,7 @@ method makereg r =
newr.spill_cost <- 100000;
newr

method private makeregs rv =
method makeregs rv =
let n = Array.length rv in
let newv = Array.make n Reg.dummy in
for i = 0 to n-1 do newv.(i) <- self#makereg rv.(i) done;
Expand Down
1 change: 1 addition & 0 deletions asmcomp/reloadgen.mli
Expand Up @@ -20,6 +20,7 @@ class reload_generic : object
(* Can be overridden to reflect instructions that can operate
directly on stack locations *)
method makereg : Reg.t -> Reg.t
method makeregs : Reg.t array -> Reg.t array
(* Can be overridden to avoid creating new registers of some class
(i.e. if all "registers" of that class are actually on stack) *)
method fundecl : Mach.fundecl -> int array -> Mach.fundecl * bool
Expand Down

0 comments on commit 64caa59

Please sign in to comment.