Commits

camlspotter committed 7146b35

revision 11945

Comments (0)

Files changed (196)

 utils/warnings.cmx: utils/warnings.cmi
 parsing/asttypes.cmi:
 parsing/lexer.cmi: parsing/parser.cmi parsing/location.cmi
-parsing/linenum.cmi:
 parsing/location.cmi: utils/warnings.cmi
 parsing/longident.cmi:
 parsing/parse.cmi: parsing/parsetree.cmi
     parsing/location.cmi parsing/lexer.cmi
 parsing/lexer.cmx: utils/warnings.cmx parsing/parser.cmx utils/misc.cmx \
     parsing/location.cmx parsing/lexer.cmi
-parsing/linenum.cmo: utils/misc.cmi parsing/linenum.cmi
-parsing/linenum.cmx: utils/misc.cmx parsing/linenum.cmi
 parsing/location.cmo: utils/warnings.cmi utils/terminfo.cmi \
-    parsing/linenum.cmi parsing/location.cmi
+    parsing/location.cmi
 parsing/location.cmx: utils/warnings.cmx utils/terminfo.cmx \
-    parsing/linenum.cmx parsing/location.cmi
+    parsing/location.cmi
 parsing/longident.cmo: utils/misc.cmi parsing/longident.cmi
 parsing/longident.cmx: utils/misc.cmx parsing/longident.cmi
 parsing/parse.cmo: parsing/syntaxerr.cmi parsing/parser.cmi \
 parsing/syntaxerr.cmx: parsing/location.cmx parsing/syntaxerr.cmi
 typing/annot.cmi: parsing/location.cmi
 typing/btype.cmi: typing/types.cmi typing/path.cmi parsing/asttypes.cmi
-typing/ctype.cmi: typing/types.cmi typing/path.cmi typing/ident.cmi \
-    typing/env.cmi parsing/asttypes.cmi
+typing/ctype.cmi: typing/types.cmi typing/path.cmi parsing/longident.cmi \
+    typing/ident.cmi typing/env.cmi parsing/asttypes.cmi
 typing/datarepr.cmi: typing/types.cmi typing/path.cmi parsing/asttypes.cmi
 typing/env.cmi: typing/types.cmi typing/path.cmi parsing/longident.cmi \
     typing/ident.cmi utils/consistbl.cmi typing/annot.cmi
 typing/oprint.cmi: typing/outcometree.cmi
 typing/outcometree.cmi: parsing/asttypes.cmi
 typing/parmatch.cmi: typing/types.cmi typing/typedtree.cmi \
-    parsing/location.cmi typing/env.cmi
+    parsing/parsetree.cmi parsing/location.cmi typing/env.cmi
 typing/path.cmi: typing/ident.cmi
 typing/predef.cmi: typing/types.cmi typing/path.cmi typing/ident.cmi
 typing/primitive.cmi:
 typing/typemod.cmi: typing/types.cmi typing/typedtree.cmi \
     parsing/parsetree.cmi parsing/longident.cmi parsing/location.cmi \
     typing/includemod.cmi typing/ident.cmi typing/env.cmi
-typing/types.cmi: typing/primitive.cmi typing/path.cmi typing/ident.cmi \
-    parsing/asttypes.cmi
+typing/types.cmi: typing/primitive.cmi typing/path.cmi parsing/location.cmi \
+    typing/ident.cmi parsing/asttypes.cmi
 typing/typetexp.cmi: typing/types.cmi typing/path.cmi parsing/parsetree.cmi \
     parsing/longident.cmi parsing/location.cmi typing/env.cmi
 typing/unused_var.cmi: parsing/parsetree.cmi
 typing/btype.cmx: typing/types.cmx typing/path.cmx utils/misc.cmx \
     typing/btype.cmi
 typing/ctype.cmo: typing/types.cmi typing/subst.cmi typing/path.cmi \
-    utils/misc.cmi parsing/longident.cmi typing/ident.cmi typing/env.cmi \
-    utils/clflags.cmi typing/btype.cmi parsing/asttypes.cmi typing/ctype.cmi
+    utils/misc.cmi parsing/longident.cmi parsing/location.cmi \
+    typing/ident.cmi typing/env.cmi utils/clflags.cmi typing/btype.cmi \
+    parsing/asttypes.cmi typing/ctype.cmi
 typing/ctype.cmx: typing/types.cmx typing/subst.cmx typing/path.cmx \
-    utils/misc.cmx parsing/longident.cmx typing/ident.cmx typing/env.cmx \
-    utils/clflags.cmx typing/btype.cmx parsing/asttypes.cmi typing/ctype.cmi
+    utils/misc.cmx parsing/longident.cmx parsing/location.cmx \
+    typing/ident.cmx typing/env.cmx utils/clflags.cmx typing/btype.cmx \
+    parsing/asttypes.cmi typing/ctype.cmi
 typing/datarepr.cmo: typing/types.cmi typing/predef.cmi utils/misc.cmi \
-    parsing/asttypes.cmi typing/datarepr.cmi
+    typing/btype.cmi parsing/asttypes.cmi typing/datarepr.cmi
 typing/datarepr.cmx: typing/types.cmx typing/predef.cmx utils/misc.cmx \
-    parsing/asttypes.cmi typing/datarepr.cmi
+    typing/btype.cmx parsing/asttypes.cmi typing/datarepr.cmi
 typing/env.cmo: typing/types.cmi utils/tbl.cmi typing/subst.cmi \
     typing/predef.cmi typing/path.cmi utils/misc.cmi parsing/longident.cmi \
     typing/ident.cmi typing/datarepr.cmi utils/consistbl.cmi utils/config.cmi \
     typing/btype.cmx parsing/asttypes.cmi typing/includecore.cmi
 typing/includemod.cmo: typing/types.cmi typing/typedtree.cmi utils/tbl.cmi \
     typing/subst.cmi typing/printtyp.cmi typing/path.cmi typing/mtype.cmi \
-    utils/misc.cmi typing/includecore.cmi typing/includeclass.cmi \
-    typing/ident.cmi typing/env.cmi typing/ctype.cmi typing/includemod.cmi
+    utils/misc.cmi parsing/location.cmi typing/includecore.cmi \
+    typing/includeclass.cmi typing/ident.cmi typing/env.cmi typing/ctype.cmi \
+    utils/clflags.cmi typing/includemod.cmi
 typing/includemod.cmx: typing/types.cmx typing/typedtree.cmx utils/tbl.cmx \
     typing/subst.cmx typing/printtyp.cmx typing/path.cmx typing/mtype.cmx \
-    utils/misc.cmx typing/includecore.cmx typing/includeclass.cmx \
-    typing/ident.cmx typing/env.cmx typing/ctype.cmx typing/includemod.cmi
+    utils/misc.cmx parsing/location.cmx typing/includecore.cmx \
+    typing/includeclass.cmx typing/ident.cmx typing/env.cmx typing/ctype.cmx \
+    utils/clflags.cmx typing/includemod.cmi
 typing/mtype.cmo: typing/types.cmi typing/subst.cmi typing/path.cmi \
     typing/ident.cmi typing/env.cmi typing/ctype.cmi utils/clflags.cmi \
     typing/btype.cmi parsing/asttypes.cmi typing/mtype.cmi
 typing/oprint.cmx: typing/outcometree.cmi parsing/asttypes.cmi \
     typing/oprint.cmi
 typing/parmatch.cmo: utils/warnings.cmi typing/types.cmi typing/typedtree.cmi \
-    typing/subst.cmi typing/predef.cmi typing/path.cmi utils/misc.cmi \
-    parsing/location.cmi typing/ident.cmi typing/env.cmi typing/datarepr.cmi \
-    typing/ctype.cmi typing/btype.cmi parsing/asttypes.cmi \
-    typing/parmatch.cmi
+    typing/subst.cmi typing/predef.cmi typing/path.cmi parsing/parsetree.cmi \
+    utils/misc.cmi parsing/longident.cmi parsing/location.cmi \
+    typing/ident.cmi typing/env.cmi typing/datarepr.cmi typing/ctype.cmi \
+    typing/btype.cmi parsing/asttypes.cmi typing/parmatch.cmi
 typing/parmatch.cmx: utils/warnings.cmx typing/types.cmx typing/typedtree.cmx \
-    typing/subst.cmx typing/predef.cmx typing/path.cmx utils/misc.cmx \
-    parsing/location.cmx typing/ident.cmx typing/env.cmx typing/datarepr.cmx \
-    typing/ctype.cmx typing/btype.cmx parsing/asttypes.cmi \
-    typing/parmatch.cmi
+    typing/subst.cmx typing/predef.cmx typing/path.cmx parsing/parsetree.cmi \
+    utils/misc.cmx parsing/longident.cmx parsing/location.cmx \
+    typing/ident.cmx typing/env.cmx typing/datarepr.cmx typing/ctype.cmx \
+    typing/btype.cmx parsing/asttypes.cmi typing/parmatch.cmi
 typing/path.cmo: typing/ident.cmi typing/path.cmi
 typing/path.cmx: typing/ident.cmx typing/path.cmi
-typing/predef.cmo: typing/types.cmi typing/path.cmi typing/ident.cmi \
-    typing/btype.cmi parsing/asttypes.cmi typing/predef.cmi
-typing/predef.cmx: typing/types.cmx typing/path.cmx typing/ident.cmx \
-    typing/btype.cmx parsing/asttypes.cmi typing/predef.cmi
+typing/predef.cmo: typing/types.cmi typing/path.cmi parsing/location.cmi \
+    typing/ident.cmi typing/btype.cmi parsing/asttypes.cmi typing/predef.cmi
+typing/predef.cmx: typing/types.cmx typing/path.cmx parsing/location.cmx \
+    typing/ident.cmx typing/btype.cmx parsing/asttypes.cmi typing/predef.cmi
 typing/primitive.cmo: utils/misc.cmi typing/primitive.cmi
 typing/primitive.cmx: utils/misc.cmx typing/primitive.cmi
 typing/printtyp.cmo: typing/types.cmi typing/primitive.cmi typing/predef.cmi \
 typing/stypes.cmx: typing/typedtree.cmx typing/printtyp.cmx \
     parsing/location.cmx utils/clflags.cmx typing/annot.cmi typing/stypes.cmi
 typing/subst.cmo: typing/types.cmi utils/tbl.cmi typing/path.cmi \
