Commits

camlspotter committed 614533b Merge

merge with 4.00.1

Comments (0)

Files changed (444)

     typing/ident.cmi typing/env.cmi parsing/asttypes.cmi
 typing/datarepr.cmi : typing/types.cmi typing/path.cmi typing/ident.cmi \
     parsing/asttypes.cmi
-typing/env.cmi : utils/warnings.cmi typing/types.cmi typing/path.cmi \
-    parsing/longident.cmi parsing/location.cmi typing/ident.cmi \
-    utils/consistbl.cmi typing/annot.cmi
+typing/env.cmi : utils/warnings.cmi typing/types.cmi typing/subst.cmi \
+    typing/path.cmi parsing/longident.cmi parsing/location.cmi \
+    typing/ident.cmi utils/consistbl.cmi typing/annot.cmi
 typing/ident.cmi :
 typing/includeclass.cmi : typing/types.cmi typing/env.cmi typing/ctype.cmi
 typing/includecore.cmi : typing/types.cmi typing/typedtree.cmi \
     utils/config.cmx typing/cmi_format.cmi
 typing/cmt_format.cmo : typing/types.cmi typing/typedtree.cmi utils/misc.cmi \
     parsing/location.cmi parsing/lexer.cmi typing/env.cmi utils/config.cmi \
-    typing/cmi_format.cmi utils/clflags.cmi typing/cmt_format.cmi
+    typing/cmi_format.cmi utils/clflags.cmi parsing/asttypes.cmi \
+    typing/cmt_format.cmi
 typing/cmt_format.cmx : typing/types.cmx typing/typedtree.cmx utils/misc.cmx \
     parsing/location.cmx parsing/lexer.cmx typing/env.cmx utils/config.cmx \
-    typing/cmi_format.cmx utils/clflags.cmx typing/cmt_format.cmi
+    typing/cmi_format.cmx utils/clflags.cmx parsing/asttypes.cmi \
+    typing/cmt_format.cmi
 typing/ctype.cmo : typing/types.cmi typing/subst.cmi typing/path.cmi \
     utils/misc.cmi parsing/longident.cmi parsing/location.cmi \
     typing/ident.cmi typing/env.cmi utils/clflags.cmi typing/btype.cmi \
 asmcomp/selection.cmi : asmcomp/mach.cmi asmcomp/cmm.cmi
 asmcomp/spill.cmi : asmcomp/mach.cmi
 asmcomp/split.cmi : asmcomp/mach.cmi
-asmcomp/arch.cmo : utils/misc.cmi utils/config.cmi
-asmcomp/arch.cmx : utils/misc.cmx utils/config.cmx
+asmcomp/arch.cmo :
+asmcomp/arch.cmx :
 asmcomp/asmgen.cmo : bytecomp/translmod.cmi asmcomp/split.cmi \
     asmcomp/spill.cmi asmcomp/selection.cmi asmcomp/scheduling.cmi \
     asmcomp/reload.cmi asmcomp/reg.cmi asmcomp/proc.cmi asmcomp/printmach.cmi \
 asmcomp/debuginfo.cmx : parsing/location.cmx bytecomp/lambda.cmx \
     asmcomp/debuginfo.cmi
 asmcomp/emit.cmo : asmcomp/reg.cmi asmcomp/proc.cmi utils/misc.cmi \
-    asmcomp/mach.cmi parsing/location.cmi asmcomp/linearize.cmi \
-    asmcomp/emitaux.cmi asmcomp/debuginfo.cmi utils/config.cmi \
-    asmcomp/compilenv.cmi asmcomp/cmm.cmi utils/clflags.cmi asmcomp/arch.cmo \
-    asmcomp/emit.cmi
+    asmcomp/mach.cmi asmcomp/linearize.cmi asmcomp/emitaux.cmi \
+    asmcomp/debuginfo.cmi utils/config.cmi asmcomp/compilenv.cmi \
+    asmcomp/cmm.cmi utils/clflags.cmi asmcomp/arch.cmo asmcomp/emit.cmi
 asmcomp/emit.cmx : asmcomp/reg.cmx asmcomp/proc.cmx utils/misc.cmx \
-    asmcomp/mach.cmx parsing/location.cmx asmcomp/linearize.cmx \
-    asmcomp/emitaux.cmx asmcomp/debuginfo.cmx utils/config.cmx \
-    asmcomp/compilenv.cmx asmcomp/cmm.cmx utils/clflags.cmx asmcomp/arch.cmx \
-    asmcomp/emit.cmi
+    asmcomp/mach.cmx asmcomp/linearize.cmx asmcomp/emitaux.cmx \
+    asmcomp/debuginfo.cmx utils/config.cmx asmcomp/compilenv.cmx \
+    asmcomp/cmm.cmx utils/clflags.cmx asmcomp/arch.cmx asmcomp/emit.cmi
 asmcomp/emitaux.cmo : asmcomp/reg.cmi asmcomp/linearize.cmi \
     asmcomp/debuginfo.cmi utils/config.cmi asmcomp/cmm.cmi utils/clflags.cmi \
     asmcomp/arch.cmo asmcomp/emitaux.cmi
 asmcomp/reg.cmo : asmcomp/cmm.cmi asmcomp/reg.cmi
 asmcomp/reg.cmx : asmcomp/cmm.cmx asmcomp/reg.cmi
 asmcomp/reload.cmo : asmcomp/reloadgen.cmi asmcomp/reg.cmi asmcomp/mach.cmi \
-    asmcomp/cmm.cmi asmcomp/arch.cmo asmcomp/reload.cmi
+    asmcomp/cmm.cmi utils/clflags.cmi asmcomp/arch.cmo asmcomp/reload.cmi
 asmcomp/reload.cmx : asmcomp/reloadgen.cmx asmcomp/reg.cmx asmcomp/mach.cmx \
-    asmcomp/cmm.cmx asmcomp/arch.cmx asmcomp/reload.cmi
+    asmcomp/cmm.cmx utils/clflags.cmx asmcomp/arch.cmx asmcomp/reload.cmi
 asmcomp/reloadgen.cmo : asmcomp/reg.cmi utils/misc.cmi asmcomp/mach.cmi \
     asmcomp/reloadgen.cmi
 asmcomp/reloadgen.cmx : asmcomp/reg.cmx utils/misc.cmx asmcomp/mach.cmx \
     asmcomp/selectgen.cmi
 asmcomp/selection.cmo : asmcomp/selectgen.cmi asmcomp/reg.cmi \
     asmcomp/proc.cmi utils/misc.cmi asmcomp/mach.cmi asmcomp/cmm.cmi \
-    asmcomp/arch.cmo asmcomp/selection.cmi
+    utils/clflags.cmi asmcomp/arch.cmo asmcomp/selection.cmi
 asmcomp/selection.cmx : asmcomp/selectgen.cmx asmcomp/reg.cmx \
     asmcomp/proc.cmx utils/misc.cmx asmcomp/mach.cmx asmcomp/cmm.cmx \
-    asmcomp/arch.cmx asmcomp/selection.cmi
+    utils/clflags.cmx asmcomp/arch.cmx asmcomp/selection.cmi
 asmcomp/spill.cmo : asmcomp/reg.cmi asmcomp/proc.cmi utils/misc.cmi \
     asmcomp/mach.cmi asmcomp/spill.cmi
 asmcomp/spill.cmx : asmcomp/reg.cmx asmcomp/proc.cmx utils/misc.cmx \
 utils/config\.ml$
 yacc/ocamlyacc$
 yacc/version\.h$
+
+ocamlbuild-mixed-boot$
+otherlibs/labltk/browser/help\.ml$
+stdlib/camlheaderd$
+tools/ocamloptp$
+tools/read_cmt$
 34e8d4a2bd36612fbe437d550b0d119dc9f6bd1e ocaml-4.01.0+dev2-12410
+bb92dae96c700ef003251b4068aa6fc93680682f ocaml-4.00.0+beta2-12583
+98c0f8b63a312173400f43a020a2b673dddd4499 ocaml-4.00.0+beta2-12699
+73079ded8dc97ba343854cf488f2264bc43e2990 ocaml-4.00.0-rc1-12755
+731b4b8013012de8e34bb9f0de16a0f510d05001 ocaml-4.00.0-12779
+a1487e7d929b5aa7086f476d6d1d31edbd55a9ce ocaml-4.00.1-12983

