Skip to content

Commit 64caa59

Browse files
committed
Squashed 'ocaml/' changes from b11eea1..a09392d
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
1 parent f97a773 commit 64caa59

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+9535
-4578
lines changed

Changes

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
1-
OCaml 4.14 maintenance branch
1+
OCaml 4.14.1 (20 December 2022)
2+
------------------------------
3+
4+
### Bug fixes:
5+
6+
- #11803, #11808: on x86, the destination of an integer comparison must be
7+
a register, it cannot be a stack slot.
8+
(Vincent Laviron, review by Xavier Leroy, report by
9+
Emilio Jesús Gallego Arias)
10+
11+
12+
OCaml 4.14.1
213
-----------------------------
314

15+
### Compiler user-interface and warnings:
16+
17+
- #11184, #11670: Stop calling ranlib on created / installed libraries
18+
(Sébastien Hinderer and Xavier Leroy, review by the same)
19+
420
### Build system:
521

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

1329
### Bug fixes:
1430

31+
- #10768, #11340: Fix typechecking regression when combining first class
32+
modules and GADTs.
33+
(Jacques Garrigue, report by François Thiré, review by Matthew Ryan)
34+
1535
- #11204: Fix regression introduced in 4.14.0 that would trigger Warning 17 when
1636
calling virtual methods introduced by constraining the self type from within
1737
the class definition.
@@ -50,6 +70,34 @@ OCaml 4.14 maintenance branch
5070
- #11516, #11524: Fix the `deprecated_mutable` attribute.
5171
(Chris Casinghino, review by Nicolás Ojeda Bär and Florian Angeletti)
5272

73+
- #11194, #11609: Fix inconsistent type variable names in "unbound type var"
74+
messages
75+
(Ulysse Gérard and Florian Angeletti, review Florian Angeletti and
76+
Gabriel Scherer)
77+
78+
- #11622: Prevent stack overflow when printing a constructor or record
79+
mismatch error involving recursive types.
80+
(Florian Angeletti, review by Gabriel Scherer)
81+
82+
- #11732: Ensure that types from packed modules are always generalised
83+
(Stephen Dolan and Leo White, review by Jacques Garrigue)
84+
85+
- #11737: Fix segfault condition in Unix.stat under Windows in the presence of
86+
multiple threads.
87+
(Marc Lasson, Nicolás Ojeda Bär, review by Gabriel Scherer and David Allsopp)
88+
89+
- #11776: Extend environment with functor parameters in `strengthen_lazy`.
90+
(Chris Casinghino and Luke Maurer, review by Gabriel Scherer)
91+
92+
- #11533, #11534: follow synonyms again in #show_module_type
93+
(this had stopped working in 4.14.0)
94+
(Gabriel Scherer, review by Jacques Garrigue, report by Yaron Minsky)
95+
96+
- #11768, #11788: Fix crash at start-up of bytecode programs in
97+
no-naked-pointers mode caused by wrong initialization of caml_global_data
98+
(Xavier Leroy, report by Etienne Millon, review by Gabriel Scherer)
99+
100+
53101
OCaml 4.14.0 (28 March 2022)
54102
----------------------------
55103

HACKING.jst.adoc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,19 @@ where the test file or test dir are specified with respect to the
5454
$ make -f Makefile.jst test-one TEST=typing-local/local.ml
5555
$ make -f Makefile.jst test-one DIR=typing-local
5656

57+
## Debugging
58+
59+
OCaml 4.14 makes `type_expr` abstract, and thus normal debug printing
60+
of types no longer works. However, there is now an installable printer
61+
for types, which we can use to see the types. Here are the instructions:
62+
63+
1. Use the old `Makefile`, not the new `Makefile.jst`. This is an infelicity
64+
we hope to fix.
65+
66+
2. In the `tools` directory, run `make debug_printers.cmo`.
67+
68+
3. In the debugger, execute some instructions, with e.g. `run` or `step`. This forces
69+
the debugger to load the compiler code, required for the next
70+
step.
71+
72+
4. Execute `source tools/debug_printers` to install the printers.

README.win32.adoc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,7 @@ Only the `make` Cygwin package is required. `diffutils` is required if you wish
6363
to be able to run the test suite.
6464

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

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

198196
Now run:
199197

200-
./configure --build=i686-pc-cygwin --host=i686-pc-windows
198+
./configure --build=x86_64-pc-cygwin --host=i686-pc-windows
201199

202200
for 32-bit, or:
203201

@@ -262,7 +260,7 @@ the WinZip Options Window.)
262260

263261
Now run:
264262

265-
./configure --build=i686-pc-cygwin --host=i686-w64-mingw32
263+
./configure --build=x86_64-pc-cygwin --host=i686-w64-mingw32
266264