-    utils/misc.cmi typing/ident.cmi typing/btype.cmi typing/subst.cmi
+    utils/misc.cmi parsing/location.cmi typing/ident.cmi typing/btype.cmi \
+    typing/subst.cmi
 typing/subst.cmx: typing/types.cmx utils/tbl.cmx typing/path.cmx \
-    utils/misc.cmx typing/ident.cmx typing/btype.cmx typing/subst.cmi
+    utils/misc.cmx parsing/location.cmx typing/ident.cmx typing/btype.cmx \
+    typing/subst.cmi
 typing/typeclass.cmo: utils/warnings.cmi typing/typetexp.cmi typing/types.cmi \
     typing/typedtree.cmi typing/typedecl.cmi typing/typecore.cmi \
     typing/subst.cmi typing/stypes.cmi typing/printtyp.cmi typing/predef.cmi \
 typing/typedtree.cmx: typing/types.cmx typing/primitive.cmx typing/path.cmx \
     utils/misc.cmx parsing/location.cmx typing/ident.cmx typing/env.cmx \
     parsing/asttypes.cmi typing/typedtree.cmi
-typing/typemod.cmo: typing/typetexp.cmi typing/types.cmi typing/typedtree.cmi \
-    typing/typedecl.cmi typing/typecore.cmi typing/typeclass.cmi \
-    typing/subst.cmi typing/stypes.cmi typing/printtyp.cmi typing/path.cmi \
-    parsing/parsetree.cmi typing/mtype.cmi utils/misc.cmi \
-    parsing/longident.cmi parsing/location.cmi typing/includemod.cmi \
-    typing/ident.cmi typing/env.cmi typing/ctype.cmi utils/config.cmi \
-    utils/clflags.cmi typing/btype.cmi parsing/asttypes.cmi typing/annot.cmi \
-    typing/typemod.cmi
-typing/typemod.cmx: typing/typetexp.cmx typing/types.cmx typing/typedtree.cmx \
-    typing/typedecl.cmx typing/typecore.cmx typing/typeclass.cmx \
-    typing/subst.cmx typing/stypes.cmx typing/printtyp.cmx typing/path.cmx \
-    parsing/parsetree.cmi typing/mtype.cmx utils/misc.cmx \
-    parsing/longident.cmx parsing/location.cmx typing/includemod.cmx \
-    typing/ident.cmx typing/env.cmx typing/ctype.cmx utils/config.cmx \
-    utils/clflags.cmx typing/btype.cmx parsing/asttypes.cmi typing/annot.cmi \
-    typing/typemod.cmi
+typing/typemod.cmo: utils/warnings.cmi typing/typetexp.cmi typing/types.cmi \
+    typing/typedtree.cmi typing/typedecl.cmi typing/typecore.cmi \
+    typing/typeclass.cmi typing/subst.cmi typing/stypes.cmi \
+    typing/printtyp.cmi typing/path.cmi parsing/parsetree.cmi \
+    typing/mtype.cmi utils/misc.cmi parsing/longident.cmi \
+    parsing/location.cmi typing/includemod.cmi typing/ident.cmi \
+    typing/env.cmi typing/ctype.cmi utils/config.cmi utils/clflags.cmi \
+    typing/btype.cmi parsing/asttypes.cmi typing/annot.cmi typing/typemod.cmi
+typing/typemod.cmx: utils/warnings.cmx typing/typetexp.cmx typing/types.cmx \
+    typing/typedtree.cmx typing/typedecl.cmx typing/typecore.cmx \
+    typing/typeclass.cmx typing/subst.cmx typing/stypes.cmx \
+    typing/printtyp.cmx typing/path.cmx parsing/parsetree.cmi \
+    typing/mtype.cmx utils/misc.cmx parsing/longident.cmx \
+    parsing/location.cmx typing/includemod.cmx typing/ident.cmx \
+    typing/env.cmx typing/ctype.cmx utils/config.cmx utils/clflags.cmx \
+    typing/btype.cmx parsing/asttypes.cmi typing/annot.cmi typing/typemod.cmi
 typing/types.cmo: typing/primitive.cmi typing/path.cmi utils/misc.cmi \
-    typing/ident.cmi parsing/asttypes.cmi typing/types.cmi
+    parsing/location.cmi typing/ident.cmi parsing/asttypes.cmi \
+    typing/types.cmi
 typing/types.cmx: typing/primitive.cmx typing/path.cmx utils/misc.cmx \
-    typing/ident.cmx parsing/asttypes.cmi typing/types.cmi
+    parsing/location.cmx typing/ident.cmx parsing/asttypes.cmi \
+    typing/types.cmi
 typing/typetexp.cmo: utils/warnings.cmi typing/types.cmi utils/tbl.cmi \
     typing/printtyp.cmi typing/path.cmi parsing/parsetree.cmi utils/misc.cmi \
     parsing/longident.cmi parsing/location.cmi typing/env.cmi \
     parsing/asttypes.cmi bytecomp/printlambda.cmi
 bytecomp/runtimedef.cmo: bytecomp/runtimedef.cmi
 bytecomp/runtimedef.cmx: bytecomp/runtimedef.cmi
-bytecomp/simplif.cmo: typing/stypes.cmi bytecomp/lambda.cmi typing/ident.cmi \
-    utils/clflags.cmi parsing/asttypes.cmi typing/annot.cmi \
+bytecomp/simplif.cmo: utils/tbl.cmi typing/stypes.cmi bytecomp/lambda.cmi \
+    typing/ident.cmi utils/clflags.cmi parsing/asttypes.cmi typing/annot.cmi \
     bytecomp/simplif.cmi
-bytecomp/simplif.cmx: typing/stypes.cmx bytecomp/lambda.cmx typing/ident.cmx \
-    utils/clflags.cmx parsing/asttypes.cmi typing/annot.cmi \
+bytecomp/simplif.cmx: utils/tbl.cmx typing/stypes.cmx bytecomp/lambda.cmx \
+    typing/ident.cmx utils/clflags.cmx parsing/asttypes.cmi typing/annot.cmi \
     bytecomp/simplif.cmi
 bytecomp/switch.cmo: bytecomp/switch.cmi
 bytecomp/switch.cmx: bytecomp/switch.cmi
 asmcomp/codegen.cmi: asmcomp/cmm.cmi
 asmcomp/coloring.cmi:
 asmcomp/comballoc.cmi: asmcomp/mach.cmi
-asmcomp/compilenv.cmi: typing/ident.cmi asmcomp/cmx_format.cmi \
-    asmcomp/clambda.cmi
+asmcomp/compilenv.cmi: bytecomp/lambda.cmi typing/ident.cmi \
+    asmcomp/cmx_format.cmi asmcomp/clambda.cmi
 asmcomp/debuginfo.cmi: parsing/location.cmi bytecomp/lambda.cmi
 asmcomp/emit.cmi: asmcomp/linearize.cmi asmcomp/cmm.cmi
 asmcomp/emitaux.cmi: asmcomp/debuginfo.cmi
     asmcomp/arch.cmo asmcomp/comballoc.cmi
 asmcomp/comballoc.cmx: asmcomp/reg.cmx asmcomp/mach.cmx utils/config.cmx \
     asmcomp/arch.cmx asmcomp/comballoc.cmi
-asmcomp/compilenv.cmo: utils/misc.cmi typing/ident.cmi typing/env.cmi \
-    utils/config.cmi asmcomp/cmx_format.cmi asmcomp/clambda.cmi \
-    asmcomp/compilenv.cmi
-asmcomp/compilenv.cmx: utils/misc.cmx typing/ident.cmx typing/env.cmx \
-    utils/config.cmx asmcomp/cmx_format.cmi asmcomp/clambda.cmx \
-    asmcomp/compilenv.cmi
+asmcomp/compilenv.cmo: utils/misc.cmi bytecomp/lambda.cmi typing/ident.cmi \
+    typing/env.cmi utils/config.cmi asmcomp/cmx_format.cmi \
+    asmcomp/clambda.cmi asmcomp/compilenv.cmi
+asmcomp/compilenv.cmx: utils/misc.cmx bytecomp/lambda.cmx typing/ident.cmx \
+    typing/env.cmx utils/config.cmx asmcomp/cmx_format.cmi \
+    asmcomp/clambda.cmx asmcomp/compilenv.cmi
 asmcomp/debuginfo.cmo: parsing/location.cmi bytecomp/lambda.cmi \
     asmcomp/debuginfo.cmi
 asmcomp/debuginfo.cmx: parsing/location.cmx bytecomp/lambda.cmx \
 -------------
 
 - The official name of the language is now OCaml.
-- Warning 28 is now enabled by default.
 
 Language features:
-- Added GADTs to the language. See testsuite/tests/typing-gadts for
-  the syntax and some examples of use. Please use -principal for testing.
+- Added Generalized Abstract Data Types (GADTs) to the language. See
+  testsuite/tests/typing-gadts for the syntax and some examples of
+  use. Please use -principal for testing.
 - It is now possible to omit type annotations when packing and unpacking
   first-class modules. The type-checker attempts to infer it from the context.
   Using the -principal option guarantees forward compatibility.
 - New (module M) and (module M : S) syntax in patterns, for immediate
   unpacking of a first-class module.
