summaryrefslogtreecommitdiff
path: root/asmcomp
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2014-11-07 13:37:44 +0000
committerXavier Leroy <xavier.leroy@inria.fr>2014-11-07 13:37:44 +0000
commit0a1a5b0e28d7788982c8ae159ec727b13e4d0187 (patch)
treea3ef5bc4bf16f935f1d9e90810d5556e9b1a16db /asmcomp
parentac02f56351c5eb04479963cb27f72ba250d04113 (diff)
downloadocaml-0a1a5b0e28d7788982c8ae159ec727b13e4d0187.tar.gz
Don't forget that allocations can run arbitrary Caml code (via signal handlers, etc). Hence, equations involving loads must be erased across allocations.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/cmm-mach-types@15569 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'asmcomp')
-rw-r--r--asmcomp/CSEgen.ml8
1 files changed, 6 insertions, 2 deletions
diff --git a/asmcomp/CSEgen.ml b/asmcomp/CSEgen.ml
index 7d398fff2f..8e6e285d13 100644
--- a/asmcomp/CSEgen.ml
+++ b/asmcomp/CSEgen.ml
@@ -252,8 +252,12 @@ method private cse n i =
is a derived heap pointer (a pointer into the heap that does
not point to the beginning of a Caml block). PR#6484 is an
example of this situation. Such pseudoregs have type [Addr].
- Pseudoregs with types other than [Addr] can be kept. *)
- let n1 = kill_addr_regs n in
+ Pseudoregs with types other than [Addr] can be kept.
+ Moreover, allocation can trigger the asynchronous execution
+ of arbitrary Caml code (finalizer, signal handler, context
+ switch), which can contain non-initializing stores.
+ Hence, all equations over loads must be removed. *)
+ let n1 = kill_addr_regs (self#kill_loads n) in
let n2 = set_unknown_regs n1 i.res in
{i with next = self#cse n2 i.next}
| Iop op ->