0scripts/0CHECKOUT-SVN

 
 set -e
 
-# rev 12583
-VERSION=4.00.0+beta2
+REV=12983
+DIR=release
+VERSION=4.00.1
 
 # Move to the ocaml-svn-copy head
-hg update -C ocaml-svn-copy
+# hg update -C ocaml-svn-copy
 /bin/rm -rf [A-z]* \#*
 
-# svn co http://caml.inria.fr/svn/ocaml/release/$VERSION/
-tar zxvf ../ocaml-$VERSION.tgz
+svn co http://caml.inria.fr/svn/ocaml/$DIR/$VERSION/
+
+# tar zxvf ../ocaml-$VERSION.tgz
 (cd $VERSION; tar cf - .) | tar xf -
 /bin/rm -rf $VERSION
 
 hg rm `hg status | grep '^!' | awk '{ print $2 }'`
 hg add [A-z]*
 echo OCaml $VERSION svn source is copied. Now ready to commit.
+
+echo hg commit -m ocaml-$(VERSION)-$(REV)
+echo hg tag ocaml-$(VERSION)-$(REV)

0scripts/0CHECKOUT-SVN-specific

+#!/bin/sh
+# rev 11110
+VERSION=4.00
+hg update -C ocaml-svn-copy
+/bin/rm -rf [A-z]* \#*
+svn co http://caml.inria.fr/svn/ocaml/version/$VERSION/
+(cd $VERSION; tar cf - .) | tar xvf -
+/bin/rm -rf $VERSION
+hg rm `hg status | grep '^!' | awk '{ print $2 }'`
+hg add [A-z]*
+echo OCaml $VERSION svn source is copied. Now ready to commit.
+OCaml 4.00.1:
+-------------
+
+Bug fixes:
+- PR#4019: better documentation of Str.matched_string
+- PR#5111: ocamldoc, heading tags inside spans tags is illegal in html
+- PR#5278: better error message when typing "make"
+- PR#5468: ocamlbuild should preserve order of parametric tags
+- PR#5563: harden Unix.select against file descriptors above FD_SETSIZE
+- PR#5690: "ocamldoc ... -text README" raises exception
+- PR#5700: crash with native-code stack backtraces under MacOS 10.8 x86-64
+- PR#5707: AMD64 code generator: do not use r10 and r11 for parameter passing,
+  as these registers can be destroyed by the dynamic loader
+- PR#5712: some documentation problems
+- PR#5715: configuring with -no-shared-libs breaks under cygwin
+- PR#5718: false positive on 'unused constructor' warning
+- PR#5719: ocamlyacc generates code that is not warning 33-compliant
+- PR#5725: ocamldoc output of preformatted code
+- PR#5727: emacs caml-mode indents shebang line in toplevel scripts
+- PR#5729: tools/untypeast.ml creates unary Pexp_tuple
+- PR#5731: instruction scheduling forgot to account for destroyed registers
+- PR#5735: %apply and %revapply not first class citizens
+- PR#5738: first class module patterns not handled by ocamldep
+- PR#5742: missing bound checks in Array.sub
+- PR#5744: ocamldoc error on "val virtual"
+- PR#5757: GC compaction bug (crash)
+- PR#5758: Compiler bug when matching on floats
+- PR#5761: Incorrect bigarray custom block size
+
+
 OCaml 4.00.0:
 -------------
 
 - The official name of the language is now OCaml.
 
 Language features:
-- Added Generalized Abstract Data Types (GADTs) to the language.
+- Added Generalized Algebraic Data Types (GADTs) to the language.
   See chapter "Language extensions" of the reference manual for documentation.
 - 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.
       savings of 28%.
     . Added support for position-independent code, natdynlink, profiling and
       exception backtraces.
