Just for the sake of completeness: The test case works correctly, if ephemerons are used to simulate a weak set. See the corresponding test case „gcbug3.ml“. So there seems to at least exist a (sub-optimal) work-around in OCaml 4.03.0 and later. Best, Martin