+- New syntax "let.e0 p = e1 in e2" where e0 is a simple expression,
+  expanded to "e0 e1 (fun p -> e2).
 
 Compilers:
 - Revised simplification of let-alias (PR#5205, PR#5288)
+- Better reporting of compiler version mismatch in .cmi files
+- Warning 28 is now enabled by default.
+- New option -absname to use absolute paths in error messages
 
 Native-code compiler:
 - Optimized handling of partially-applied functions (PR#5287)
+- Small improvements in code generated for array bounds checks (PR#5345, PR#5360).
 
 Standard library:
 - Added float functions "hypot" and "copysign" (PR#3806, PR#4752, PR#5246)
+- Array: faster implementations of "blit", "copy", "sub", "append" and "concat"
+  (PR#2395, PR#2787, PR#4591)
 - Hashtbl:
     . Statistically-better generic hash function based on Murmur 3 (PR#5225)
     . Fixed behavior of generic hash function w.r.t. -0.0 and NaN (PR#5222)
     . Added optional "seed" parameter to Hashtbl.create for diversification
     . Added new functorial interface "MakeSeeded" to support diversification
       with user-provided hash functions.
+- Arg: options with empty doc strings are no longer included in the usage string
+  (PR#5437)
 
 Bug Fixes:
+- PR#4869: rare collisions between assembly labels for code and data
+- PR#4880: "assert" constructs now show up in the exception stack backtrace
 - PR#5322: type abbreviations expanding to a universal type variable
 - PR#5330: thread tag with '.top' and '.inferred.mli' targets
+- PR#5343: ocaml -rectypes is unsound wrt module subtyping
+- PR#5416: (Windows) Unix.(set|clear)_close_on_exec now preserves blocking mode
+- PR#5436: update object ids on unmarshaling
+- emacs mode: colorization of comments and strings now works correctly
+- PR#5313: ocamlopt -g misses optimizations
+
+Feature wishes:
+- PR#5358: first class modules don't allow "with type" declarations for types
+  in sub-modules
+- PR#5411: new directive for the toplevel: #load_rec
+- PR#5420: Unix.openfile share mode (Windows)
+
+Shedding weight:
+- Removed the obsolete native-code generators for Alpha, HPPA, IA64 and MIPS.
+- The "DBM" library (interface with Unix DBM key-value stores) is no
+  longer part of this distribution.  It now lives its own life at
+  https://forge.ocamlcore.org/projects/camldbm/
+
 
 OCaml 3.12.1:
 ----------------------
 
 * First public release.
 
-$Id: Changes 11169 2011-08-08 09:39:10Z xclerc $
+$Id: Changes 11943 2011-12-22 19:11:30Z meyer $
 #                                                                       #
 #########################################################################
 
-# $Id: Makefile 11166 2011-08-04 14:59:13Z doligez $
+# $Id: Makefile 11881 2011-12-17 10:45:23Z xleroy $
 
 # The main Makefile
 
 EXPUNGEOBJS=utils/misc.cmo utils/tbl.cmo \
   utils/config.cmo utils/clflags.cmo \
   typing/ident.cmo typing/path.cmo typing/types.cmo typing/btype.cmo \
+  utils/warnings.cmo parsing/location.cmo \
   typing/predef.cmo bytecomp/runtimedef.cmo bytecomp/bytesections.cmo \
   bytecomp/dll.cmo bytecomp/meta.cmo bytecomp/symtable.cmo toplevel/expunge.cmo
 
 	if test -d $(MANDIR)/man$(MANEXT); then : ; \
 	  else $(MKDIR) $(MANDIR)/man$(MANEXT); fi
 	cd $(LIBDIR); rm -f dllbigarray.so dlllabltk.so dllnums.so \
-	  dllthreads.so dllunix.so dllgraphics.so dllmldbm.so dllstr.so \
+	  dllthreads.so dllunix.so dllgraphics.so dllstr.so \
 	  dlltkanim.so
 	cd byterun; $(MAKE) install
 	cp ocamlc $(BINDIR)/ocamlc$(EXE)
 #                                                                       #
 #########################################################################
 
-# $Id: Makefile.nt 11156 2011-07-27 14:17:02Z doligez $
+# $Id: Makefile.nt 11319 2011-12-16 17:02:48Z xleroy $
 
 # The main Makefile
 
 
 OPTUTILS=$(UTILS)
 
-PARSING=parsing/linenum.cmo parsing/location.cmo parsing/longident.cmo \
+PARSING=parsing/location.cmo parsing/longident.cmo \
   parsing/syntaxerr.cmo parsing/parser.cmo \
   parsing/lexer.cmo parsing/parse.cmo parsing/printast.cmo
 
 EXPUNGEOBJS=utils/misc.cmo utils/tbl.cmo \
   utils/config.cmo utils/clflags.cmo \
   typing/ident.cmo typing/path.cmo typing/types.cmo typing/btype.cmo \
+  utils/warnings.cmo parsing/location.cmo \
   typing/predef.cmo bytecomp/runtimedef.cmo bytecomp/bytesections.cmo \
-  bytecomp/dll.cmo \
-  bytecomp/symtable.cmo toplevel/expunge.cmo
+  bytecomp/dll.cmo bytecomp/meta.cmo bytecomp/symtable.cmo toplevel/expunge.cmo
 
 PERVASIVES=$(STDLIB_MODULES) topdirs toploop outcometree
 
 
 beforedepend:: parsing/lexer.ml
 
-# The auxiliary lexer for counting line numbers
-
-parsing/linenum.ml: parsing/linenum.mll
-	$(CAMLLEX) parsing/linenum.mll
-
-partialclean::
-	rm -f parsing/linenum.ml
-
-beforedepend:: parsing/linenum.ml
-
 # The bytecode compiler compiled with the native-code compiler
 
 ocamlc.opt: $(COMPOBJS:.cmo=.cmx)
 beforedepend:: asmcomp/arch.ml
 
 ifeq ($(TOOLCHAIN),msvc)
-ASMCOMP_PROC=asmcomp/$(ARCH)/proc_nt.ml
 ASMCOMP_EMIT=asmcomp/$(ARCH)/emit_nt.mlp
 else
-ASMCOMP_PROC=asmcomp/$(ARCH)/proc.ml
 ASMCOMP_EMIT=asmcomp/$(ARCH)/emit.mlp
 endif
 
-asmcomp/proc.ml: $(ASMCOMP_PROC)
-	cp $(ASMCOMP_PROC) asmcomp/proc.ml
+asmcomp/proc.ml: asmcomp/$(ARCH)/proc.ml
+	cp asmcomp/$(ARCH)/proc.ml asmcomp/proc.ml
 
 partialclean::
 	rm -f asmcomp/proc.ml
 
     AMD64 (Opteron)    Linux, MacOS X, MS Windows
     IA32 (Pentium)     Linux, FreeBSD, MacOS X, MS Windows
-    PowerPC            MacOS X
+    PowerPC            Linux, MacOS X
+    ARM                Linux
 
 Tier 2 (maintained when possible, with help from users):
 
-    Alpha              Digital Unix/Compaq Tru64, Linux, all BSD
     AMD64              FreeBSD, OpenBSD
-    HP PA-RISC         HPUX 11, Linux
     IA32 (Pentium)     NetBSD, OpenBSD, Solaris 9
-    IA64               Linux, FreeBSD
-    MIPS               IRIX 6
-    PowerPC            Linux, NetBSD
-    SPARC              Solaris 9, Linux, NetBSD
-    Strong ARM         Linux
+    PowerPC            NetBSD
+    SPARC              Solaris, Linux, NetBSD
 
 Other operating systems for the processors above have not been tested,
 but the compiler may work under other operating systems with little work.
 
 All files marked "Copyright INRIA" in this distribution are copyright
 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-2007, 2008 Institut National de Recherche en Informatique et en Automatique
-(INRIA) and distributed under the conditions stated in file LICENSE.
+2007, 2008, 2009, 2010, 2011, 2012 Institut National de Recherche en
+Informatique et en Automatique (INRIA) and distributed under the
+conditions stated in file LICENSE.
 
 INSTALLATION:
 
 developed at INRIA. The purpose of this list is to share
 experience, exchange ideas (and even code), and report on applications
 of the Caml language. Messages can be written in English or in
-French. The list has about 750 subscribers.
+French. The list has more than 1000 subscribers.
 
 Messages to the list should be sent to:
 
 
 You can subscribe to this list via the Web interface at
 
-    http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
+        https://sympa-roc.inria.fr/wws/info/caml-list
 
-Archives of the list are available on the Web site http://caml.inria.fr/
+Archives of the list are available on the Web site above.
 
 The Usenet news groups comp.lang.ml and comp.lang.functional
 also contains discussions about the ML family of programming languages,
 
 
 ----
-$Id: README 11123 2011-07-20 09:17:07Z doligez $
+$Id: README 11882 2011-12-17 11:12:50Z xleroy $
 
 There are no less than four ports of OCaml for MS Windows available:
   - a native Win32 port, built with the Microsoft development tools;
-  - a native Win32 port, built with the Cygwin/MinGW development tools;
+  - a native Win32 port, built with the 32-bit version of the gcc
+    compiler from the mingw-w64 project, packaged in Cygwin
+    (under the name mingw64-i686);
   - a port consisting of the Unix sources compiled under the Cygwin
     Unix-like environment for Windows;
   - a native Win64 port (64-bit Windows), built with the Microsoft
            The native Win32 port built with Mingw
            --------------------------------------
 
-NOTE: Due to changes in cygwin's compilers, this port is not available
-in OCaml 3.12.1.  A patch will be made available soon after the release
-of 3.12.1.
-
 REQUIREMENTS:
 
 This port runs under MS Windows Vista, XP, and 2000.
         http://alain.frisch.fr/flexdll.html
 You will need to install at least the following Cygwin packages (use
 the Setup tool from Cygwin):
-binutils, gcc-core, gcc-mingw-core, mingw-runtime, w32api.
 
-Do *not* install the Mingw/MSYS development tools from www.mingw.org:
-these are not compatible with this Caml port (@responsefile not
-recognized on the command line).
+ mingw64-i686-binutils
+ mingw64-i686-gcc
+ mingw64-i686-runtime
+
+
+NOTE:
+  - There is another 32-bit gcc compiler, from the MinGW.org
+    project, packaged in Cygwin under the name mingw-gcc.
+    It is not currently supported by flexdll and OCaml.
+
+  - The standard gcc compiler shipped with Cygwin used to
+    support a "-mno-cygwin" option, which turned the compiler
+    into a mingw compiler. This option was used
+    by previous versions of flexdll and OCaml, but it is no
+    longer available in recent version, hence the switch
+    to another toolchain packaged in Cygwin.
+
+  - The standalone mingw toolchain from the MinGW-w64 project
+    (http://mingw-w64.sourceforge.net/) is not supported.
+    Please use the version packaged in Cygwin instead.
 
 The LablTk GUI requires Tcl/Tk 8.5.  Windows binaries are available
 as part of the ActiveTCL distribution at
 You will need the following software components to perform the recompilation:
 - Windows NT, 2000, XP, or Vista.
 - Cygwin: http://sourceware.cygnus.com/cygwin/
-  Install at least the following packages: binutils, diffutils,
-    gcc-core, gcc-mingw-core, make, mingw-runtime, ncurses, w32api.
+  Install at least the following packages:
+     mingw64-i686-binutils
+     mingw64-i686-gcc
+     mingw64-i686-runtime
+     diffutils
+     make
+     ncurses
 - TCL/TK version 8.5 (see above).
 - The flexdll tool (see above).
 
-Do *not* install the standalone distribution of MinGW, nor the
-companion MSYS tools: these have problems with long command lines.
-Instead, use the version of MinGW provided by Cygwin.
+The standalone mingw toolchain from the MinGW-w64 project
+(http://mingw-w64.sourceforge.net/) is not supported.  Please use the
+version packaged in Cygwin instead.
 
 Start a Cygwin shell and unpack the source distribution
 (ocaml-X.YY.Z.tar.gz) with "tar xzf".  Change to the top-level
     http://www.microsoft.com/downloads/en/default.aspx
     under the name "Microsoft Windows 7 SDK".
 
-[2] flexdll version 0.23 or later.
+[2] flexdll version 0.27 or later.
     Can be downloaded from http://alain.frisch.fr/flexdll.html
 
 
-3.13.0+dev6 (2011-07-29)
+3.13.0+dev8 (2011-10-25)
 
 # The version string is the first line of this file.
 # It must be in the format described in stdlib/sys.mli
 
-# $Id: VERSION 11160 2011-07-29 10:32:43Z garrigue $
+# $Id: VERSION 11244 2011-10-25 13:15:19Z weis $

asmcomp/amd64/emit.mlp

 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: emit.mlp 11156 2011-07-27 14:17:02Z doligez $ *)
+(* $Id: emit.mlp 11927 2011-12-21 16:31:01Z xleroy $ *)
 
 (* Emission of x86-64 (AMD 64) assembly code *)
 
 open Linearize
 open Emitaux
 
-let macosx =
-  match Config.system with
-  | "macosx" -> true
-  | _ -> false
-
+let macosx = (Config.system = "macosx")
+let mingw64 = (Config.system = "mingw64")
 
 (* Tradeoff between code size and code speed *)
 
     Emitaux.emit_symbol '$' s
 
 let emit_call s =
-  if !Clflags.dlcode && not macosx
+  if !Clflags.dlcode && not macosx && not mingw64
   then `call	{emit_symbol s}@PLT`
   else `call	{emit_symbol s}`
 
 let emit_jump s =
-  if !Clflags.dlcode && not macosx
+  if !Clflags.dlcode && not macosx && not mingw64
   then `jmp	{emit_symbol s}@PLT`
   else `jmp	{emit_symbol s}`
 
 let load_symbol_addr s =
-  if !Clflags.dlcode
+  if !Clflags.dlcode && not mingw64
   then `movq	{emit_symbol s}@GOTPCREL(%rip)`
   else if !pic_code
   then `leaq	{emit_symbol s}(%rip)`
 let emit_label lbl =
   emit_string ".L"; emit_int lbl
 
+let emit_data_label lbl =
+  emit_string ".Ld"; emit_int lbl
+
 (* Output a .align directive. *)
 
 let emit_align n =
         `	movslq	({emit_reg tmp1}, {emit_reg i.arg.(0)}, 4), {emit_reg tmp2}\n`;
         `	addq	{emit_reg tmp2}, {emit_reg tmp1}\n`;
         `	jmp	*{emit_reg tmp1}\n`;
-        if macosx
-        then `	.const\n`
-        else `	.section .rodata\n`;
+        if macosx then
+          `	.const\n`
+        else if mingw64 then
+          `	.section .rdata,\"dr\"\n`
+        else
+          `	.section .rodata\n`;
         emit_align 4;
         `{emit_label lbl}:`;
         for i = 0 to Array.length jumptbl - 1 do
     | _ -> ()
   end;
   if !float_constants <> [] then begin
-    if macosx
-    then `	.literal8\n`
-    else `	.section	.rodata.cst8,\"a\",@progbits\n`;
+    if macosx then
+      `	.literal8\n`
+    else if mingw64 then
+      `	.section .rdata,\"dr\"\n`
+    else
+      `	.section .rodata.cst8,\"a\",@progbits\n`;
     List.iter emit_float_constant !float_constants
   end
 
   | Cdefine_symbol s ->
       `{emit_symbol s}:\n`
   | Cdefine_label lbl ->
-      `{emit_label (100000 + lbl)}:\n`
+      `{emit_data_label lbl}:\n`
   | Cint8 n ->
       `	.byte	{emit_int n}\n`
   | Cint16 n ->
   | Csymbol_address s ->
       `	.quad	{emit_symbol s}\n`
   | Clabel_address lbl ->
-      `	.quad	{emit_label (100000 + lbl)}\n`
+      `	.quad	{emit_data_label lbl}\n`
   | Cstring s ->
       emit_string_directive "	.ascii	" s
   | Cskip n ->
   if !Clflags.dlcode then begin
     (* from amd64.S; could emit these constants on demand *)
     if macosx then
-        `	.literal16\n`
+      `	.literal16\n`
+    else if mingw64 then
+      `	.section .rdata,\"dr\"\n`
     else
-        `	.section        .rodata.cst8,\"a\",@progbits\n`;
+      `	.section .rodata.cst8,\"a\",@progbits\n`;
     emit_align 16;
     `{emit_symbol "caml_negf_mask"}:	.quad   0x8000000000000000, 0\n`;
     emit_align 16;

asmcomp/amd64/emit_nt.mlp

 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: emit_nt.mlp 11156 2011-07-27 14:17:02Z doligez $ *)
+(* $Id: emit_nt.mlp 11887 2011-12-18 10:00:56Z xleroy $ *)
 
 (* Emission of x86-64 (AMD 64) assembly code, MASM syntax *)
 
 let emit_label lbl =
   emit_string "L"; emit_int lbl
 
+let emit_data_label lbl =
+  emit_string "Ld"; emit_int lbl
+
 (* Output a .align directive. *)
 
 let emit_align n =
             end
     | Lswitch jumptbl ->
         let lbl = new_label() in
-        if !pic_code then begin
-          `	lea	r11, {emit_label lbl}\n`;
-          `	jmp	QWORD PTR [r11+{emit_reg i.arg.(0)}*8]\n`
-        end else begin
-          `	jmp	QWORD PTR [{emit_reg i.arg.(0)}*8 + {emit_label lbl}]\n`
-        end;
-        `	.DATA\n`;
-        emit_align 8;
-        `{emit_label lbl}	LABEL QWORD\n`;
+        (* rax and rdx are clobbered by the Lswitch,
+           meaning that no variable that is live across the Lswitch
+           is assigned to rax or rdx.  However, the argument to Lswitch
+           can still be assigned to one of these two registers, so
+           we must be careful not to clobber it before use. *)
+        let (tmp1, tmp2) =
+          if i.arg.(0).loc = Reg 0 (* rax *)
+          then (phys_reg 4 (*rdx*), phys_reg 0 (*rax*))
+          else (phys_reg 0 (*rax*), phys_reg 4 (*rdx*)) in
+        `	lea	{emit_reg tmp1}, {emit_label lbl}\n`;
+        `	movsxd	{emit_reg tmp2}, DWORD PTR [{emit_reg tmp1}+{emit_reg i.arg.(0)}*4]\n`;
+        `	add	{emit_reg tmp1}, {emit_reg tmp2}\n`;
+        `	jmp	{emit_reg tmp1}\n`;
+        emit_align 4;
+        `{emit_label lbl}	LABEL DWORD\n`;
         for i = 0 to Array.length jumptbl - 1 do
-          `	QWORD	{emit_label jumptbl.(i)}\n`
-        done;
-        `	.CODE\n`
+          `	DWORD	{emit_label jumptbl.(i)} - {emit_label lbl}\n`
+        done
     | Lsetuptrap lbl ->
         `	call	{emit_label lbl}\n`
     | Lpushtrap ->
       add_def_symbol s;
       `{emit_symbol s} LABEL QWORD\n`
   | Cdefine_label lbl ->
-      `{emit_label (100000 + lbl)} LABEL QWORD\n`
+      `{emit_data_label lbl} LABEL QWORD\n`
   | Cint8 n ->
       `	BYTE	{emit_int n}\n`
   | Cint16 n ->
       add_used_symbol s;
       `	QWORD	{emit_symbol s}\n`
   | Clabel_address lbl ->
-      `	QWORD	{emit_label (100000 + lbl)}\n`
+      `	QWORD	{emit_data_label lbl}\n`
   | Cstring s ->
       emit_bytes_directive "	BYTE	" s
   | Cskip n ->

asmcomp/amd64/proc.ml

 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: proc.ml 11156 2011-07-27 14:17:02Z doligez $ *)
+(* $Id: proc.ml 11319 2011-12-16 17:02:48Z xleroy $ *)
 
 (* Description of the AMD64 processor *)
 
 open Reg
 open Mach
 
+(* Which ABI to use *)
+
+let win64 =
+  match Config.system with
+  | "win64" | "mingw64" -> true
+  | _                   -> false
+
+(* Which asm conventions to use *)
+
+let masm =
+  match Config.ccomp_type with
+  | "msvc" -> true
+  | _      -> false
+
 (* Registers available for register allocation *)
 
 (* Register map:
-    rax         0               rax - r11: Caml function arguments
-    rbx         1               rdi - r9: C function arguments
-    rdi         2               rax: Caml and C function results
-    rsi         3               rbx, rbp, r12-r15 are preserved by C
+    rax         0
+    rbx         1
+    rdi         2
+    rsi         3
     rdx         4
     rcx         5
     r8          6
     r14         trap pointer
     r15         allocation pointer
 
-  xmm0 - xmm15  100 - 115       xmm0 - xmm9: Caml function arguments
-                                xmm0 - xmm7: C function arguments
-                                xmm0: Caml and C function results *)
+  xmm0 - xmm15  100 - 115  *)
+
+(* Conventions:
+     rax - r11: Caml function arguments
+     rax: Caml and C function results
+     xmm0 - xmm9: Caml function arguments
+     xmm0: Caml and C function results
+   Under Unix:
+     rdi, rsi, rdx, rcx, r8, r9: C function arguments
+     xmm0 - xmm7: C function arguments
+     rbx, rbp, r12-r15 are preserved by C
+     xmm registers are not preserved by C
+   Under Win64:
+     rcx, rdx, r8, r9: C function arguments
+     xmm0 - xmm3: C function arguments
+     rbx, rbp, rsi, rdi r12-r15 are preserved by C
+     xmm6-xmm15 are preserved by C
+*)
 
 let int_reg_name =
-  [| "%rax"; "%rbx"; "%rdi"; "%rsi"; "%rdx"; "%rcx"; "%r8"; "%r9";
-     "%r10"; "%r11"; "%rbp"; "%r12"; "%r13" |]
+  match Config.ccomp_type with
+  | "msvc" ->
+      [| "rax"; "rbx"; "rdi"; "rsi"; "rdx"; "rcx"; "r8"; "r9";
+         "r10"; "r11"; "rbp"; "r12"; "r13" |]
+  | _ ->
+      [| "%rax"; "%rbx"; "%rdi"; "%rsi"; "%rdx"; "%rcx"; "%r8"; "%r9";
+         "%r10"; "%r11"; "%rbp"; "%r12"; "%r13" |]
 
 let float_reg_name =
-  [| "%xmm0"; "%xmm1"; "%xmm2"; "%xmm3"; "%xmm4"; "%xmm5"; "%xmm6"; "%xmm7";
-     "%xmm8"; "%xmm9"; "%xmm10"; "%xmm11";
-     "%xmm12"; "%xmm13"; "%xmm14"; "%xmm15" |]
+  match Config.ccomp_type with
+  | "msvc" ->
+      [| "xmm0"; "xmm1"; "xmm2"; "xmm3"; "xmm4"; "xmm5"; "xmm6"; "xmm7";
+         "xmm8"; "xmm9"; "xmm10"; "xmm11";
+         "xmm12"; "xmm13"; "xmm14"; "xmm15" |]
+  | _ ->
+      [| "%xmm0"; "%xmm1"; "%xmm2"; "%xmm3"; "%xmm4"; "%xmm5"; "%xmm6"; "%xmm7";
+         "%xmm8"; "%xmm9"; "%xmm10"; "%xmm11";
+         "%xmm12"; "%xmm13"; "%xmm14"; "%xmm15" |]
 
 let num_register_classes = 2
 
 let loc_results res =
   let (loc, ofs) = calling_conventions 0 0 100 100 not_supported res in loc
 
-(* C calling convention:
+(* C calling conventions under Unix:
      first integer args in rdi, rsi, rdx, rcx, r8, r9
      first float args in xmm0 ... xmm7
-     remaining args on stack.
-   Return value in rax or xmm0. *)
+     remaining args on stack
+     return value in rax or xmm0.
+  C calling conventions under Win64:
+     first integer args in rcx, rdx, r8, r9
+     first float args in xmm0 ... xmm3     
+     each integer arg consumes a float reg, and conversely
+     remaining args on stack
+     always 32 bytes reserved at bottom of stack.
+     Return value in rax or xmm0. *)
 
-let loc_external_arguments arg =
-  calling_conventions 2 7 100 107 outgoing arg
 let loc_external_results res =
   let (loc, ofs) = calling_conventions 0 0 100 100 not_supported res in loc
 
+let unix_loc_external_arguments arg =
+  calling_conventions 2 7 100 107 outgoing arg
+
+let win64_int_external_arguments =
+  [| 5 (*rcx*); 4 (*rdx*); 6 (*r8*); 7 (*r9*) |]
+let win64_float_external_arguments =
+  [| 100 (*xmm0*); 101 (*xmm1*); 102 (*xmm2*); 103 (*xmm3*) |]
+
+let win64_loc_external_arguments arg =
+  let loc = Array.create (Array.length arg) Reg.dummy in
+  let reg = ref 0
+  and ofs = ref 32 in
+  for i = 0 to Array.length arg - 1 do
+    match arg.(i).typ with
+      Int | Addr as ty ->
+        if !reg < 4 then begin
+          loc.(i) <- phys_reg win64_int_external_arguments.(!reg);
+          incr reg
+        end else begin
+          loc.(i) <- stack_slot (Outgoing !ofs) ty;
+          ofs := !ofs + size_int
+        end
+    | Float ->
+        if !reg < 4 then begin
+          loc.(i) <- phys_reg win64_float_external_arguments.(!reg);
+          incr reg
+        end else begin
+          loc.(i) <- stack_slot (Outgoing !ofs) Float;
+          ofs := !ofs + size_float
+        end
+  done;
+  (loc, Misc.align !ofs 16)  (* keep stack 16-aligned *)
+
+let loc_external_arguments =
+  if win64 then win64_loc_external_arguments else unix_loc_external_arguments
+
 let loc_exn_bucket = rax
 
 (* Registers destroyed by operations *)
 
-let destroyed_at_c_call =         (* rbp, rbx, r12-r15 preserved *)
-  Array.of_list(List.map phys_reg
-    [0;2;3;4;5;6;7;8;9;
-     100;101;102;103;104;105;106;107;
-     108;109;110;111;112;113;114;115])
+let destroyed_at_c_call =
+  if win64 then
+    (* Win64: rbx, rbp, rsi, rdi, r12-r15, xmm6-xmm15 preserved *)
+    Array.of_list(List.map phys_reg
+      [0;4;5;6;7;8;9;
+       100;101;102;103;104;105])
+  else
+    (* Unix: rbp, rbx, r12-r15 preserved *)
+    Array.of_list(List.map phys_reg
+      [0;2;3;4;5;6;7;8;9;
+       100;101;102;103;104;105;106;107;
+       108;109;110;111;112;113;114;115])
 
 let destroyed_at_oper = function
     Iop(Icall_ind | Icall_imm _ | Iextcall(_, true)) -> all_phys_regs
 (* Maximal register pressure *)
 
 let safe_register_pressure = function
-    Iextcall(_,_) -> 0
+    Iextcall(_,_) -> if win64 then 8 else 0
   | _ -> 11
 
 let max_register_pressure = function
-    Iextcall(_, _) -> [| 4; 0 |]
+    Iextcall(_, _) -> if win64 then [| 8; 10 |] else [| 4; 0 |]
   | Iintop(Idiv | Imod) -> [| 11; 16 |]
   | Ialloc _ | Iintop(Icomp _) | Iintop_imm((Idiv|Imod|Icomp _), _)
         -> [| 12; 16 |]
 (* Calling the assembler *)
 
 let assemble_file infile outfile =
-  Ccomp.command (Config.asm ^ " -o " ^
-                 Filename.quote outfile ^ " " ^ Filename.quote infile)
+  if masm then
+    Ccomp.command (Config.asm ^
+                   Filename.quote outfile ^ " " ^ Filename.quote infile ^
+                   (if !Clflags.verbose then "" else ">NUL"))
+  else
+    Ccomp.command (Config.asm ^ " -o " ^
+                   Filename.quote outfile ^ " " ^ Filename.quote infile)

asmcomp/arm/emit.mlp

 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: emit.mlp 11156 2011-07-27 14:17:02Z doligez $ *)
+(* $Id: emit.mlp 11887 2011-12-18 10:00:56Z xleroy $ *)
 
 (* Emission of ARM assembly code *)
 
 let emit_label lbl =
   emit_string ".L"; emit_int lbl
 
+let emit_data_label lbl =
+  emit_string ".Ld"; emit_int lbl
+
 (* Output a symbol *)
 
 let emit_symbol s =
   `	.text\n`;
   `	.align	2\n`;
   `	.global	{emit_symbol fundecl.fun_name}\n`;
+  `	.type	{emit_symbol fundecl.fun_name}, %function\n`;
   `{emit_symbol fundecl.fun_name}:\n`;
   let n = frame_size() in
   ignore(emit_stack_adjustment "sub" n);
   | Cdefine_symbol s ->
       `{emit_symbol s}:\n`
   | Cdefine_label lbl ->
-      `{emit_label (100000 + lbl)}:\n`
+      `{emit_data_label lbl}:\n`
   | Cint8 n ->
       `	.byte	{emit_int n}\n`
   | Cint16 n ->
   | Csymbol_address s ->
       `	.word	{emit_symbol s}\n`
   | Clabel_address lbl ->
-      `	.word	{emit_label (100000 + lbl)}\n`
+      `	.word	{emit_data_label lbl}\n`
   | Cstring s ->
       emit_string_directive "	.ascii  " s
   | Cskip n ->

asmcomp/cmmgen.ml

 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: cmmgen.ml 11156 2011-07-27 14:17:02Z doligez $ *)
+(* $Id: cmmgen.ml 11934 2011-12-22 09:36:45Z xleroy $ *)
 
 (* Translation from closed lambda to C-- *)
 
   make_alloc_generic float_array_set tag
                      (List.length args * size_float / size_addr) args
 
+(* Bounds checking *)
+
+let make_checkbound dbg = function
+  | [Cop(Clsr, [a1; Cconst_int n]); Cconst_int m] when (m lsl n) > n ->
+      Cop(Ccheckbound dbg, [a1; Cconst_int(m lsl n + 1 lsl n - 1)])
+  | args ->
+      Cop(Ccheckbound dbg, args)
+
 (* To compile "let rec" over values *)
 
 let fundecls_size fundecls =
 
 let bigarray_indexing unsafe elt_kind layout b args dbg =
   let check_bound a1 a2 k =
-    if unsafe then k else Csequence(Cop(Ccheckbound dbg, [a1;a2]), k) in
+    if unsafe then k else Csequence(make_checkbound dbg [a1;a2], k) in
   let rec ba_indexing dim_ofs delta_ofs = function
     [] -> assert false
   | [arg] ->
         (bind "str" (transl arg1) (fun str ->
           bind "index" (untag_int (transl arg2)) (fun idx ->
             Csequence(
-              Cop(Ccheckbound dbg, [string_length str; idx]),
+              make_checkbound dbg [string_length str; idx],
               Cop(Cload Byte_unsigned, [add_int str idx])))))
 
   (* Array operations *)
       end
   | Parrayrefs kind ->
       begin match kind with
-        Pgenarray ->
+      | Pgenarray ->
           bind "index" (transl arg2) (fun idx ->
-            bind "arr" (transl arg1) (fun arr ->
-              bind "header" (header arr) (fun hdr ->
-                Cifthenelse(is_addr_array_hdr hdr,
-                  Csequence(Cop(Ccheckbound dbg, [addr_array_length hdr; idx]),
-                            addr_array_ref arr idx),
-                  Csequence(Cop(Ccheckbound dbg, [float_array_length hdr; idx]),
-                            float_array_ref arr idx)))))
+          bind "arr" (transl arg1) (fun arr ->
+          bind "header" (header arr) (fun hdr ->
+            if wordsize_shift = numfloat_shift then
+              Csequence(make_checkbound dbg [addr_array_length hdr; idx],
+                        Cifthenelse(is_addr_array_hdr hdr, 
+                                    addr_array_ref arr idx,
+                                    float_array_ref arr idx))
+            else
+              Cifthenelse(is_addr_array_hdr hdr,
+                Csequence(make_checkbound dbg [addr_array_length hdr; idx],
+                          addr_array_ref arr idx),
+                Csequence(make_checkbound dbg [float_array_length hdr; idx],
+                          float_array_ref arr idx)))))
       | Paddrarray | Pintarray ->
           bind "index" (transl arg2) (fun idx ->
             bind "arr" (transl arg1) (fun arr ->
-              Csequence(Cop(Ccheckbound dbg, [addr_array_length(header arr); idx]),
+              Csequence(make_checkbound dbg [addr_array_length(header arr); idx],
                         addr_array_ref arr idx)))
       | Pfloatarray ->
           box_float(
             bind "index" (transl arg2) (fun idx ->
               bind "arr" (transl arg1) (fun arr ->
-                Csequence(Cop(Ccheckbound dbg,
-                              [float_array_length(header arr); idx]),
+                Csequence(make_checkbound dbg [float_array_length(header arr); idx],
                           unboxed_float_array_ref arr idx))))
       end
 
         (bind "str" (transl arg1) (fun str ->
           bind "index" (untag_int (transl arg2)) (fun idx ->
             Csequence(
-              Cop(Ccheckbound dbg, [string_length str; idx]),
+              make_checkbound dbg [string_length str; idx],
               Cop(Cstore Byte_unsigned,
                   [add_int str idx; untag_int(transl arg3)])))))
 
       end)
   | Parraysets kind ->
       return_unit(begin match kind with
-        Pgenarray ->
+      | Pgenarray ->
           bind "newval" (transl arg3) (fun newval ->
-            bind "index" (transl arg2) (fun idx ->
-              bind "arr" (transl arg1) (fun arr ->
-                bind "header" (header arr) (fun hdr ->
-                  Cifthenelse(is_addr_array_hdr hdr,
-                    Csequence(Cop(Ccheckbound dbg, [addr_array_length hdr; idx]),
-                              addr_array_set arr idx newval),
-                    Csequence(Cop(Ccheckbound dbg, [float_array_length hdr; idx]),
-                              float_array_set arr idx
-                                              (unbox_float newval)))))))
+          bind "index" (transl arg2) (fun idx ->
+          bind "arr" (transl arg1) (fun arr ->
+          bind "header" (header arr) (fun hdr ->
+            if wordsize_shift = numfloat_shift then
+              Csequence(make_checkbound dbg [addr_array_length hdr; idx],
+                        Cifthenelse(is_addr_array_hdr hdr, 
+                                    addr_array_set arr idx newval,
+                                    float_array_set arr idx
+                                                    (unbox_float newval)))
+            else
+              Cifthenelse(is_addr_array_hdr hdr,
+                Csequence(make_checkbound dbg [addr_array_length hdr; idx],
+                          addr_array_set arr idx newval),
+                Csequence(make_checkbound dbg [float_array_length hdr; idx],
+                          float_array_set arr idx
+                                          (unbox_float newval)))))))
       | Paddrarray ->
           bind "index" (transl arg2) (fun idx ->
             bind "arr" (transl arg1) (fun arr ->
-              Csequence(Cop(Ccheckbound dbg, [addr_array_length(header arr); idx]),
+              Csequence(make_checkbound dbg [addr_array_length(header arr); idx],
                         addr_array_set arr idx (transl arg3))))
       | Pintarray ->
           bind "index" (transl arg2) (fun idx ->
             bind "arr" (transl arg1) (fun arr ->
-              Csequence(Cop(Ccheckbound dbg, [addr_array_length(header arr); idx]),
+              Csequence(make_checkbound dbg [addr_array_length(header arr); idx],
                         int_array_set arr idx (transl arg3))))
       | Pfloatarray ->
           bind "index" (transl arg2) (fun idx ->
             bind "arr" (transl arg1) (fun arr ->
-              Csequence(Cop(Ccheckbound dbg, [float_array_length(header arr);idx]),
+              Csequence(make_checkbound dbg [float_array_length(header arr);idx],
                         float_array_set arr idx (transl_unbox_float arg3))))
       end)
   | _ ->

asmcomp/i386/emit.mlp

 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: emit.mlp 11156 2011-07-27 14:17:02Z doligez $ *)
+(* $Id: emit.mlp 11887 2011-12-18 10:00:56Z xleroy $ *)
 
 (* Emission of Intel 386 assembly code *)
 
 let emit_label lbl =
   emit_string label_prefix; emit_int lbl
 
+let emit_data_label lbl =
+  emit_string label_prefix; emit_string "d"; emit_int lbl
+
 
 (* Some data directives have different names under Solaris *)
 
   | Cdefine_symbol s ->
       `{emit_symbol s}:\n`
   | Cdefine_label lbl ->
-      `{emit_label (100000 + lbl)}:\n`
+      `{emit_data_label lbl}:\n`
   | Cint8 n ->
       `	.byte	{emit_int n}\n`
   | Cint16 n ->
   | Csymbol_address s ->
       `	.long	{emit_symbol s}\n`
   | Clabel_address lbl ->
-      `	.long	{emit_label (100000 + lbl)}\n`
+      `	.long	{emit_data_label lbl}\n`
   | Cstring s ->
       if use_ascii_dir
       then emit_string_directive "	.ascii	" s

asmcomp/i386/emit_nt.mlp

 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: emit_nt.mlp 11156 2011-07-27 14:17:02Z doligez $ *)
+(* $Id: emit_nt.mlp 11887 2011-12-18 10:00:56Z xleroy $ *)
 
 (* Emission of Intel 386 assembly code, MASM syntax. *)
 
 let emit_label lbl =
   emit_string "L"; emit_int lbl
 
+let emit_data_label lbl =
+  emit_string "Ld"; emit_int lbl
+
 (* Output an align directive. *)
 
 let emit_align n = `	ALIGN	{emit_int n}\n`
       add_def_symbol s ;
       `{emit_symbol s} LABEL DWORD\n`
   | Cdefine_label lbl ->
-      `{emit_label (100000 + lbl)}	LABEL DWORD\n`
+      `{emit_data_label lbl}	LABEL DWORD\n`
   | Cint8 n ->
       `	BYTE	{emit_int n}\n`
   | Cint16 n ->
       add_used_symbol s ;
       `	DWORD	{emit_symbol s}\n`
   | Clabel_address lbl ->
-      `	DWORD	{emit_label (100000 + lbl)}\n`
+      `	DWORD	{emit_data_label lbl}\n`
   | Cstring s ->
       emit_bytes_directive "	BYTE	" s
   | Cskip n ->

asmcomp/i386/proc.ml

 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: proc.ml 11156 2011-07-27 14:17:02Z doligez $ *)
+(* $Id: proc.ml 11319 2011-12-16 17:02:48Z xleroy $ *)
 
 (* Description of the Intel 386 processor *)
 
 open Reg
 open Mach
 
+(* Which asm conventions to use *)
+let masm =
+  match Config.ccomp_type with
+  | "msvc" -> true
+  | _      -> false
+
 (* Registers available for register allocation *)
 
 (* Register map:
     tos         100             top of floating-point stack. *)
 
 let int_reg_name =
-  [| "%eax"; "%ebx"; "%ecx"; "%edx"; "%esi"; "%edi"; "%ebp" |]
+  if masm then
+    [| "eax"; "ebx"; "ecx"; "edx"; "esi"; "edi"; "ebp" |]
+  else
+    [| "%eax"; "%ebx"; "%ecx"; "%edx"; "%esi"; "%edi"; "%ebp" |]
 
 let float_reg_name =
-  [| "%tos" |]
+  if masm then
+    [| "tos" |]
+  else
+    [| "%tos" |]
 
 let num_register_classes = 2
 
 (* Calling the assembler *)
 
 let assemble_file infile outfile =
-  Ccomp.command (Config.asm ^ " -o " ^
-                 Filename.quote outfile ^ " " ^ Filename.quote infile)
+  if masm then
+    Ccomp.command (Config.asm ^
+                   Filename.quote outfile ^ " " ^ Filename.quote infile ^
+                   (if !Clflags.verbose then "" else ">NUL"))
+  else
+    Ccomp.command (Config.asm ^ " -o " ^
+                   Filename.quote outfile ^ " " ^ Filename.quote infile)
 
 open Clflags;;
 open Config;;

asmcomp/power/emit.mlp

 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: emit.mlp 11156 2011-07-27 14:17:02Z doligez $ *)
+(* $Id: emit.mlp 11887 2011-12-18 10:00:56Z xleroy $ *)
 
 (* Emission of PowerPC assembly code *)
 
 let emit_label lbl =
   emit_string label_prefix; emit_int lbl
 
+let emit_data_label lbl =
+  emit_string label_prefix; emit_string "d"; emit_int lbl
+
 (* Section switching *)
 
 let data_space =
   | Cdefine_symbol s ->
       `{emit_symbol s}:\n`;
   | Cdefine_label lbl ->
-      `{emit_label (lbl + 100000)}:\n`
+      `{emit_data_label lbl}:\n`
   | Cint8 n ->
       `	.byte	{emit_int n}\n`
   | Cint16 n ->
   | Csymbol_address s ->
       `	{emit_string datag}	{emit_symbol s}\n`
   | Clabel_address lbl ->
-      `	{emit_string datag}	{emit_label (lbl + 100000)}\n`
+      `	{emit_string datag}	{emit_data_label lbl}\n`
   | Cstring s ->
       emit_bytes_directive "	.byte	" s
   | Cskip n ->

asmcomp/sparc/emit.mlp

 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: emit.mlp 11156 2011-07-27 14:17:02Z doligez $ *)
+(* $Id: emit.mlp 11887 2011-12-18 10:00:56Z xleroy $ *)
 
 (* Emission of Sparc assembly code *)
 
 let emit_label lbl =
   emit_string label_prefix; emit_int lbl
 
+let emit_data_label lbl =
+  emit_string label_prefix; emit_string "d"; emit_int lbl
+
 (* Output a pseudo-register *)
 
 let emit_reg r =
   | Cdefine_symbol s ->
       `{emit_symbol s}:\n`
   | Cdefine_label lbl ->
-      `{emit_label (lbl + 100000)}:\n`
+      `{emit_data_label lbl}:\n`
   | Cint8 n ->
       `	.byte	{emit_int n}\n`
   | Cint16 n ->
   | Csymbol_address s ->
       `	.word	{emit_symbol s}\n`
   | Clabel_address lbl ->
-      `	.word	{emit_label (lbl + 100000)}\n`
+      `	.word	{emit_data_label lbl}\n`
   | Cstring s ->
       emit_string_directive "	.ascii	" s
   | Cskip n ->

asmrun/Makefile.nt

 #                                                                       #
 #########################################################################
 
-# $Id: Makefile.nt 11156 2011-07-27 14:17:02Z doligez $
+# $Id: Makefile.nt 11927 2011-12-21 16:31:01Z xleroy $
 
 include ../config/Makefile
 
 i386.o: i386.S
 	$(CC) -c -DSYS_$(SYSTEM) i386.S
 
+amd64.o: amd64.S
+	$(CC) -c -DSYS_$(SYSTEM) amd64.S
+
 install:
 	cp libasmrun.$(A) $(LIBDIR)
 
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: amd64.S 11156 2011-07-27 14:17:02Z doligez $ */
+/* $Id: amd64.S 11931 2011-12-22 08:51:57Z xleroy $ */
 
 /* Asm part of the runtime system, AMD64 processor */
 /* Must be preprocessed by cpp */
 
 /* PIC mode support based on contribution by Paul Stravers (see PR#4795) */
 
-#ifdef SYS_macosx
+#if defined(SYS_macosx)
 
+#define LBL(x) L##x	
 #define G(r) _##r
 #define GREL(r) _##r@GOTPCREL
 #define GCALL(r) _##r
         .align FUNCTION_ALIGN; \
         name:
 
+#elif defined(SYS_mingw64)
+	
+#define LBL(x) .L##x	
+#define G(r) r
+#undef  GREL
+#define GCALL(r) r
+#define FUNCTION_ALIGN 4
+#define EIGHT_ALIGN 8
+#define SIXTEEN_ALIGN 16
+#define FUNCTION(name) \
+        .globl name; \
+        .align FUNCTION_ALIGN; \
+        name:
+
 #else
 
+#define LBL(x) .L##x	
 #define G(r) r
 #define GREL(r) r@GOTPCREL
 #define GCALL(r) r@PLT
 
 #endif
 
-#ifdef __PIC__
+#if defined(__PIC__) && !defined(SYS_mingw64)
 
 /* Position-independent operations on global variables. */
 
 
 #endif
 
+/* Save and restore all callee-save registers on stack.  
+   Keep the stack 16-aligned. */
+
+#if defined(SYS_mingw64)	
+
+/* Win64 API: callee-save regs are rbx, rbp, rsi, rdi, r12-r15, xmm6-xmm15 */
+
+#define PUSH_CALLEE_SAVE_REGS \
+        pushq   %rbx; \
+        pushq   %rbp; \
+        pushq   %rsi; \
+        pushq   %rdi; \
+        pushq   %r12; \
+        pushq   %r13; \
+        pushq   %r14; \
+        pushq   %r15; \
+	subq	$(8+10*16), %rsp; \
+	movupd  %xmm6, 0*16(%rsp); \
+        movupd  %xmm7, 1*16(%rsp); \
+        movupd  %xmm8, 2*16(%rsp); \
+        movupd  %xmm9, 3*16(%rsp); \
+        movupd  %xmm10, 4*16(%rsp); \
+        movupd  %xmm11, 5*16(%rsp); \
+        movupd  %xmm12, 6*16(%rsp); \
+        movupd  %xmm13, 7*16(%rsp); \
+        movupd  %xmm14, 8*16(%rsp); \
+        movupd  %xmm15, 9*16(%rsp)
+
+#define POP_CALLEE_SAVE_REGS \
+        movupd  0*16(%rsp), %xmm6; \
+        movupd  1*16(%rsp), %xmm7; \
+        movupd  2*16(%rsp), %xmm8; \
+        movupd  3*16(%rsp), %xmm9; \
+        movupd  4*16(%rsp), %xmm10; \
+        movupd  5*16(%rsp), %xmm11; \
+        movupd  6*16(%rsp), %xmm12; \
+        movupd  7*16(%rsp), %xmm13; \
+        movupd  8*16(%rsp), %xmm14; \
+        movupd  9*16(%rsp), %xmm15; \
+        addq    $(8+10*16), %rsp; \
+        popq    %r15; \
+        popq    %r14; \
+        popq    %r13; \
+        popq    %r12; \
+        popq    %rdi; \
+        popq    %rsi; \
+        popq    %rbp; \
+        popq    %rbx
+
+#else
+
+/* Unix API: callee-save regs are rbx, rbp, r12-r15 */
+
+#define PUSH_CALLEE_SAVE_REGS \
+        pushq   %rbx; \
+        pushq   %rbp; \
+        pushq   %r12; \
+        pushq   %r13; \
+        pushq   %r14; \
+        pushq   %r15; \
+	subq	$8, %rsp
+
+#define POP_CALLEE_SAVE_REGS \
+	addq	$8, %rsp; \
+        popq    %r15; \
+        popq    %r14; \
+        popq    %r13; \
+        popq    %r12; \
+        popq    %rbp; \
+        popq    %rbx
+
+#endif	
+
+#ifdef SYS_mingw64
+   /* Calls from Caml to C must reserve 32 bytes of extra stack space */
+#  define PREPARE_FOR_C_CALL subq $32, %rsp	
+#  define CLEANUP_AFTER_C_CALL addq $32, %rsp
+#else
+#  define PREPARE_FOR_C_CALL
+#  define CLEANUP_AFTER_C_CALL
+#endif
+
         .text
 
 /* Allocation */
 
 FUNCTION(G(caml_call_gc))
         RECORD_STACK_FRAME(0)
-.Lcaml_call_gc:
+LBL(caml_call_gc):
     /* Build array of registers, save it into caml_gc_regs */
         pushq   %r13
         pushq   %r12
         movsd   %xmm14, 14*8(%rsp)
         movsd   %xmm15, 15*8(%rsp)
     /* Call the garbage collector */
+	PREPARE_FOR_C_CALL
         call    GCALL(caml_garbage_collection)
+	CLEANUP_AFTER_C_CALL
     /* Restore caml_young_ptr, caml_exception_pointer */
 	LOAD_VAR(caml_young_ptr, %r15)
 	LOAD_VAR(caml_exception_pointer, %r14)
         ret
 
 FUNCTION(G(caml_alloc1))
-.Lcaml_alloc1:
+LBL(caml_alloc1):
         subq    $16, %r15
         CMP_VAR(caml_young_limit, %r15)
-        jb      .L100
+        jb      LBL(100)
         ret
-.L100:
+LBL(100):
         RECORD_STACK_FRAME(0)
 	subq	$8, %rsp
-        call    .Lcaml_call_gc
+        call    LBL(caml_call_gc)
 	addq	$8, %rsp
-        jmp     .Lcaml_alloc1
+        jmp     LBL(caml_alloc1)
 
 FUNCTION(G(caml_alloc2))
-.Lcaml_alloc2:
+LBL(caml_alloc2):
         subq    $24, %r15
         CMP_VAR(caml_young_limit, %r15)
-        jb      .L101
+        jb      LBL(101)
         ret
-.L101:
+LBL(101):
         RECORD_STACK_FRAME(0)
 	subq	$8, %rsp
-        call    .Lcaml_call_gc
+        call    LBL(caml_call_gc)
 	addq	$8, %rsp
-        jmp     .Lcaml_alloc2
+        jmp     LBL(caml_alloc2)
 
 FUNCTION(G(caml_alloc3))
-.Lcaml_alloc3:
+LBL(caml_alloc3):
         subq    $32, %r15
         CMP_VAR(caml_young_limit, %r15)
-        jb      .L102
+        jb      LBL(102)
         ret
-.L102:
+LBL(102):
         RECORD_STACK_FRAME(0)
 	subq	$8, %rsp
-        call    .Lcaml_call_gc
+        call    LBL(caml_call_gc)
 	addq	$8, %rsp
-        jmp     .Lcaml_alloc3
+        jmp     LBL(caml_alloc3)
 
 FUNCTION(G(caml_allocN))
-.Lcaml_allocN:
+LBL(caml_allocN):
         pushq   %rax                       /* save desired size */
         subq    %rax, %r15
         CMP_VAR(caml_young_limit, %r15)
-        jb      .L103
+        jb      LBL(103)
         addq    $8, %rsp                  /* drop desired size */
         ret
-.L103:
+LBL(103):
         RECORD_STACK_FRAME(8)
-        call    .Lcaml_call_gc
+        call    LBL(caml_call_gc)
         popq    %rax                      /* recover desired size */
-        jmp     .Lcaml_allocN
+        jmp     LBL(caml_allocN)
 
 /* Call a C function from Caml */
 
 FUNCTION(G(caml_c_call))
-.Lcaml_c_call:
+LBL(caml_c_call):
     /* Record lowest stack address and return address */
         popq    %r12
         STORE_VAR(%r12, caml_last_return_address)
 	STORE_VAR(%r15, caml_young_ptr)
 	STORE_VAR(%r14, caml_exception_pointer)
     /* Call the function (address in %rax) */
+    /* No need to PREPARE_FOR_C_CALL since the caller already
+       reserved the stack space if needed (cf. amd64/proc.ml) */
         call    *%rax
     /* Reload alloc ptr */
 	LOAD_VAR(caml_young_ptr, %r15)
 
 FUNCTION(G(caml_start_program))
     /* Save callee-save registers */
-        pushq   %rbx
-        pushq   %rbp
-        pushq   %r12
-        pushq   %r13
-        pushq   %r14
-        pushq   %r15
-	subq	$8, %rsp	/* stack 16-aligned */
+        PUSH_CALLEE_SAVE_REGS
     /* Initial entry point is G(caml_program) */
         leaq    GCALL(caml_program)(%rip), %r12
     /* Common code for caml_start_program and caml_callback* */
-.Lcaml_start_program:
+LBL(caml_start_program):
     /* Build a callback link */
 	subq	$8, %rsp	/* stack 16-aligned */
         PUSH_VAR(caml_gc_regs)
 	LOAD_VAR(caml_young_ptr, %r15)
 	LOAD_VAR(caml_exception_pointer, %r14)
     /* Build an exception handler */
-        lea     .L108(%rip), %r13
+        lea     LBL(108)(%rip), %r13
         pushq   %r13
         pushq   %r14
         movq    %rsp, %r14
     /* Call the Caml code */
         call    *%r12
-.L107:
+LBL(107):
     /* Pop the exception handler */
         popq    %r14
         popq    %r12    /* dummy register */
-.L109:
+LBL(109):
     /* Update alloc ptr and exception ptr */
 	STORE_VAR(%r15,caml_young_ptr)
 	STORE_VAR(%r14,caml_exception_pointer)
         POP_VAR(caml_gc_regs)
 	addq	$8, %rsp
     /* Restore callee-save registers. */
-	addq	$8, %rsp
-        popq    %r15
-        popq    %r14
-        popq    %r13
-        popq    %r12
-        popq    %rbp
-        popq    %rbx
+        POP_CALLEE_SAVE_REGS
     /* Return to caller. */
         ret
-.L108:
+LBL(108):
     /* Exception handler*/
     /* Mark the bucket as an exception result and return it */
         orq     $2, %rax
-        jmp     .L109
+        jmp     LBL(109)
+
+/* Registers holding arguments of C functions. */
+
+#ifdef SYS_mingw64
+#define C_ARG_1 %rcx
+#define C_ARG_2 %rdx
+#define C_ARG_3 %r8
+#define C_ARG_4 %r9
+#else
+#define C_ARG_1 %rdi
+#define C_ARG_2 %rsi
+#define C_ARG_3 %rdx
+#define C_ARG_4 %rcx
+#endif
 
 /* Raise an exception from Caml */
 
 FUNCTION(G(caml_raise_exn))
         TESTL_VAR($1, caml_backtrace_active)
-        jne     .L110
+        jne     LBL(110)
         movq    %r14, %rsp
         popq    %r14
         ret
-.L110:
+LBL(110):
         movq    %rax, %r12            /* Save exception bucket */
-        movq    %rax, %rdi            /* arg 1: exception bucket */
-        movq    0(%rsp), %rsi         /* arg 2: pc of raise */
-        leaq    8(%rsp), %rdx         /* arg 3: sp of raise */
-        movq    %r14, %rcx            /* arg 4: sp of handler */
+        movq    %rax, C_ARG_1         /* arg 1: exception bucket */
+        movq    0(%rsp), C_ARG_2      /* arg 2: pc of raise */
+        leaq    8(%rsp), C_ARG_3      /* arg 3: sp of raise */
+        movq    %r14, C_ARG_4         /* arg 4: sp of handler */
+	PREPARE_FOR_C_CALL            /* no need to cleanup after */
         call    GCALL(caml_stash_backtrace)
         movq    %r12, %rax            /* Recover exception bucket */
         movq    %r14, %rsp
 
 FUNCTION(G(caml_raise_exception))
         TESTL_VAR($1, caml_backtrace_active)
-        jne     .L111
-        movq    %rdi, %rax
+        jne     LBL(111)
+        movq    C_ARG_1, %rax
         LOAD_VAR(caml_exception_pointer, %rsp)  /* Cut stack */
         popq    %r14                  /* Recover previous exception handler */
         LOAD_VAR(caml_young_ptr, %r15) /* Reload alloc ptr */
         ret
-.L111:
-        movq    %rdi, %r12            /* Save exception bucket */
+LBL(111):
+        movq    C_ARG_1, %r12            /* Save exception bucket */
                                       /* arg 1: exception bucket */
-	LOAD_VAR(caml_last_return_address,%rsi)   /* arg 2: pc of raise */
-        LOAD_VAR(caml_bottom_of_stack,%rdx)       /* arg 3: sp of raise */
-        LOAD_VAR(caml_exception_pointer,%rcx)     /* arg 4: sp of handler */
+	LOAD_VAR(caml_last_return_address,C_ARG_2)   /* arg 2: pc of raise */
+        LOAD_VAR(caml_bottom_of_stack,C_ARG_3)       /* arg 3: sp of raise */
+        LOAD_VAR(caml_exception_pointer,C_ARG_4)     /* arg 4: sp of handler */
+	PREPARE_FOR_C_CALL            /* no need to cleanup after */
         call    GCALL(caml_stash_backtrace)
         movq    %r12, %rax            /* Recover exception bucket */
 	LOAD_VAR(caml_exception_pointer,%rsp)
 
 FUNCTION(G(caml_callback_exn))
     /* Save callee-save registers */
-        pushq   %rbx
-        pushq   %rbp
-        pushq   %r12
-        pushq   %r13
-        pushq   %r14
-        pushq   %r15
-	subq	$8, %rsp	/* stack 16-aligned */
+        PUSH_CALLEE_SAVE_REGS
     /* Initial loading of arguments */
-        movq    %rdi, %rbx      /* closure */
-        movq    %rsi, %rax      /* argument */
-        movq    0(%rbx), %r12   /* code pointer */
-        jmp     .Lcaml_start_program
+        movq    C_ARG_1, %rbx      /* closure */
+        movq    C_ARG_2, %rax      /* argument */
+        movq    0(%rbx), %r12      /* code pointer */
+        jmp     LBL(caml_start_program)
 
 FUNCTION(G(caml_callback2_exn))
     /* Save callee-save registers */
-        pushq   %rbx
-        pushq   %rbp
-        pushq   %r12
-        pushq   %r13
-        pushq   %r14
-        pushq   %r15
-	subq	$8, %rsp	/* stack 16-aligned */
+        PUSH_CALLEE_SAVE_REGS
     /* Initial loading of arguments */
-        /* closure stays in %rdi */
-        movq    %rsi, %rax               /* first argument */
-        movq    %rdx, %rbx               /* second argument */
+        movq    C_ARG_1, %rdi      /* closure -- no op with Unix conventions */
+        movq    C_ARG_2, %rax      /* first argument */
+        movq    C_ARG_3, %rbx      /* second argument */
         leaq    GCALL(caml_apply2)(%rip), %r12  /* code pointer */
-        jmp     .Lcaml_start_program
+        jmp     LBL(caml_start_program)
 
 FUNCTION(G(caml_callback3_exn))
     /* Save callee-save registers */
-        pushq   %rbx
-        pushq   %rbp
-        pushq   %r12
-        pushq   %r13
-        pushq   %r14
-        pushq   %r15
-	subq	$8, %rsp	/* stack 16-aligned */
+        PUSH_CALLEE_SAVE_REGS
     /* Initial loading of arguments */
-        movq    %rsi, %rax               /* first argument */
-        movq    %rdx, %rbx               /* second argument */
-        movq    %rdi, %rsi               /* closure */
-        movq    %rcx, %rdi               /* third argument */
+        movq    C_ARG_2, %rax      /* first argument */
+        movq    C_ARG_3, %rbx      /* second argument */
+        movq    C_ARG_1, %rsi      /* closure */
+        movq    C_ARG_4, %rdi      /* third argument */
         leaq    GCALL(caml_apply3)(%rip), %r12  /* code pointer */
-        jmp     .Lcaml_start_program
+        jmp     LBL(caml_start_program)
 
 FUNCTION(G(caml_ml_array_bound_error))
         leaq    GCALL(caml_array_bound_error)(%rip), %rax
-        jmp     .Lcaml_c_call
+        jmp     LBL(caml_c_call)
 
         .data
         .globl  G(caml_system__frametable)
         .align  EIGHT_ALIGN
 G(caml_system__frametable):
         .quad   1           /* one descriptor */
-        .quad   .L107       /* return address into callback */
+        .quad   LBL(107)    /* return address into callback */
         .value  -1          /* negative frame size => use callback link */
         .value  0           /* no roots here */
         .align  EIGHT_ALIGN
 
-#ifdef SYS_macosx
+#if defined(SYS_macosx)
 	.literal16
+#elif defined(SYS_mingw64)
+	.section .rdata,"dr"
 #else
 	.section    .rodata.cst8,"a",@progbits
 #endif
 /*                                                                     */
 /***********************************************************************/
 
-/* $Id: arm.S 11156 2011-07-27 14:17:02Z doligez $ */
+/* $Id: arm.S 11203 2011-09-18 08:09:34Z xleroy $ */
 
 /* Asm part of the runtime system, ARM processor */
 
 /* Allocation functions and GC interface */
 
         .globl caml_call_gc
+        .type caml_call_gc, %function
 caml_call_gc:
     /* Record return address and desired size */
     /* Can use alloc_limit as a temporary since it will be reloaded by
         bx      lr
 
         .globl caml_alloc1
+        .type caml_alloc1, %function
 caml_alloc1:
         sub     alloc_ptr, alloc_ptr, #8
         cmp     alloc_ptr, alloc_limit
         b       caml_alloc1
 
         .globl caml_alloc2
+        .type caml_alloc2, %function