-- In -g mode, generation of CFI information and a few filename/line
-  number debugging annotations, enabling in particular precise stack
-  backtraces with the gdb debugger. Currently supported for x86 32-bits
-  and 64-bits only. (PR#5487)
+- Generation of CFI information, and filename/line number debugging (with -g)
+  annotations, enabling in particular precise stack backtraces with
+  the gdb debugger. Currently supported for x86 32-bits and 64-bits only.
+  (PR#5487)
 - New tool: ocamloptp, the equivalent of ocamlcp for the native-code compiler.
 
 OCamldoc:
+- PR#5645: ocamldoc doesn't handle module/type substitution in signatures
 - PR#5544: improve HTML output (less formatting in html code)
 - PR#5522: allow refering to record fields and variant constructors
 - fix PR#5419 (error message in french)
     . Fixed behavior of generic hash function w.r.t. -0.0 and NaN (PR#5222)
     . Added optional "random" parameter to Hashtbl.create to randomize
       collision patterns and improve security (PR#5572, CVE-2012-0839)
-    . Added "randomize" function and "R" parameter to OCAMLRUNPARAMS
+    . Added "randomize" function and "R" parameter to OCAMLRUNPARAM
       to turn randomization on by default (PR#5572, CVE-2012-0839)
     . Added new functorial interface "MakeSeeded" to support randomization
       with user-provided seeded hash functions.
 - Random:
      . More random initialization (Random.self_init()), using /dev/urandom
        when available (e.g. Linux, FreeBSD, MacOS X, Solaris)
-     . Faster implementation of Random.float
+     * Faster implementation of Random.float (changes the generated sequences)
 - Scanf: new function "unescaped" (PR#3888)
 - Set and Map: more efficient implementation of "filter" and "partition"
 - String: new function "map" (PR#3888)
 - PR#3571: in Bigarrays, call msync() before unmapping to commit changes
 - PR#4292: various documentation problems
 - PR#4511, PR#4838: local modules remove polymorphism
-- PR#4549: Filename.dirname is not handling multiple / on Unix
+* PR#4549: Filename.dirname is not handling multiple / on Unix
 - PR#4688: (Windows) special floating-point values aren't converted to strings
   correctly
 - PR#4697: Unix.putenv leaks memory on failure
 - PR#4892: Array.set could raise "out of bounds" before evaluating 3rd arg
 - PR#4937: camlp4 incorrectly handles optional arguments if 'option' is
   redefined
-- PR#5024: camlp4r now handles underscores in irrefutable patern matching of
-           records
+- PR#5024: camlp4r now handles underscores in irrefutable pattern matching of
+  records
 - PR#5064, PR#5485: try to ensure that 4K words of stack are available
   before calling into C functions, raising a Stack_overflow exception
   otherwise.  This reduces (but does not eliminate) the risk of
   segmentation faults due to stack overflow in C code
+- PR#5073: wrong location for 'Unbound record field label' error
 - PR#5084: sub-sub-module building fails for native code compilation
 - PR#5120: fix the output function of Camlp4.Debug.formatter
+- PR#5131: compilation of custom runtime with g++ generates lots of warnings
+- PR#5137: caml-types-explore does not work
 - PR#5159: better documentation of type Lexing.position
 - PR#5171: Map.join does more comparisons than needed
 - PR#5176: emacs mode: stack overflow in regexp matcher
 - PR#5179: port OCaml to mingw-w64
 - PR#5211: updated Genlex documentation to state that camlp4 is mandatory for
   'parser' keyword and associated notation
+- PR#5214: ocamlfind plugin invokes 'cut' utility
+- PR#5218: use $(MAKE) instead of "make" in Makefiles
 - PR#5224: confusing error message in non-regular type definition
 - PR#5231: camlp4: fix parsing of <:str_item< type t = $x$ >>
+- PR#5233: finaliser on weak array gives dangling pointers (crash)
 - PR#5238, PR#5277: Sys_error when getting error location
 - PR#5261, PR#5497: Ocaml source-code examples are not "copy-paste-able"
+* PR#5279: executable name is not initialized properly in caml_startup_code
 - PR#5290: added hash functions for channels, nats, mutexes, conditions
+- PR#5291: undetected loop in class initialization
 - PR#5295: OS threads: problem with caml_c_thread_unregister()
 - PR#5301: camlp4r and exception equal to another one with parameters
 - PR#5305: prevent ocamlbuild from complaining about links to _build/
 - PR#5309: Queue.add is not thread/signal safe
 - PR#5310: Ratio.create_ratio/create_normalized_ratio have misleading names
 - PR#5311: better message for warning 23
+* PR#5312: command-line arguments @reponsefile auto-expansion feature
+  removed from the Windows OCaml runtime, to avoid conflicts with "-w @..."
 - PR#5313: ocamlopt -g misses optimizations
 - PR#5316: objinfo now shows ccopts/ccobjs/force_link when applicable
 - PR#5318: segfault on stack overflow when reading marshaled data
 - PR#5518: segfault with lazy empty array
 - PR#5531: Allow ocamlbuild to add ocamldoc flags through -docflag
   and -docflags switches
+- PR#5538: combining -i and -annot in ocamlc
 - PR#5543: in Bigarray.map_file, try to avoid using lseek() when growing file
-- PR#5538: combining -i and -annot in ocamlc
+- PR#5648: (probably fixed) test failures in tests/lib-threads
 - PR#5551: repeated calls to find_in_path degrade performance
 - PR#5552: Mac OS X: unrecognized gcc option "-no-cpp-precomp"
 - PR#5555: add Hashtbl.reset to resize the bucket table to its initial size
 - PR#5585: typo: "explicitely"
 - PR#5587: documentation: "allows to" is not correct English
 - PR#5593: remove C file when -output-obj fails
+- PR#5597: register names for instrtrace primitives in embedded bytecode
 - PR#5598: add backslash-space support in strings in ocamllex
 - PR#5603: wrong .file debug info generated by ocamlopt -g
 - PR#5604: fix permissions of files created by ocamlbuild itself
 - PR#5616: move ocamlbuild documentation to the reference manual
 - PR#5619: Uncaught CType.Unify exception in the compiler
 - PR#5620: invalid printing of type manifest (camlp4 revised syntax)
+- PR#5637: invalid printing of anonymous type parameters (camlp4 revised syntax)
+- PR#5643: issues with .cfi and .loc directives generated by ocamlopt -g
+- PR#5644: Stream.count broken when used with Sapp or Slazy nodes
+- PR#5647: Cannot use install_printer in debugger
+- PR#5651: printer for abstract data type (camlp4 revised syntax)
+- PR#5654: self pattern variable location tweak
+- PR#5655: ocamlbuild doesn't pass cflags when building C stubs
+- PR#5657: wrong error location for abbreviated record fields
+- PR#5659: ocamlmklib -L option breaks with MSVC
+- PR#5661: fixes for the test suite
+- PR#5668: Camlp4 produces invalid syntax for "let _ = ..."
+- PR#5671: initialization of compare_ext field in caml_final_custom_operations()
+- PR#5677: do not use "value" as identifier (genprintval.ml)
+- PR#5687: dynlink broken when used from "output-obj" main program (bytecode)
 - problem with printing of string literals in camlp4 (reported on caml-list)
 - emacs mode: colorization of comments and strings now works correctly
 - problem with forall and method (reported on caml-list on 2011-07-26)
+- crash when using OCAMLRUNPARAM=a=X with invalid X (reported in private)
 
 Feature wishes:
 - PR#352: new option "-stdin" to make ocaml read stdin as a script
 - PR#5215: marshalling of dynlinked closure
 - PR#5236: new '%revapply' primitive with the semantics 'revapply x f = f x',
     and '%apply' with semantics 'apply f x = f x'.
+- PR#5255: natdynlink detection on powerpc, hurd, sparc
 - PR#5295: OS threads: problem with caml_c_thread_unregister()
 - PR#5297: compiler now checks existence of builtin primitives
 - PR#5329: (Windows) more efficient Unix.select if all fd's are sockets
+- PR#5357: warning for useless open statements
 - PR#5358: first class modules don't allow "with type" declarations for types
   in sub-modules
 - PR#5385: configure: emit a warning when MACOSX_DEPLOYMENT_TARGET is set
 - PR#5420: Unix.openfile share mode (Windows)
 - PR#5421: Unix: do not leak fds in various open_proc* functions
 - PR#5434: implement Unix.times in win32unix (partially)
-- PR#5437: warning for useless open statements
 - PR#5438: new warnings for unused declarations
 - PR#5439: upgrade config.guess and config.sub
 - PR#5445 and others: better printing of types with user-provided names
 - PR#5555: add function Hashtbl.reset to resize the bucket table to
   its initial size.
 - PR#5586: increase UNIX_BUFFER_SIZE to 64KiB
+- PR#5597: register names for instrtrace primitives in embedded bytecode
 - PR#5599: Add warn() tag in ocamlbuild to control -w compiler switch
+- PR#5628: add #remove_directory and Topdirs.remove_directory to remove
+  a directory from the load path
+- PR#5636: in system threads library, issue with linking of pthread_atfork
+- PR#5666: C includes don't provide a revision number
 - ocamldebug: ability to inspect values that contain code pointers
 - ocamldebug: new 'environment' directive to set environment variables
   for debuggee
   For Sun Solaris with the "acc" compiler:
     ./configure -cc "acc -fast" -libs "-lucb"
 
+  For Sun Solaris on Sparc 64bit, to compile natively (32bit only)
+    ./configure -cc "gcc -m32" -as "as -32" -aspp "gcc -m32 -c"
+
   For AIX 4.3 with the IBM compiler xlc:
     ./configure -cc "xlc_r -D_AIX43 -Wl,-bexpall,-brtl -qmaxmem=8192"
 
 #                                                                       #
 #########################################################################
 
-# $Id: Makefile 12511 2012-05-30 13:29:48Z lefessan $
+# $Id: Makefile 12929 2012-09-17 16:23:06Z doligez $
 
 # The main Makefile
 
 	@echo "Please refer to the installation instructions in file INSTALL."
 	@echo "If you've just unpacked the distribution, something like"
 	@echo "	./configure"
-	@echo "	make world"
-	@echo "	make opt"
+	@echo "	make world.opt"
 	@echo "	make install"
 	@echo "should work.  But see the file INSTALL for more details."
 
 world.opt:
 	$(MAKE) coldstart
 	$(MAKE) opt.opt
-	$(MAKE) ocamltoolsopt
 
 # Hard bootstrap how-to:
 # (only necessary in some cases, for example if you remove some primitive)
 # Native-code versions of the tools
 opt.opt: checkstack runtime core ocaml opt-core ocamlc.opt otherlibraries \
 	 $(DEBUGGER) ocamldoc ocamlbuild.byte $(CAMLP4OUT) \
-	 ocamlopt.opt otherlibrariesopt ocamllex.opt ocamltoolsopt.opt \
-	 ocamldoc.opt ocamlbuild.native $(CAMLP4OPT)
+	 ocamlopt.opt otherlibrariesopt ocamllex.opt \
+	 ocamltoolsopt ocamltoolsopt.opt ocamldoc.opt ocamlbuild.native \
+	 $(CAMLP4OPT)
 
 base.opt: checkstack runtime core ocaml opt-core ocamlc.opt otherlibraries \
 	 ocamlbuild.byte $(CAMLP4OUT) $(DEBUGGER) ocamldoc ocamlopt.opt \
 	cp utils/*.cmi parsing/*.cmi typing/*.cmi bytecomp/*.cmi driver/*.cmi toplevel/*.cmi $(COMPLIBDIR)
 	cp compilerlibs/ocamlcommon.cma compilerlibs/ocamlbytecomp.cma compilerlibs/ocamltoplevel.cma $(BYTESTART) $(TOPLEVELSTART) $(COMPLIBDIR)
 	cp expunge $(LIBDIR)/expunge$(EXE)
+	cp toplevel/topdirs.cmi $(LIBDIR)
 	cd tools; $(MAKE) install
 	-cd man; $(MAKE) install
 	for i in $(OTHERLIBRARIES); do \
 toplevel/opttoploop.cmx: otherlibs/dynlink/dynlink.cmxa
 
 otherlibs/dynlink/dynlink.cmxa: otherlibs/dynlink/natdynlink.ml
-	cd otherlibs/dynlink && make allopt
+	cd otherlibs/dynlink && $(MAKE) allopt
 
 # The configuration file
 
 
 package-macosx:
 	sudo rm -rf package-macosx/root
-	make PREFIX="`pwd`"/package-macosx/root install
+	$(MAKE) PREFIX="`pwd`"/package-macosx/root install
 	tools/make-package-macosx
 	sudo rm -rf package-macosx/root
 
 .PHONY: partialclean beforedepend alldepend cleanboot coldstart
 .PHONY: compare core coreall
 .PHONY: coreboot defaultentry depend distclean install installopt
-.PHONY: library library-cross libraryopt ocamlbuild-mixed-boot
+.PHONY: library library-cross libraryopt
 .PHONY: ocamlbuild.byte ocamlbuild.native ocamldebugger ocamldoc
 .PHONY: ocamldoc.opt ocamllex ocamllex.opt ocamltools ocamltoolsopt
 .PHONY: ocamltoolsopt.opt ocamlyacc opt-core opt opt.opt otherlibraries
 #                                                                       #
 #########################################################################
 
-# $Id: Makefile.nt 12511 2012-05-30 13:29:48Z lefessan $
+# $Id: Makefile.nt 12750 2012-07-20 08:06:01Z doligez $
 
 # The main Makefile
 
 	cp utils/*.cmi parsing/*.cmi typing/*.cmi bytecomp/*.cmi driver/*.cmi toplevel/*.cmi $(COMPLIBDIR)
 	cp compilerlibs/ocamlcommon.cma compilerlibs/ocamlbytecomp.cma compilerlibs/ocamltoplevel.cma $(BYTESTART) $(TOPLEVELSTART) $(COMPLIBDIR)
 	cp expunge $(LIBDIR)/expunge.exe
+	cp toplevel/topdirs.cmi $(LIBDIR)
 	cd tools ; $(MAKEREC) install
 	cd ocamldoc ; $(MAKEREC) install
 	mkdir -p $(STUBLIBDIR)
 	cp ocamlc.opt $(BINDIR)/ocamlc.opt$(EXE)
 	cp ocamlopt.opt $(BINDIR)/ocamlopt.opt$(EXE)
 	cp lex/ocamllex.opt $(BINDIR)/ocamllex.opt$(EXE)
-	cp compilerlibs/ocamlcommon.cmxa compilerlibs/ocamlcommon.a \
-	 compilerlibs/ocamlbytecomp.cmxa compilerlibs/ocamlbytecomp.a \
-	 compilerlibs/ocamloptcomp.cmxa compilerlibs/ocamloptcomp.a \
+	cp compilerlibs/ocamlcommon.cmxa compilerlibs/ocamlcommon.$(A) \
+	 compilerlibs/ocamlbytecomp.cmxa compilerlibs/ocamlbytecomp.$(A) \
+	 compilerlibs/ocamloptcomp.cmxa compilerlibs/ocamloptcomp.$(A) \
 	 $(COMPLIBDIR)
 
 clean:: partialclean
 toplevel/opttoploop.cmx: otherlibs/dynlink/dynlink.cmxa
 
 otherlibs/dynlink/dynlink.cmxa: otherlibs/dynlink/natdynlink.ml
-	cd otherlibs/dynlink && make allopt
+	cd otherlibs/dynlink && $(MAKE) allopt
 
 
 # The configuration file
 compilerlibs/ocamlcommon.cmxa: $(COMMON:.cmo=.cmx)
 	$(CAMLOPT) -a -o $@ $(COMMON:.cmo=.cmx)
 partialclean::
-	rm -f compilerlibs/ocamlcommon.cmxa compilerlibs/ocamlcommon.a
+	rm -f compilerlibs/ocamlcommon.cmxa compilerlibs/ocamlcommon.$(A)
 
 # The bytecode compiler compiled with the native-code compiler
 
 compilerlibs/ocamlbytecomp.cmxa: $(BYTECOMP:.cmo=.cmx)
 	$(CAMLOPT) -a -o $@ $(BYTECOMP:.cmo=.cmx)
 partialclean::
-	rm -f compilerlibs/ocamlbytecomp.cmxa compilerlibs/ocamlbytecomp.a
+	rm -f compilerlibs/ocamlbytecomp.cmxa compilerlibs/ocamlbytecomp.$(A)
 
 ocamlc.opt: compilerlibs/ocamlcommon.cmxa compilerlibs/ocamlbytecomp.cmxa $(BYTESTART:.cmo=.cmx)
 	$(CAMLOPT) $(LINKFLAGS) -ccopt "$(BYTECCLINKOPTS)" -o ocamlc.opt \
 compilerlibs/ocamloptcomp.cmxa: $(ASMCOMP:.cmo=.cmx)
 	$(CAMLOPT) -a -o $@ $(ASMCOMP:.cmo=.cmx)
 partialclean::
-	rm -f compilerlibs/ocamloptcomp.cmxa compilerlibs/ocamloptcomp.a
+	rm -f compilerlibs/ocamloptcomp.cmxa compilerlibs/ocamloptcomp.$(A)
 
 ocamlopt.opt: compilerlibs/ocamlcommon.cmxa compilerlibs/ocamloptcomp.cmxa $(OPTSTART:.cmo=.cmx)
 	$(CAMLOPT) $(LINKFLAGS) -o ocamlopt.opt \
     Can be downloaded from http://alain.frisch.fr/flexdll.html
 
 [3] TCL/TK version 8.5.  Windows binaries are available as part of the
-    ActiveTCL distribution at http://www.activestate.com/products/ActiveTcl/
-
+    ActiveTCL distribution at http://www.activestate.com/activetcl/downloads
 
 RECOMPILATION FROM THE SOURCES:
 
 
 REQUIREMENTS:
 
-This port runs under MS Windows Vista, XP, and 2000.
+This port runs under MS Windows Seven, Vista, XP, and 2000.
 
 The base bytecode system (ocamlc, ocaml, ocamllex, ocamlyacc, ...)
 runs without any additional tools.
 
  mingw64-i686-binutils
  mingw64-i686-gcc
+ mingw64-i686-gcc-core
  mingw64-i686-runtime
 
 
-NOTE:
+NOTES:
+
+  - Do not use the Cygwin version of flexdll for this port.
+
   - 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 LablTk GUI requires Tcl/Tk 8.5.  Windows binaries are available
 as part of the ActiveTCL distribution at
-http://www.activestate.com/products/ActiveTcl/
+  http://www.activestate.com/activetcl/downloads
 Note that you will need to install the 32-bit version of ActiveTCL,
 even if you are on a 64-bit version of Windows.
 
 RECOMPILATION FROM THE SOURCES:
 
 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:
+- Windows NT, 2000, XP, Vista, or Seven.
+- Cygwin: http://cygwin.com/
+  Install at least the following packages (and their dependencies, as
+  computed by Cygwin's setup.exe):
      mingw64-i686-binutils
      mingw64-i686-gcc
+     mingw64-i686-gcc-core
      mingw64-i686-runtime
      diffutils
      make
      ncurses
-- TCL/TK version 8.5 (see above).
-- The flexdll tool (see above).
+- Tcl/Tk version 8.5 (see above).
+- The flexdll tool (see above).  Do not forget to add the flexdll directory
+  to your PATH
 
 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
+Start a new Cygwin shell and unpack the source distribution
 (ocaml-X.YY.Z.tar.gz) with "tar xzf".  Change to the top-level
 directory of the OCaml distribution.  Then, do
 
 Then, edit config/Makefile as needed, following the comments in this file.
 Normally, the only variables that need to be changed are
         PREFIX      where to install everything
-        TK_ROOT     where TCL/TK was installed
+        TK_ROOT     where Tcl/Tk was installed
 
 Finally, use "make -f Makefile.nt" to build the system, e.g.
 
 
 RECOMPILATION FROM THE SOURCES:
 
+Before starting, make sure that the gcc version installed by cygwin
+is not 4.5.3 (it has a bug that affects OCaml).  If needed, use cygwin's
+setup.exe to downgrade to 4.3.4.
+
 You will need to recompile (and install) flexdll from source with
 Cygwin's C compiler because the official binary version of flexdll
 doesn't handle Cygwin's symbolic links and sometimes fails to
 launch the C compiler.
 
 In order to recompile flexdll, you first need to configure, compile,
-and install OCaml without flexdll support (by following the instructions
-in file INSTALL, except the "make opt.opt" part), then modify the
-flexdll Makefile to change line 51 from:
+and install OCaml without flexdll support (configure with options
+-no-shared-libs -no-tk -no-camlp4), then modify the flexdll Makefile
+to change line 51 from:
   LINKFLAGS = -ccopt "-link version_res.o"
 to:
   LINKFLAGS = -cclib version_res.o
 Then "make CHAINS=cygwin" and add the flexdll directory to your PATH.
 Make sure to add it before "/usr/bin" or you will get cygwin's flexlink.
 
-Then, OCaml's source directory, type:
+Then, in OCaml's source directory, type:
   make clean
   make distclean
 and follow the instructions for Unix machines given in the file INSTALL.
 
 NOTES:
 
-The libraries available in this port are "num", "str", "threads",
-"unix" and "labltk".  "graph" is not available.
-The replay debugger is fully supported.
-When upgrading from 3.12.0 to 3.12.1, you will need to remove
-/usr/local/bin/ocamlmktop.exe before typing "make install".
+- There is a problem with cygwin's port of gcc version 4.5.3.  You should
+  use cygwin's setup program to downgrade to 4.3.4 before compiling OCaml.
+- The replay debugger is fully supported.
+- When upgrading from 3.12.0 to 3.12.1, you will need to remove
+  /usr/local/bin/ocamlmktop.exe before typing "make install".
+- In order to use the "graph" and "labltk" libraries, you will need
+  to use Cygwin's setup.exe to install the xinit, libX11-devel, tcl,
+  and tcl-tk packages before compiling OCaml.
 
 ------------------------------------------------------------------------------
 
-4.00.0+beta2+camlp4-lexer-plug
+4.00.1+camlp4-lexer-plug
 
 # The version string is the first line of this file.
 # It must be in the format described in stdlib/sys.mli
 
-# $Id: VERSION 12567 2012-06-04 17:01:09Z doligez $
+# $Id: VERSION 12983 2012-10-03 15:11:00Z doligez $

asmcomp/amd64/emit.mlp

 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: emit.mlp 12448 2012-05-12 09:49:40Z xleroy $ *)
+(* $Id: emit.mlp 12907 2012-09-08 16:51:03Z xleroy $ *)
 
 (* Emission of x86-64 (AMD 64) assembly code *)
 
 
 let reg_low_8_name =
   [| "%al"; "%bl"; "%dil"; "%sil"; "%dl"; "%cl"; "%r8b"; "%r9b";
-     "%r10b"; "%r11b"; "%bpl"; "%r12b"; "%r13b" |]
+     "%r12b"; "%r13b"; "%bpl"; "%r10b"; "%r11b" |]
 let reg_low_16_name =
   [| "%ax"; "%bx"; "%di"; "%si"; "%dx"; "%cx"; "%r8w"; "%r9w";
-     "%r10w"; "%r11w"; "%bp"; "%r12w"; "%r13w" |]
+     "%r12w"; "%r13w"; "%bp"; "%r10w"; "%r11w" |]
 let reg_low_32_name =
   [| "%eax"; "%ebx"; "%edi"; "%esi"; "%edx"; "%ecx"; "%r8d"; "%r9d";
-     "%r10d"; "%r11d"; "%ebp"; "%r12d"; "%r13d" |]
+     "%r12d"; "%r13d"; "%ebp"; "%r10d"; "%r11d" |]
 
 let emit_subreg tbl r =
   match r.loc with
         if alloc then begin
           `	{load_symbol_addr s}, %rax\n`;
           `	{emit_call "caml_c_call"}\n`;
-          record_frame i.live i.dbg
+          record_frame i.live i.dbg;
+          `	{load_symbol_addr "caml_young_ptr"}, %r11\n`;
+          `	movq    (%r11), %r15\n`;
         end else begin
           `	{emit_call s}\n`
         end
   match Config.system with
   | "linux" | "gnu" ->
       (* mcount preserves rax, rcx, rdx, rsi, rdi, r8, r9 explicitly
-         and rbx, rbp, r12-r15 like all C functions.
-         We need to preserve r10 and r11 ourselves, since OCaml can
-         use them for argument passing. *)
+         and rbx, rbp, r12-r15 like all C functions.  This includes
+         all the registers used for argument passing, so we don't
+         need to preserve other regs.  We do need to initialize rbp
+         like mcount expects it, though. *)
       `	pushq	%r10\n`;
       `	movq	%rsp, %rbp\n`;
-      `	pushq	%r11\n`;
       `	{emit_call "mcount"}\n`;
-      `	popq	%r11\n`;
       `	popq	%r10\n`
   | _ ->
       () (*unsupported yet*)

asmcomp/amd64/emit_nt.mlp

 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: emit_nt.mlp 11887 2011-12-18 10:00:56Z xleroy $ *)
+(* $Id: emit_nt.mlp 12907 2012-09-08 16:51:03Z xleroy $ *)
 
 (* Emission of x86-64 (AMD 64) assembly code, MASM syntax *)
 
 
 let reg_low_8_name =
   [| "al"; "bl"; "dil"; "sil"; "dl"; "cl"; "r8b"; "r9b";
-     "r10b"; "r11b"; "bpl"; "r12b"; "r13b" |]
+     "r12b"; "r13b"; "bpl"; "r10b"; "r11b" |]
 let reg_low_16_name =
   [| "ax"; "bx"; "di"; "si"; "dx"; "cx"; "r8w"; "r9w";
-     "r10w"; "r11w"; "bp"; "r12w"; "r13w" |]
+     "r12w"; "r13w"; "bp"; "r10w"; "r11w" |]
 let reg_low_32_name =
   [| "eax"; "ebx"; "edi"; "esi"; "edx"; "ecx"; "r8d"; "r9d";
-     "r10d"; "r11d"; "ebp"; "r12d"; "r13d" |]
+     "r12d"; "r13d"; "ebp"; "r10d"; "r11d" |]
 
 let emit_subreg tbl pref r =
   match r.loc with

asmcomp/amd64/proc.ml

 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: proc.ml 12149 2012-02-10 16:15:24Z doligez $ *)
+(* $Id: proc.ml 12907 2012-09-08 16:51:03Z xleroy $ *)
 
 (* Description of the AMD64 processor *)
 
     rcx         5
     r8          6
     r9          7
-    r10         8
-    r11         9
+    r12         8
+    r13         9
     rbp         10
-    r12         11
-    r13         12
+    r10         11
+    r11         12
     r14         trap pointer
     r15         allocation pointer
 
   xmm0 - xmm15  100 - 115  *)
 
 (* Conventions:
-     rax - r11: OCaml function arguments
+     rax - r13: OCaml function arguments
      rax: OCaml and C function results
      xmm0 - xmm9: OCaml function arguments
      xmm0: OCaml and C function results
      xmm0 - xmm3: C function arguments
      rbx, rbp, rsi, rdi r12-r15 are preserved by C
      xmm6-xmm15 are preserved by C
+   Note (PR#5707): r11 should not be used for parameter passing, as it
+     can be destroyed by the dynamic loader according to SVR4 ABI.
+     Linux's dynamic loader also destroys r10.
 *)
 
 let int_reg_name =
   match Config.ccomp_type with
   | "msvc" ->
       [| "rax"; "rbx"; "rdi"; "rsi"; "rdx"; "rcx"; "r8"; "r9";
-         "r10"; "r11"; "rbp"; "r12"; "r13" |]
+         "r12"; "r13"; "rbp"; "r10"; "r11" |]
   | _ ->
       [| "%rax"; "%rbx"; "%rdi"; "%rsi"; "%rdx"; "%rcx"; "%r8"; "%r9";
-         "%r10"; "%r11"; "%rbp"; "%r12"; "%r13" |]
+         "%r12"; "%r13"; "%rbp"; "%r10"; "%r11" |]
 
 let float_reg_name =
   match Config.ccomp_type with
      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     
+     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.
   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;
+      [0;4;5;6;7;11;12;
        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;
+      [0;2;3;4;5;6;7;11;12;
        100;101;102;103;104;105;106;107;
        108;109;110;111;112;113;114;115])
 

asmcomp/arm/emit.mlp

 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: emit.mlp 12547 2012-06-02 18:00:43Z bmeurer $ *)
+(* $Id: emit.mlp 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* Emission of ARM assembly code *)
 

asmcomp/closure.ml

 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: closure.ml 12179 2012-02-21 17:41:02Z xleroy $ *)
+(* $Id: closure.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* Introduction of closures, uncurrying, recognition of direct calls *)
 
     match lam with
       Uvar v -> ()
     | Uconst(
-	(Const_base(Const_int _ | Const_char _ | Const_float _ |
+        (Const_base(Const_int _ | Const_char _ | Const_float _ |
                         Const_int32 _ | Const_int64 _ | Const_nativeint _) |
              Const_pointer _), _) -> incr size
 (* Structured Constants are now emitted during closure conversion. *)
   | Lfunction(kind, params, body) as funct ->
       close_one_function fenv cenv (Ident.create "fun") funct
 
-    (* We convert [f a] to [let a' = a in fun b c -> f a' b c] 
+    (* We convert [f a] to [let a' = a in fun b c -> f a' b c]
        when fun_arity > nargs *)
   | Lapply(funct, args, loc) ->
       let nargs = List.length args in
 
       | ((ufunct, Value_closure(fundesc, approx_res)), uargs)
           when nargs < fundesc.fun_arity ->
-	let first_args = List.map (fun arg ->
-	  (Ident.create "arg", arg) ) uargs in
-	let final_args = Array.to_list (Array.init (fundesc.fun_arity - nargs) (fun _ ->
-	  Ident.create "arg")) in
-	let rec iter args body =
-	  match args with
-	      [] -> body
-	    | (arg1, arg2) :: args ->
-	      iter args
-		(Ulet ( arg1, arg2, body))
-	in
-	let internal_args =
-	  (List.map (fun (arg1, arg2) -> Lvar arg1) first_args)
-	  @ (List.map (fun arg -> Lvar arg ) final_args)
-	in
-	let (new_fun, approx) = close fenv cenv
-	  (Lfunction(
-	    Curried, final_args, Lapply(funct, internal_args, loc)))
-	in
-	let new_fun = iter first_args new_fun in
-	(new_fun, approx)
+        let first_args = List.map (fun arg ->
+          (Ident.create "arg", arg) ) uargs in
+        let final_args = Array.to_list (Array.init (fundesc.fun_arity - nargs) (fun _ ->
+          Ident.create "arg")) in
+        let rec iter args body =
+          match args with
+              [] -> body
+            | (arg1, arg2) :: args ->
+              iter args
+                (Ulet ( arg1, arg2, body))
+        in
+        let internal_args =
+          (List.map (fun (arg1, arg2) -> Lvar arg1) first_args)
+          @ (List.map (fun arg -> Lvar arg ) final_args)
+        in
+        let (new_fun, approx) = close fenv cenv
+          (Lfunction(
+            Curried, final_args, Lapply(funct, internal_args, loc)))
+        in
+        let new_fun = iter first_args new_fun in
+        (new_fun, approx)
 
       | ((ufunct, Value_closure(fundesc, approx_res)), uargs)
         when fundesc.fun_arity > 0 && nargs > fundesc.fun_arity ->

asmcomp/cmmgen.ml

 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: cmmgen.ml 12237 2012-03-14 09:26:54Z xleroy $ *)
+(* $Id: cmmgen.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* Translation from closed lambda to C-- *)
 
           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, 
+                        Cifthenelse(is_addr_array_hdr hdr,
                                     addr_array_ref arr idx,
                                     float_array_ref arr idx))
             else
           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, 
+                        Cifthenelse(is_addr_array_hdr hdr,
                                     addr_array_set arr idx newval,
                                     float_array_set arr idx
                                                     (unbox_float newval)))
 let emit_all_constants cont =
   let c = ref cont in
   List.iter
-    (fun (lbl, global, cst) -> 
+    (fun (lbl, global, cst) ->
        let cst = emit_constant lbl cst [] in
-       let cst = if global then 
-	 Cglobal_symbol lbl :: cst
+       let cst = if global then
+         Cglobal_symbol lbl :: cst
        else cst in
-	 c:= Cdata(cst):: !c)
+         c:= Cdata(cst):: !c)
     (Compilenv.structured_constants());
 (*  structured_constants := []; done in Compilenv.reset() *)
   Hashtbl.clear immstrings;   (* PR#3979 *)
           args @ [Cvar last_arg; Cvar clos])
     else
       if n = arity - 1 then
-	begin
+        begin
       let newclos = Ident.create "clos" in
       Clet(newclos,
            get_field (Cvar clos) 3,
            curry_fun (get_field (Cvar clos) 2 :: args) newclos (n-1))
-	end else
-	begin
-	  let newclos = Ident.create "clos" in
-	  Clet(newclos,
+        end else
+        begin
+          let newclos = Ident.create "clos" in
+          Clet(newclos,
                get_field (Cvar clos) 4,
                curry_fun (get_field (Cvar clos) 3 :: args) newclos (n-1))
     end in
      {fun_name = name2;
       fun_args = [arg, typ_addr; clos, typ_addr];
       fun_body =
-	 if arity - num > 2 then
-	   Cop(Calloc,
+         if arity - num > 2 then
+           Cop(Calloc,
                [alloc_closure_header 5;
                 Cconst_symbol(name1 ^ "_" ^ string_of_int (num+1));
                 int_const (arity - num - 1);
                 Cconst_symbol(name1 ^ "_" ^ string_of_int (num+1) ^ "_app");
-		Cvar arg; Cvar clos])
-	 else
-	   Cop(Calloc,
+                Cvar arg; Cvar clos])
+         else
+           Cop(Calloc,
                      [alloc_closure_header 4;
                       Cconst_symbol(name1 ^ "_" ^ string_of_int (num+1));
                       int_const 1; Cvar arg; Cvar clos]);
       fun_dbg  = Debuginfo.none }
     ::
       (if arity - num > 2 then
-	  let rec iter i =
-	    if i <= arity then
-	      let arg = Ident.create (Printf.sprintf "arg%d" i) in
-	      (arg, typ_addr) :: iter (i+1)
-	    else []
-	  in
-	  let direct_args = iter (num+2) in
-	  let rec iter i args clos =
-	    if i = 0 then
-	      Cop(Capply(typ_addr, Debuginfo.none),
-		  (get_field (Cvar clos) 2) :: args @ [Cvar clos])
-	    else
-	      let newclos = Ident.create "clos" in
-	      Clet(newclos,
-		   get_field (Cvar clos) 4,
-		   iter (i-1) (get_field (Cvar clos) 3 :: args) newclos)
-	  in
-	  let cf =
-	    Cfunction
-	      {fun_name = name1 ^ "_" ^ string_of_int (num+1) ^ "_app";
-	       fun_args = direct_args @ [clos, typ_addr];
-	       fun_body = iter (num+1)
-		  (List.map (fun (arg,_) -> Cvar arg) direct_args) clos;
-	       fun_fast = true;
+          let rec iter i =
+            if i <= arity then
+              let arg = Ident.create (Printf.sprintf "arg%d" i) in
+              (arg, typ_addr) :: iter (i+1)
+            else []
+          in
+          let direct_args = iter (num+2) in
+          let rec iter i args clos =
+            if i = 0 then
+              Cop(Capply(typ_addr, Debuginfo.none),
+                  (get_field (Cvar clos) 2) :: args @ [Cvar clos])
+            else
+              let newclos = Ident.create "clos" in
+              Clet(newclos,
+                   get_field (Cvar clos) 4,
+                   iter (i-1) (get_field (Cvar clos) 3 :: args) newclos)
+          in
+          let cf =
+            Cfunction
+              {fun_name = name1 ^ "_" ^ string_of_int (num+1) ^ "_app";
+               fun_args = direct_args @ [clos, typ_addr];
+               fun_body = iter (num+1)
+                  (List.map (fun (arg,_) -> Cvar arg) direct_args) clos;
+               fun_fast = true;
                fun_dbg = Debuginfo.none }
-	  in
-	  cf :: intermediate_curry_functions arity (num+1)
+          in
+          cf :: intermediate_curry_functions arity (num+1)
        else
-	  intermediate_curry_functions arity (num+1))
+          intermediate_curry_functions arity (num+1))
   end
 
 let curry_function arity =

asmcomp/cmx_format.mli

 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: cmx_format.mli 12210 2012-03-08 19:52:03Z doligez $ *)
+(* $Id: cmx_format.mli 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* Format of .cmx, .cmxa and .cmxs files *)
 
   dynu_magic: string;
   dynu_units: dynunit list;
 }
-

asmcomp/debuginfo.ml

   dinfo_char_end = 0
 }
 
+(* PR#5643: cannot use (==) because Debuginfo values are marshalled *)
 let is_none t =
-  t == none
+  t = none
 
 let to_string d =
-  if d == none
+  if d = none
   then ""
   else Printf.sprintf "{%s:%d,%d-%d}"
            d.dinfo_file d.dinfo_line d.dinfo_char_start d.dinfo_char_end
 
 let from_call ev = from_location Dinfo_call ev.Lambda.lev_loc
 let from_raise ev = from_location Dinfo_raise ev.Lambda.lev_loc
-

asmcomp/debuginfo.mli

 
 type kind = Dinfo_call | Dinfo_raise
 
-type t = {
+type t = private {
   dinfo_kind: kind;
   dinfo_file: string;
   dinfo_line: int;

asmcomp/emitaux.ml

 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: emitaux.ml 12448 2012-05-12 09:49:40Z xleroy $ *)
+(* $Id: emitaux.ml 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* Common functions for emitting assembly code *)
 
   let x = Int32.bits_of_float (float_of_string f) in
   emit_printf "\t%s\t0x%lx\n" directive x
 
-(* Emit debug information *)
-
-(* This assoc list is expected to be very short *)
-let file_pos_nums =
-  (ref [] : (string * int) list ref)
-
-(* Number of files *)
-let file_pos_num_cnt = ref 1
-
-(* Reset debug state at beginning of asm file *)
-let reset_debug_info () =
-  file_pos_nums := [];
-  file_pos_num_cnt := 1
-
-(* We only diplay .file if the file has not been seen before. We
-   display .loc for every instruction. *)
-let emit_debug_info dbg =
-  if !Clflags.debug && not (Debuginfo.is_none dbg) then (
-    let line = dbg.Debuginfo.dinfo_line in
-    let file_name = dbg.Debuginfo.dinfo_file in
-    let file_num =
-      try List.assoc file_name !file_pos_nums
-      with Not_found ->
-        let file_num = !file_pos_num_cnt in
-        incr file_pos_num_cnt;
-        emit_string "	.file	";
-        emit_int file_num; emit_char '	';
-        emit_string_literal file_name; emit_char '\n';
-        file_pos_nums := (file_name,file_num) :: !file_pos_nums;
-        file_num in
-    emit_string "	.loc	";
-    emit_int file_num; emit_char '	';
-    emit_int line; emit_char '\n'
-  )
-
 (* Record live pointers at call points *)
 
 type frame_descr =
       lbl in
   let emit_frame fd =
     a.efa_label fd.fd_lbl;
-    a.efa_16 (if fd.fd_debuginfo == Debuginfo.none
+    a.efa_16 (if Debuginfo.is_none fd.fd_debuginfo
               then fd.fd_frame_size
               else fd.fd_frame_size + 1);
     a.efa_16 (List.length fd.fd_live_offset);
     List.iter a.efa_16 fd.fd_live_offset;
     a.efa_align Arch.size_addr;
-    if fd.fd_debuginfo != Debuginfo.none then begin
+    if not (Debuginfo.is_none fd.fd_debuginfo) then begin
       let d = fd.fd_debuginfo in
       let line = min 0xFFFFF d.dinfo_line
       and char_start = min 0xFF d.dinfo_char_start
 (* CFI directives *)
 
 let is_cfi_enabled () =
-  !Clflags.debug && Config.asm_cfi_supported
+  Config.asm_cfi_supported
 
 let cfi_startproc () =
   if is_cfi_enabled () then
-    emit_string "	.cfi_startproc\n"
+    emit_string "\t.cfi_startproc\n"
 
 let cfi_endproc () =
   if is_cfi_enabled () then
-    emit_string "	.cfi_endproc\n"
+    emit_string "\t.cfi_endproc\n"
 
 let cfi_adjust_cfa_offset n =
   if is_cfi_enabled () then
   begin
-    emit_string "	.cfi_adjust_cfa_offset	"; emit_int n; emit_string "\n";
+    emit_string "\t.cfi_adjust_cfa_offset\t"; emit_int n; emit_string "\n";
   end
- 
+
+(* Emit debug information *)
+
+(* This assoc list is expected to be very short *)
+let file_pos_nums =
+  (ref [] : (string * int) list ref)
+
+(* Number of files *)
+let file_pos_num_cnt = ref 1
+
+(* Reset debug state at beginning of asm file *)
+let reset_debug_info () =
+  file_pos_nums := [];
+  file_pos_num_cnt := 1
+
+(* We only diplay .file if the file has not been seen before. We
+   display .loc for every instruction. *)
+let emit_debug_info dbg =
+  if is_cfi_enabled () &&
+    !Clflags.debug && not (Debuginfo.is_none dbg) then begin
+    let line = dbg.Debuginfo.dinfo_line in
+    assert (line <> 0); (* clang errors out on zero line numbers *)
+    let file_name = dbg.Debuginfo.dinfo_file in
+    let file_num =
+      try List.assoc file_name !file_pos_nums
+      with Not_found ->
+        let file_num = !file_pos_num_cnt in
+        incr file_pos_num_cnt;
+        emit_string "\t.file\t";
+        emit_int file_num; emit_char '\t';
+        emit_string_literal file_name; emit_char '\n';
+        file_pos_nums := (file_name,file_num) :: !file_pos_nums;
+        file_num in
+    emit_string "\t.loc\t";
+    emit_int file_num; emit_char '\t';
+    emit_int line; emit_char '\n'
+  end

File contents unchanged.

asmcomp/i386/emit.mlp

 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: emit.mlp 12448 2012-05-12 09:49:40Z xleroy $ *)
+(* $Id: emit.mlp 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* Emission of Intel 386 assembly code *)
 

asmcomp/i386/emit_nt.mlp

 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: emit_nt.mlp 12166 2012-02-18 16:56:29Z xleroy $ *)
+(* $Id: emit_nt.mlp 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* Emission of Intel 386 assembly code, MASM syntax. *)
 

asmcomp/power/arch.ml

 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: arch.ml 12187 2012-02-24 10:13:02Z xleroy $ *)
+(* $Id: arch.ml 12583 2012-06-07 12:19:23Z xleroy $ *)
 
 (* Specific operations for the PowerPC processor *)
 
 
 (* Behavior of division *)
 
-let division_crashes_on_overflow = false
+let division_crashes_on_overflow = true
 
 (* Operations on addressing modes *)
 

asmcomp/power/emit.mlp

 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: emit.mlp 11887 2011-12-18 10:00:56Z xleroy $ *)
+(* $Id: emit.mlp 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* Emission of PowerPC assembly code *)
 

asmcomp/printlinear.ml

 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: printlinear.ml 12179 2012-02-21 17:41:02Z xleroy $ *)
+(* $Id: printlinear.ml 12610 2012-06-17 08:15:25Z xleroy $ *)
 
 (* Pretty-printing of linearized machine code *)
 
   | Lraise ->
       fprintf ppf "raise %a" reg i.arg.(0)
   end;
-  if i.dbg != Debuginfo.none then
+  if not (Debuginfo.is_none i.dbg) then
     fprintf ppf " %s" (Debuginfo.to_string i.dbg)
 
 let rec all_instr ppf i =

asmcomp/schedgen.ml

 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: schedgen.ml 12179 2012-02-21 17:41:02Z xleroy $ *)
+(* $Id: schedgen.ml 12876 2012-08-24 08:14:30Z xleroy $ *)
 
 (* Instruction scheduling *)
 
 
 let add_edge_after son ancestor = add_edge ancestor son 0
 
+(* Add edges from all instructions that define a pseudoregister [arg] being used
+   as argument to node [node] (RAW dependencies *)
+
+let add_RAW_dependencies node arg =
+  try
+    let ancestor = Hashtbl.find code_results arg.loc in
+    add_edge ancestor node ancestor.delay
+  with Not_found ->
+    ()
+
+(* Add edges from all instructions that use a pseudoregister [res] that is
+   defined by node [node] (WAR dependencies). *)
+
+let add_WAR_dependencies node res =
+  let ancestors = Hashtbl.find_all code_uses res.loc in
+  List.iter (add_edge_after node) ancestors
+
+(* Add edges from all instructions that have already defined a pseudoregister
+   [res] that is defined by node [node] (WAW dependencies). *)
+
+let add_WAW_dependencies node res =
+  try
+    let ancestor = Hashtbl.find code_results res.loc in
+    add_edge ancestor node 0
+  with Not_found ->
+    ()
+
 (* Compute length of longest path to a result.
    For leafs of the DAG, see whether their result is used in the instruction
    immediately following the basic block (a "critical" output). *)
   | Lreloadretaddr -> self#reload_retaddr_issue_cycles
   | _ -> assert false
 
+(* Pseudoregisters destroyed by an instruction *)
+
+method private destroyed_by_instr instr =
+  match instr.desc with
+  | Lop op -> Proc.destroyed_at_oper (Iop op)
+  | Lreloadretaddr -> [||]
+  | _ -> assert false
+
 (* Add an instruction to the code dag *)
 
 method private add_instruction ready_queue instr =
   let delay = self#instr_latency instr in
+  let destroyed = self#destroyed_by_instr instr in
   let node =
     { instr = instr;
       delay = delay;
       emitted_ancestors = 0 } in
   (* Add edges from all instructions that define one of the registers used
      (RAW dependencies) *)
-  for i = 0 to Array.length instr.arg - 1 do
-    try
-      let ancestor = Hashtbl.find code_results instr.arg.(i).loc in
-      add_edge ancestor node ancestor.delay
-    with Not_found ->
-      ()
-  done;
+  Array.iter (add_RAW_dependencies node) instr.arg;
   (* Also add edges from all instructions that use one of the result regs
-     of this instruction (WAR dependencies). *)
-  for i = 0 to Array.length instr.res - 1 do
-    let ancestors = Hashtbl.find_all code_uses instr.res.(i).loc in
-    List.iter (add_edge_after node) ancestors
-  done;
+     of this instruction, or a reg destroyed by this instruction
+     (WAR dependencies). *)
+  Array.iter (add_WAR_dependencies node) instr.res;
+  Array.iter (add_WAR_dependencies node) destroyed;   (* PR#5731 *)
   (* Also add edges from all instructions that have already defined one
-     of the results of this instruction (WAW dependencies). *)
-  for i = 0 to Array.length instr.res - 1 do
-    try
-      let ancestor = Hashtbl.find code_results instr.res.(i).loc in
-      add_edge ancestor node 0
-    with Not_found ->
-      ()
-  done;
+     of the results of this instruction, or a reg destroyed by
+     this instruction (WAW dependencies). *)
+  Array.iter (add_WAW_dependencies node) instr.res;
+  Array.iter (add_WAW_dependencies node) destroyed;   (* PR#5731 *)
   (* If this is a load, add edges from the most recent store viewed so
      far (if any) and remember the load.  Also add edges from the most
      recent checkbound and forget that checkbound. *)
   for i = 0 to Array.length instr.res - 1 do
     Hashtbl.add code_results instr.res.(i).loc node
   done;
+  for i = 0 to Array.length destroyed - 1 do
+    Hashtbl.add code_results destroyed.(i).loc node  (* PR#5731 *)
+  done;
   for i = 0 to Array.length instr.arg - 1 do
     Hashtbl.add code_uses instr.arg.(i).loc node
   done;

asmcomp/sparc/emit.mlp

 (*                                                                     *)
 (***********************************************************************)
 
-(* $Id: emit.mlp 11887 2011-12-18 10:00:56Z xleroy $ *)
+(* $Id: emit.mlp 12800 2012-07-30 18:59:07Z doligez $ *)
 
 (* Emission of Sparc assembly code *)
 
 alloc.o: alloc.c ../byterun/alloc.h ../byterun/misc.h ../byterun/config.h \
- ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
- ../byterun/custom.h ../byterun/major_gc.h ../byterun/freelist.h \
- ../byterun/memory.h ../byterun/gc.h ../byterun/major_gc.h \
- ../byterun/minor_gc.h ../byterun/mlvalues.h ../byterun/stacks.h \
- ../byterun/memory.h
+  ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
+  ../byterun/custom.h ../byterun/major_gc.h ../byterun/freelist.h \
+  ../byterun/memory.h ../byterun/gc.h ../byterun/major_gc.h \
+  ../byterun/minor_gc.h ../byterun/mlvalues.h ../byterun/stacks.h \
+  ../byterun/memory.h
 array.o: array.c ../byterun/alloc.h ../byterun/misc.h ../byterun/config.h \
- ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
- ../byterun/fail.h ../byterun/memory.h ../byterun/gc.h \
- ../byterun/major_gc.h ../byterun/freelist.h ../byterun/minor_gc.h \
- ../byterun/misc.h ../byterun/mlvalues.h
+  ../byterun/../config/m.h ../byterun/../config/s.h ../byterun/mlvalues.h \
+  ../byterun/fail.h ../byterun/memory.h ../byterun/gc.h \
+  ../byterun/major_gc.h ../byterun/freelist.h ../byterun/minor_gc.h \
+  ../byterun/misc.h ../byterun/mlvalues.h
 backtrace.o: backtrace.c ../byterun/alloc.h ../byterun/misc.h \
- ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
- ../byterun/mlvalues.h ../byterun/backtrace.h ../byterun/memory.h \
- ../byterun/gc.h ../byterun/major_gc.h ../byterun/freelist.h \
- ../byterun/minor_gc.h ../byterun/misc.h ../byterun/mlvalues.h stack.h
+  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+  ../byterun/mlvalues.h ../byterun/backtrace.h ../byterun/memory.h \
+  ../byterun/gc.h ../byterun/major_gc.h ../byterun/freelist.h \
+  ../byterun/minor_gc.h ../byterun/misc.h ../byterun/mlvalues.h stack.h
 callback.o: callback.c ../byterun/callback.h ../byterun/mlvalues.h \
- ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
- ../byterun/misc.h ../byterun/fail.h ../byterun/memory.h ../byterun/gc.h \
- ../byterun/major_gc.h ../byterun/freelist.h ../byterun/minor_gc.h \
- ../byterun/mlvalues.h
+  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+  ../byterun/misc.h ../byterun/fail.h ../byterun/memory.h ../byterun/gc.h \
+  ../byterun/major_gc.h ../byterun/freelist.h ../byterun/minor_gc.h \
+  ../byterun/mlvalues.h
 compact.o: compact.c ../byterun/config.h ../byterun/../config/m.h \
- ../byterun/../config/s.h ../byterun/finalise.h ../byterun/roots.h \
- ../byterun/misc.h ../byterun/config.h ../byterun/memory.h \
- ../byterun/gc.h ../byterun/mlvalues.h ../byterun/major_gc.h \
- ../byterun/freelist.h ../byterun/minor_gc.h ../byterun/freelist.h \
- ../byterun/gc.h ../byterun/gc_ctrl.h ../byterun/major_gc.h \
- ../byterun/memory.h ../byterun/mlvalues.h ../byterun/roots.h \
- ../byterun/weak.h
+  ../byterun/../config/s.h ../byterun/finalise.h ../byterun/roots.h \
+  ../byterun/misc.h ../byterun/config.h ../byterun/memory.h \
+  ../byterun/gc.h ../byterun/mlvalues.h ../byterun/major_gc.h \
+  ../byterun/freelist.h ../byterun/minor_gc.h ../byterun/freelist.h \
+  ../byterun/gc.h ../byterun/gc_ctrl.h ../byterun/major_gc.h \
+  ../byterun/memory.h ../byterun/mlvalues.h ../byterun/roots.h \
+  ../byterun/weak.h
 compare.o: compare.c ../byterun/custom.h ../byterun/mlvalues.h \
- ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
- ../byterun/misc.h ../byterun/fail.h ../byterun/memory.h ../byterun/gc.h \
- ../byterun/major_gc.h ../byterun/freelist.h ../byterun/minor_gc.h \
- ../byterun/misc.h ../byterun/mlvalues.h
+  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+  ../byterun/misc.h ../byterun/fail.h ../byterun/memory.h ../byterun/gc.h \
+  ../byterun/major_gc.h ../byterun/freelist.h ../byterun/minor_gc.h \
+  ../byterun/misc.h ../byterun/mlvalues.h
 custom.o: custom.c ../byterun/alloc.h ../byterun/misc.h \
- ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
- ../byterun/mlvalues.h ../byterun/custom.h ../byterun/fail.h \
- ../byterun/memory.h ../byterun/gc.h ../byterun/major_gc.h \
- ../byterun/freelist.h ../byterun/minor_gc.h ../byterun/mlvalues.h
+  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
+  ../byterun/mlvalues.h ../byterun/custom.h ../byterun/fail.h \
+  ../byterun/memory.h ../byterun/gc.h ../byterun/major_gc.h \
+  ../byterun/freelist.h ../byterun/minor_gc.h ../byterun/mlvalues.h
 debugger.o: debugger.c ../byterun/alloc.h ../byterun/misc.h \
- ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \
- ../byterun/mlvalues.h ../byterun/config.h ../byterun/debugger.h \
- ../byterun/misc.h
+  ../byterun/config.h ../byterun/../config/m.h ../byterun/../config/s.h \