diff --git a/arm/PrintAsm.ml b/arm/PrintAsm.ml index e5b21f9c28b8d510413f2eaf468d91e3d4eaa788..16f22d60ddd0c0c891f57a1f3754b70a7da5bc31 100644 --- a/arm/PrintAsm.ml +++ b/arm/PrintAsm.ml @@ -336,8 +336,6 @@ let print_instruction oc labels = function | Psufd(r1, r2, r3) -> fprintf oc " sufd %a, %a, %a\n" freg r1 freg r2 freg r3; 1 (* Pseudo-instructions *) - | Pallocblock -> - fprintf oc " bl compcert_alloc\n"; 1 | Pallocframe(lo, hi, ofs) -> let lo = camlint_of_coqint lo and hi = camlint_of_coqint hi diff --git a/backend/CMlexer.mll b/backend/CMlexer.mll index 9854117c3433899779f0c5460e8e095cb50c211e..3506e50215d5b45b1023c023d58062d439ef6fa8 100644 --- a/backend/CMlexer.mll +++ b/backend/CMlexer.mll @@ -33,7 +33,6 @@ rule token = parse | blank + { token lexbuf } | "/*" { comment lexbuf; token lexbuf } | "absf" { ABSF } - | "alloc" { ALLOC } | "&" { AMPERSAND } | "&&" { AMPERSANDAMPERSAND } | "!" { BANG } diff --git a/backend/CMparser.mly b/backend/CMparser.mly index b995132c8977cddbe735e8bbea7453e24baec5d4..f369f9eacd1d8195fb5267fe3b26dc56c967c558 100644 --- a/backend/CMparser.mly +++ b/backend/CMparser.mly @@ -33,7 +33,6 @@ type rexpr = | Rload of memory_chunk * rexpr | Rcondition of rexpr * rexpr * rexpr | Rcall of signature * rexpr * rexpr list - | Ralloc of rexpr let temp_counter = ref 0 @@ -68,11 +67,6 @@ let rec convert_rexpr = function let t = mktemp() in convert_accu := Scall(Some t, sg, c1, cl) :: !convert_accu; Evar t - | Ralloc e1 -> - let c1 = convert_rexpr e1 in - let t = mktemp() in - convert_accu := Salloc(t, c1) :: !convert_accu; - Evar t and convert_rexpr_list = function | [] -> [] @@ -104,9 +98,6 @@ let mkassign id e = let c1 = convert_rexpr e1 in let cl = convert_rexpr_list el in prepend_seq !convert_accu (Scall(Some id, sg, c1, cl)) - | Ralloc(e1) -> - let c1 = convert_rexpr e1 in - prepend_seq !convert_accu (Salloc(id, c1)) | _ -> let c = convert_rexpr e in prepend_seq !convert_accu (Sassign(id, c)) @@ -206,7 +197,6 @@ let mkmatch expr cases = %token ABSF %token AMPERSAND %token AMPERSANDAMPERSAND -%token ALLOC %token BANG %token BANGEQUAL %token BANGEQUALF @@ -508,7 +498,6 @@ expr: | expr BARBAR expr { orbool $1 $3 } | expr QUESTION expr COLON expr { Rcondition($1, $3, $5) } | expr LPAREN expr_list RPAREN COLON signature{ Rcall($6, $1, $3) } - | ALLOC expr { Ralloc $2 } ; expr_list: diff --git a/backend/CMtypecheck.ml b/backend/CMtypecheck.ml index d761f759a8054d2d62e6e0c78a81be03cc1d73cd..c4f45b22120eddbefe9b6ae521e48e6da0903a9a 100644 --- a/backend/CMtypecheck.ml +++ b/backend/CMtypecheck.ml @@ -294,15 +294,6 @@ let rec type_stmt env blk ret s = with Error s -> raise (Error (sprintf "In call:\n%s" s)) end - | Salloc(id, e) -> - let tid = type_var env id in - let te = type_expr env [] e in - begin try - unify tint te; - unify tint tid - with Error s -> - raise (Error (sprintf "In alloc:\n%s" s)) - end | Sseq(s1, s2) -> type_stmt env blk ret s1; type_stmt env blk ret s2 diff --git a/backend/Linearizeaux.ml b/backend/Linearizeaux.ml index 2f2333fb1cefedab5c7a0a0bb0d9c137566c9dfc..d2d2f24add95c3a0b2488cacc58fa562446e384f 100644 --- a/backend/Linearizeaux.ml +++ b/backend/Linearizeaux.ml @@ -70,7 +70,6 @@ let enumerate_aux f reach = | Lstore (chunk, addr, args, src, s) -> emit_block pending s | Lcall (sig0, ros, args, res, s) -> emit_block pending s | Ltailcall (sig0, ros, args) -> emit_restart pending - | Lalloc (arg, res, s) -> emit_block pending s | Lcond (cond, args, ifso, ifnot) -> emit_restart (IntSet.add (int_of_pos ifso) (IntSet.add (int_of_pos ifnot) pending)) diff --git a/backend/RTLtypingaux.ml b/backend/RTLtypingaux.ml index ff704ebe75ca105c3cc8437e4eade2781a4d8968..632f2aa51e272e4ac19f62dbbda507ebe28954b1 100644 --- a/backend/RTLtypingaux.ml +++ b/backend/RTLtypingaux.ml @@ -86,8 +86,6 @@ let type_instr retty (Coq_pair(pc, i)) = raise(Type_error (Printf.sprintf "type mismatch in Itailcall(%s): %s" name msg)) end - | Ialloc(arg, res, _) -> - set_type arg Tint; set_type res Tint | Icond(cond, args, _, _) -> set_types args (type_of_condition cond) | Ireturn(optres) -> diff --git a/powerpc/PrintAsm.ml b/powerpc/PrintAsm.ml index a52a90f0625530a062ca7abe874d7c48726b7d8f..352da05ab02c1c761ac8417d0340325b4125ec82 100644 --- a/powerpc/PrintAsm.ml +++ b/powerpc/PrintAsm.ml @@ -180,8 +180,6 @@ let print_instruction oc labels = function fprintf oc " addis %a, %a, %a\n" ireg r1 ireg_or_zero r2 constant c | Paddze(r1, r2) -> fprintf oc " addze %a, %a\n" ireg r1 ireg r2 - | Pallocblock -> - fprintf oc " bl %a\n" raw_symbol "compcert_alloc" | Pallocframe(lo, hi, ofs) -> let lo = camlint_of_coqint lo and hi = camlint_of_coqint hi diff --git a/test/cminor/lists.cm b/test/cminor/lists.cm index c44562368c3d6174a2b35c19d41bbb01539d7d18..6007f3ce449ed4a7e347460f4832d56c3cbffc10 100644 --- a/test/cminor/lists.cm +++ b/test/cminor/lists.cm @@ -1,11 +1,13 @@ /* List manipulations */ +extern "malloc" : int -> int + "buildlist"(n): int -> int { var b; if (n < 0) return 0; - b = alloc 8; + b = "malloc"(8) : int -> int; int32[b] = n; int32[b+4] = "buildlist"(n - 1) : int -> int; return b; @@ -17,7 +19,7 @@ r = 0; loop { if (l == 0) return r; - r2 = alloc 8; + r2 = "malloc"(8) : int -> int; int32[r2] = int32[l]; int32[r2+4] = r; r = r2;