267265
for 32-bit, or:
268266

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
4.14.0+jst
1+
4.14.1+jst
22

33
# Starting with OCaml 4.14, although the version string that appears above is
44
# still correct and this file can thus still be used to figure it out,

asmcomp/amd64/reload.ml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,15 @@ open Mach
3333
Iload R R R
3434
Istore R R
3535
Iintop(Icomp) R R S
36-
or S S R
36+
or R S R
3737
Iintop(Imul|Idiv|Imod) R R S
3838
Iintop(Imulh) R R S
3939
Iintop(shift) S S R
4040
Iintop(others) R R S
4141
or S S R
4242
Iintop_imm(Iadd, n)/lea R R
4343
Iintop_imm(Imul, n) R R
44+
Iintop_imm(Icomp, n) R S
4445
Iintop_imm(others) S S
4546
Inegf...Idivf R R S
4647
Ifloatofint R S
@@ -66,7 +67,14 @@ inherit Reloadgen.reload_generic as super
6667

6768
method! reload_operation op arg res =
6869
match op with
69-
| Iintop(Iadd|Isub|Iand|Ior|Ixor|Icomp _|Icheckbound) ->
70+
| Iintop(Iadd|Isub|Iand|Ior|Ixor|Icheckbound) ->
71+
(* One of the two arguments can reside in the stack, but not both *)
72+
if stackp arg.(0) && stackp arg.(1)
73+
then ([|arg.(0); self#makereg arg.(1)|], res)
74+
else (arg, res)
75+
| Iintop(Icomp _) ->
76+
(* The result must be a register (PR#11803) *)
77+
let res = self#makeregs res in
7078
(* One of the two arguments can reside in the stack, but not both *)
7179
if stackp arg.(0) && stackp arg.(1)
7280
then ([|arg.(0); self#makereg arg.(1)|], res)
@@ -80,6 +88,9 @@ method! reload_operation op arg res =
8088
if stackp arg.(0)
8189
then (let r = self#makereg arg.(0) in ([|r|], [|r|]))
8290
else (arg, res)
91+
| Iintop_imm(Icomp _, _) ->
92+
(* The result must be in a register (PR#11803) *)
93+
(arg, self#makeregs res)
8394
| Iintop(Imulh | Idiv | Imod | Ilsl | Ilsr | Iasr)
8495
| Iintop_imm(_, _) ->
8596
(* The argument(s) and results can be either in register or on stack *)

asmcomp/i386/reload.ml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,14 @@ method! makereg r =
4040

4141
method! reload_operation op arg res =
4242
match op with
43-
Iintop(Iadd|Isub|Iand|Ior|Ixor|Icomp _|Icheckbound) ->
43+
Iintop(Iadd|Isub|Iand|Ior|Ixor|Icheckbound) ->
44+
(* One of the two arguments can reside in the stack *)
45+
if stackp arg.(0) && stackp arg.(1)
46+
then ([|arg.(0); self#makereg arg.(1)|], res)
47+
else (arg, res)
48+
| Iintop(Icomp _) ->
49+
(* The result must be a register (PR#11803) *)
50+
let res = self#makeregs res in
4451
(* One of the two arguments can reside in the stack *)
4552
if stackp arg.(0) && stackp arg.(1)
4653
then ([|arg.(0); self#makereg arg.(1)|], res)
@@ -60,6 +67,9 @@ method! reload_operation op arg res =
6067
if stackp arg.(0)
6168
then let r = self#makereg arg.(0) in ([|r|], [|r|])
6269
else (arg, res)
70+
| Iintop_imm(Icomp _, _) ->
71+
(* The result must be in a register (PR#11803) *)
72+
(arg, self#makeregs res)
6373
| Iintop(Imulh | Ilsl | Ilsr | Iasr) | Iintop_imm(_, _)
6474
| Ifloatofint | Iintoffloat | Ispecific(Ipush) ->
6575
(* The argument(s) can be either in register or on stack *)

asmcomp/reloadgen.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ method makereg r =
4646
newr.spill_cost <- 100000;
4747
newr
4848

49-
method private makeregs rv =
49+
method makeregs rv =
5050
let n = Array.length rv in
5151
let newv = Array.make n Reg.dummy in
5252
for i = 0 to n-1 do newv.(i) <- self#makereg rv.(i) done;

asmcomp/reloadgen.mli

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class reload_generic : object
2020
(* Can be overridden to reflect instructions that can operate
2121
directly on stack locations *)
2222
method makereg : Reg.t -> Reg.t
23+
method makeregs : Reg.t array -> Reg.t array
2324
(* Can be overridden to avoid creating new registers of some class
2425
(i.e. if all "registers" of that class are actually on stack) *)
2526
method fundecl : Mach.fundecl -> int array -> Mach.fundecl * bool

0 commit comments

Comments
 (0)