Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-termination during Compiling with OCaml #2926

Closed
vicuna opened this issue Aug 24, 2001 · 3 comments
Closed

Non-termination during Compiling with OCaml #2926

vicuna opened this issue Aug 24, 2001 · 3 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Aug 24, 2001

Original bug ID: 494
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

(This is the same bug I submitted directly to Xavier Leroy.)

Hello,

I have an ml file that was generated by an sml program. The generated
file does not have lambda abstractions nested too deeply (about 3 levels
of depth) and also is not overwhelmingly large (25K), yet when I compile
it it makes it through the initial syntax check and then the compiler
appears to just loop. One theory was that it was attempting to do massive
inline expansion, but the memory usage stays constant over at least a 50
minute time period. Do you have any suggestions? Also, I get basically the
same exact experience from both the byte-code and the native ocaml.

Thanks, Jon


module Make =
struct

(*module RP = Rtl.Private*)
module Bits = 
  struct

  end
module RP = 
  struct
     type aligned   = int     (* alignment guaranteed *)
     type assertion = aligned (* may one day include alias info *)
     type width     = int
     type opr        = string * width list
     type const      = Bool      of bool
                     | Bits      of (*Bits.bits*) int
                     | Link      of string * width         (* link time constant *)
     type aggregation = Identity

     type exp        = Const     of const
                     | Fetch     of loc * width
                     | App       of opr * exp  list
     and  loc       = Cell       of (*space *) char
                                 *  aggregation
                                 *  width
                                 *  exp
                                 *  assertion

                    | Var       of string    (* name from C-- source   *)
                                *  int       (* index for run-time API *)
                                *  width

                    | Slice     of width     (* number of bits in loc *)
                                *  int       (* index of least-significant bit of slice *)
                                *  loc  (* location from which slice is drawn *)
     type effect     = Store     of loc * exp  * width
                     | Kill      of loc
     type guarded    = exp  * effect
     type rtl        = Rtl of guarded list
  end

let defaultOfInstruction rtl = 
  let mAny = (fun fail input -> (match input with | x -> fail x)) in
  let mouter_1 = (fun succ0 fail input -> (match input with| (RP.Rtl a0) -> succ0 a0  | x -> fail x  )) in
  let mRP'Rtl_1 = (fun succ0 fail input -> (match input with| [a0] -> succ0 a0  | x -> fail x  )) in
  let mRP'Rtl_1_L_1 = (fun succ0 fail input -> (match input with| (a0,a1) -> succ0 a0 a1  | x -> fail x  )) in
  let mRP'Rtl_1_L_1_T_1 = (fun succ0 fail input -> (match input with| (RP.Const a0) -> succ0 a0  | x -> fail x  )) in
  let mRP'Rtl_1_L_1_T_2 = (fun succ0 fail input -> (match input with| (RP.Store (a0,a1,a2)) -> succ0 a0 a1 a2  | x -> fail x  )) in
  let mRP'Const_1 = (fun succ0 succ1 fail input -> (match input with| (RP.Bool a0) -> succ0 a0  | (RP.Bits a0) -> succ1 a0  | x -> fail x  )) in
  let mRP'Bool_1 = (fun succ0 fail input -> (match input with| true -> succ0 | x -> fail x  )) in
  let mRP'Store_1 = (fun succ0 fail input -> (match input with| (a0,a1,a2) -> succ0 a0 a1 a2  | x -> fail x  )) in
  let mRP'Store_1_T_1 = (fun succ0 fail input -> (match input with| (RP.Cell (a0,a1,a2,a3,a4)) -> succ0 a0 a1 a2 a3 a4  | x -> fail x  )) in
  let mRP'Store_1_T_2 = (fun succ0 fail input -> (match input with| (RP.App (a0,a1)) -> succ0 a0 a1  | x -> fail x  )) in
  let mRP'Store_1_T_3 = (fun succ0 fail input -> (match input with| 32 -> succ0 | x -> fail x  )) in
  let mRP'Cell_1 = (fun succ0 fail input -> (match input with| (a0,a1,a2,a3,a4) -> succ0 a0 a1 a2 a3 a4  | x -> fail x  )) in
  let mRP'Cell_1_T_1 = (fun succ0 succ1 fail input -> (match input with| 'm' -> succ0 | 'r' -> succ1 | x -> fail x  )) in
  let mRP'Cell_1_T_2 = (fun succ0 fail input -> (match input with| (RP.Identity) -> succ0 | x -> fail x  )) in
  let mRP'Cell_1_T_3 = (fun succ0 succ1 fail input -> (match input with| 8 -> succ0 | 32 -> succ1 | x -> fail x  )) in
  let mRP'Cell_1_T_4 = (fun succ0 succ1 fail input -> (match input with| (RP.Const a0) -> succ0 a0  | (RP.App (a0,a1)) -> succ1 a0 a1  | x -> fail x  )) in
  let mRP'App_1 = (fun succ0 fail input -> (match input with| (a0,a1) -> succ0 a0 a1  | x -> fail x  )) in
  let mRP'App_1_T_1 = (fun succ0 fail input -> (match input with| (a0,a1) -> succ0 a0 a1  | x -> fail x  )) in
  let mRP'App_1_T_2 = (fun succ0 succ1 fail input -> (match input with| [a0] -> succ0 a0  | [a0;a1] -> succ1 a0 a1  | x -> fail x  )) in
  let mRP'App_1_T_1_T_1 = (fun succ0 succ1 fail input -> (match input with| "sx" -> succ0 | "add" -> succ1 | x -> fail x  )) in
  let mRP'App_1_T_1_T_2 = (fun succ0 succ1 fail input -> (match input with| [a0] -> succ0 a0  | [a0;a1] -> succ1 a0 a1  | x -> fail x  )) in
  let mRP'App_1_T_1_T_2_L_1 = (fun succ0 succ1 fail input -> (match input with| 8 -> succ0 | 32 -> succ1 | x -> fail x  )) in
  let mRP'App_1_T_2_L_1 = (fun succ0 succ1 fail input -> (match input with| (RP.Const a0) -> succ0 a0  | (RP.Fetch (a0,a1)) -> succ1 a0 a1  | x -> fail x  )) in
  let mRP'Fetch_1 = (fun succ0 fail input -> (match input with| (a0,a1) -> succ0 a0 a1  | x -> fail x  )) in
  let mRP'Fetch_1_T_1 = (fun succ0 fail input -> (match input with| (RP.Cell (a0,a1,a2,a3,a4)) -> succ0 a0 a1 a2 a3 a4  | x -> fail x  )) in
  let mRP'Fetch_1_T_2 = (fun succ0 succ1 fail input -> (match input with| 8 -> succ0 | 32 -> succ1 | x -> fail x  )) in
  
  let oper0 = (fun  n0 n1->  (fun  t0->  mouter_1 (fun t1  -> n0 t1)
  (fun t1  -> n1 t1)
   t0))
  in
  let oper1 = (fun  n0 n1->  (fun  t0->  mRP'Rtl_1 (fun t1  -> n0 t1)
  (fun t1  -> n1 t1)
   t0))
  in
  let oper2 = (fun  n0 n1->  (fun  t0->  mRP'Rtl_1_L_1 (fun t1 t2  -> n0 t1 t2)
  (fun t1  -> n1 t1)
   t0))
  in
  let oper3 = (fun  n0 n1->  (fun  t0 t1->  mRP'Rtl_1_L_1_T_1 (fun t2  -> n0 t1 t2)
  (fun t2  -> n1 t1 t2)
   t0))
  in
  let oper4 = (fun  n0 n1->  (fun  t0 t1->  mRP'Rtl_1_L_1_T_2 (fun t2 t3 t4  -> n0 t1 t2 t3 t4)
  (fun t2  -> n1 t1 t2)
   t0))
  in
  let oper5 = (fun  n0 n1 n2->  (fun  t0 t1 t2 t3->  mRP'Const_1 (fun t4  -> n0 t1 t2 t3 t4)
  (fun t4  -> n1 t1 t2 t3 t4)
  (fun t4  -> n2 t1 t2 t3 t4)
   t0))
  in
  let oper6 = (fun  n0 n1->  (fun  t0 t1 t2 t3->  mRP'Store_1 (fun t4 t5 t6  -> n0 t1 t2 t3 t4 t5 t6)
  (fun t4  -> n1 t1 t2 t3 t4)
   t0))
  in
  let oper7 = (fun  n0 n1->  (fun  t0 t1 t2 t3 t4 t5->  mRP'Bool_1 (fun () -> n0 t1 t2 t3 t4 t5)
  (fun t6  -> n1 t1 t2 t3 t4 t5 t6)
   t0))
  in
  let oper8 = (fun  n0 n1->  (fun  t0 t1 t2 t3 t4->  mRP'Store_1_T_1 (fun t5 t6 t7 t8 t9  -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9)
  (fun t5  -> n1 t1 t2 t3 t4 t5)
   t0))
  in
  let oper9 = (fun  n0 n1->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8->  mRP'Store_1_T_2 (fun t9 t10  -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10)
  (fun t9  -> n1 t1 t2 t3 t4 t5 t6 t7 t8 t9)
   t0))
  in
  let oper10 = (fun  n0 n1->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9->  mRP'Store_1_T_3 (fun () -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9)
  (fun t10  -> n1 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10)
   t0))
  in
  let oper11 = (fun  n0 n1->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8->  mRP'Cell_1 (fun t9 t10 t11 t12 t13  -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13)
  (fun t9  -> n1 t1 t2 t3 t4 t5 t6 t7 t8 t9)
   t0))
  in
  let oper12 = (fun  n0 n1->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12->  mRP'App_1 (fun t13 t14  -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14)
  (fun t13  -> n1 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13)
   t0))
  in
  let oper13 = (fun  n0 n1 n2->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13->  mRP'Cell_1_T_1 (fun () -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13)
  (fun () -> n1 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13)
  (fun t14  -> n2 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14)
   t0))
  in
  let oper14 = (fun _ _ _ _ _ _ _ _ _ _ _ _ _ -> (fun a0  -> raise (Match_failure("",0,0))))in
  let oper15 = (fun  n0 n1->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12->  mRP'Cell_1_T_2 (fun () -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12)
  (fun t13  -> n1 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13)
   t0))
  in
  let oper16 = (fun  n0 n1 n2->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11->  mRP'Cell_1_T_3 (fun () -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11)
  (fun () -> n1 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11)
  (fun t12  -> n2 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12)
   t0))
  in
  let oper17 = (fun _ _ _ _ _ _ _ _ _ _ _ -> (fun a0  -> raise (Match_failure("",0,0))))in
  let oper18 = (fun  n0 n1 n2->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10->  mRP'Cell_1_T_4 (fun t11  -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11)
  (fun t11 t12  -> n1 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12)
  (fun t11  -> n2 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11)
   t0))
  in
  let oper19 = (fun  n0->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10->  mAny (fun () -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10)
   t0))
  in
  let oper20 = (fun  n0 n1->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10->  mRP'App_1_T_1 (fun t11 t12  -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12)
  (fun t11  -> n1 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11)
   t0))
  in
  let oper21 = (fun  n0 n1 n2->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11->  mRP'App_1_T_2 (fun t12  -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12)
  (fun t12 t13  -> n1 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13)
  (fun t12  -> n2 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12)
   t0))
  in
  let oper22 = (fun  n0 n1 n2->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11->  mRP'Const_1 (fun t12  -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12)
  (fun t12  -> n1 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12)
  (fun t12  -> n2 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12)
   t0))
  in
  let oper23 = (fun _ _ _ _ _ _ _ _ _ _ -> (fun a0 a1  -> raise (Match_failure("",0,0))))in
  let oper24 = (fun  n0 n1 n2->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11->  mRP'App_1_T_1_T_1 (fun () -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11)
  (fun () -> n1 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11)
  (fun t12  -> n2 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12)
   t0))
  in
  let oper25 = (fun  n0 n1 n2->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10->  mRP'App_1_T_1_T_2 (fun t11  -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11)
  (fun t11 t12  -> n1 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12)
  (fun t11  -> n2 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11)
   t0))
  in
  let oper26 = (fun _ _ _ _ _ _ _ _ _ -> (fun a0 a1  -> raise (Match_failure("",0,0))))in
  let oper27 = (fun  n0 n1 n2->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11->  mRP'App_1_T_2_L_1 (fun t12  -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12)
  (fun t12 t13  -> n1 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13)
  (fun t12  -> n2 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12)
   t0))
  in
  let oper28 = (fun  n0->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12->  mAny (fun () -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12)
   t0))
  in
  let oper29 = (fun  n0 n1 n2->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12->  mRP'App_1_T_1_T_2_L_1 (fun () -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12)
  (fun () -> n1 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12)
  (fun t13  -> n2 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13)
   t0))
  in
  let oper30 = (fun  n0 n1 n2->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11->  mRP'App_1_T_1_T_2_L_1 (fun () -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11)
  (fun () -> n1 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11)
  (fun t12  -> n2 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12)
   t0))
  in
  let oper31 = (fun  n0 n1->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10->  mRP'Fetch_1 (fun t11 t12  -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12)
  (fun t11  -> n1 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11)
   t0))
  in
  let oper32 = (fun  n0 n1->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11->  mRP'Fetch_1_T_1 (fun t12 t13 t14 t15 t16  -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16)
  (fun t12  -> n1 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12)
   t0))
  in
  let oper33 = (fun  n0 n1 n2->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15->  mRP'Fetch_1_T_2 (fun () -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15)
  (fun () -> n1 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15)
  (fun t16  -> n2 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16)
   t0))
  in
  let oper34 = (fun  n0 n1->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14->  mRP'Cell_1 (fun t15 t16 t17 t18 t19  -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19)
  (fun t15  -> n1 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15)
   t0))
  in
  let oper35 = (fun  n0 n1 n2->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18->  mRP'Cell_1_T_1 (fun () -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18)
  (fun () -> n1 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18)
  (fun t19  -> n2 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19)
   t0))
  in
  let oper36 = (fun  n0 n1->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17->  mRP'Cell_1_T_2 (fun () -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17)
  (fun t18  -> n1 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18)
   t0))
  in
  let oper37 = (fun  n0 n1 n2->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16->  mRP'Cell_1_T_3 (fun () -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16)
  (fun () -> n1 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16)
  (fun t17  -> n2 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17)
   t0))
  in
  let oper38 = (fun  n0 n1 n2->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15->  mRP'Cell_1_T_4 (fun t16  -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16)
  (fun t16 t17  -> n1 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17)
  (fun t16  -> n2 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16)
   t0))
  in
  let oper39 = (fun  n0->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16->  mAny (fun () -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16)
   t0))
  in
  let oper40 = (fun  n0 n1->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16->  mRP'App_1 (fun t17 t18  -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18)
  (fun t17  -> n1 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17)
   t0))
  in
  let oper41 = (fun  n0 n1->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17->  mRP'App_1_T_1 (fun t18 t19  -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19)
  (fun t18  -> n1 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18)
   t0))
  in
  let oper42 = (fun  n0 n1 n2->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18->  mRP'App_1_T_2 (fun t19  -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19)
  (fun t19 t20  -> n1 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20)
  (fun t19  -> n2 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19)
   t0))
  in
  let oper43 = (fun _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ -> (fun a0 a1 a2 a3  -> raise (Match_failure("",0,0))))in
  let oper44 = (fun  n0 n1 n2->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19->  mRP'App_1_T_1_T_1 (fun () -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19)
  (fun () -> n1 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19)
  (fun t20  -> n2 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20)
   t0))
  in
  let oper45 = (fun _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ -> (fun a0 a1 a2 a3  -> raise (Match_failure("",0,0))))in
  let oper46 = (fun  n0 n1 n2->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18->  mRP'App_1_T_1_T_2 (fun t19  -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19)
  (fun t19 t20  -> n1 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20)
  (fun t19  -> n2 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19)
   t0))
  in
  let oper47 = (fun  n0 n1 n2->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18->  mRP'App_1_T_2_L_1 (fun t19  -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19)
  (fun t19 t20  -> n1 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20)
  (fun t19  -> n2 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19)
   t0))
  in
  let oper48 = (fun  n0 n1 n2->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19->  mRP'App_1_T_2_L_1 (fun t20  -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20)
  (fun t20 t21  -> n1 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 t21)
  (fun t20  -> n2 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20)
   t0))
  in
  let oper49 = (fun  n0 n1 n2->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19->  mRP'App_1_T_1_T_2_L_1 (fun () -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19)
  (fun () -> n1 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19)
  (fun t20  -> n2 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20)
   t0))
  in
  let oper50 = (fun  n0 n1->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18->  mRP'Fetch_1 (fun t19 t20  -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20)
  (fun t19  -> n1 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19)
   t0))
  in
  let oper51 = (fun  n0 n1 n2->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19->  mRP'Const_1 (fun t20  -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20)
  (fun t20  -> n1 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20)
  (fun t20  -> n2 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20)
   t0))
  in
  let oper52 = (fun  n0 n1->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19->  mRP'Fetch_1_T_1 (fun t20 t21 t22 t23 t24  -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 t21 t22 t23 t24)
  (fun t20  -> n1 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20)
   t0))
  in
  let oper53 = (fun  n0 n1 n2->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 t21 t22 t23->  mRP'Fetch_1_T_2 (fun () -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 t21 t22 t23)
  (fun () -> n1 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 t21 t22 t23)
  (fun t24  -> n2 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 t21 t22 t23 t24)
   t0))
  in
  let oper54 = (fun _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ -> (fun a0 a1 a2 a3  -> raise (Match_failure("",0,0))))in
  let oper55 = (fun  n0->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 t21 t22->  mAny (fun () -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 t21 t22)
   t0))
  in
  let oper56 = (fun  n0 n1->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 t21 t22->  mRP'Cell_1 (fun t23 t24 t25 t26 t27  -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 t21 t22 t23 t24 t25 t26 t27)
  (fun t23  -> n1 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 t21 t22 t23)
   t0))
  in
  let oper57 = (fun  n0 n1 n2->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 t21 t22 t23 t24 t25 t26->  mRP'Cell_1_T_1 (fun () -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 t21 t22 t23 t24 t25 t26)
  (fun () -> n1 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 t21 t22 t23 t24 t25 t26)
  (fun t27  -> n2 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 t21 t22 t23 t24 t25 t26 t27)
   t0))
  in
  let oper58 = (fun _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ -> (fun a0 a1 a2 a3 a4  -> raise (Match_failure("",0,0))))in
  let oper59 = (fun  n0 n1->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 t21 t22 t23 t24 t25->  mRP'Cell_1_T_2 (fun () -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 t21 t22 t23 t24 t25)
  (fun t26  -> n1 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 t21 t22 t23 t24 t25 t26)
   t0))
  in
  let oper60 = (fun  n0 n1 n2->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 t21 t22 t23 t24->  mRP'Cell_1_T_3 (fun () -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 t21 t22 t23 t24)
  (fun () -> n1 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 t21 t22 t23 t24)
  (fun t25  -> n2 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 t21 t22 t23 t24 t25)
   t0))
  in
  let oper61 = (fun  n0 n1 n2->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 t21 t22 t23->  mRP'Cell_1_T_4 (fun t24  -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 t21 t22 t23 t24)
  (fun t24 t25  -> n1 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 t21 t22 t23 t24 t25)
  (fun t24  -> n2 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 t21 t22 t23 t24)
   t0))
  in
  let oper62 = (fun  n0->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 t21 t22 t23->  mAny (fun () -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 t21 t22 t23)
   t0))
  in
  let oper63 = (fun  n0 n1 n2->  (fun  t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 t21 t22 t23->  mRP'Const_1 (fun t24  -> n0 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 t21 t22 t23 t24)
  (fun t24  -> n1 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 t21 t22 t23 t24)
  (fun t24  -> n2 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 t17 t18 t19 t20 t21 t22 t23 t24)
   t0))
  in
  let oper64 = (fun _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ -> (fun a0 a1 a2 a3 a4 a5  -> raise (Match_failure("",0,0))))in
  let oper65 = (fun _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ -> (fun a0 a1 a2 a3 a4 a5  -> 1)) in
  let oper66 = (fun _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ -> (fun a0 a1 a2 a3 a4  -> raise (Match_failure("",0,0))))in
  let oper67 = (fun _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ -> (fun a0 a1 a2 a3 a4  -> raise (Match_failure("",0,0))))in
  let oper68 = (fun _ _ _ _ _ _ _ _ _ _ _ _ _ _ -> (fun a0 a1 a2 a3  -> raise (Match_failure("",0,0))))in
  let oper69 = (fun _ _ _ _ _ _ _ _ _ _ _ _ -> (fun a0 a1 a2  -> raise (Match_failure("",0,0))))in
  let oper70 = (fun _ _ _ _ _ _ _ _ -> (fun a0 a1 a2  -> raise (Match_failure("",0,0))))in
  let oper71 = (fun _ _ _ _ -> (fun a0  -> raise (Match_failure("",0,0))))in
  let oper72 = (fun _ _ _ _ _ -> (fun a0  -> raise (Match_failure("",0,0))))in
  let oper73 = (fun _ _ _ -> (fun a0  -> raise (Match_failure("",0,0))))in
  let oper74 = (fun _ -> (fun a0  -> raise (Match_failure("",0,0))))in
  let oper75 = (fun a0  -> raise (Match_failure("",0,0)))in
  
  (* new ops begin here *)
  (oper0 (oper1 (oper2 (oper3 (oper4 (oper5 (oper6 (oper7 (oper8 (oper9 (oper10 (oper11 (oper12 (oper13 oper14
  (oper15 (oper16 oper17
  (oper18 (oper19 (oper20 (oper21 (oper22 oper23
  (oper24 (oper25 oper26
  (oper27 oper23
  (oper28 (oper29 (oper30 oper26
  (oper31 (oper32 (oper33 (oper34 (oper35 (oper36 (oper37 (oper38 oper14
  (oper39 (oper40 (oper41 (oper42 oper43
  (oper44 oper45
  (oper46 (oper47 oper43
  (oper48 (oper49 oper45
  (oper50 (oper51 oper45
  (oper52 (oper53 oper54
  (oper55 (oper56 (oper57 oper58
  (oper59 (oper60 oper54
  (oper61 (oper62 (oper63 oper64
  (oper62 oper65)
  oper64))
  oper66
  oper66)
  oper54)
  oper67)
  oper58)
  oper64))
  oper54)
  oper45)
  oper45)
  oper43)
  oper45)
  oper45
  oper45)
  oper43)
  oper43
  oper43)
  oper45)
  oper43)
  oper68)
  oper14))
  oper14)
  oper68
  oper68)
  oper43)
  oper45
  oper45)
  oper69)
  oper14
  oper14)
  oper26)
  oper70)
  oper26)
  oper23
  oper23))
  oper23)
  oper26)
  oper23
  oper23)
  oper23)
  oper23
  oper23)
  oper26))
  oper23
  oper23)
  oper17)
  oper69)
  oper14)
  oper69)
  oper70)
  oper26)
  oper70)
  oper71)
  oper72)
  oper73)
  oper73
  oper73)
  oper74)
  oper74)
  oper75)
  oper75)
  oper75) 

end



@vicuna
Copy link
Author

vicuna commented Aug 30, 2001

Comment author: administrator

I have an ml file that was generated by an sml program. The generated
file does not have lambda abstractions nested too deeply (about 3 levels
of depth) and also is not overwhelmingly large (25K), yet when I compile
it it makes it through the initial syntax check and then the compiler
appears to just loop. One theory was that it was attempting to do massive
inline expansion, but the memory usage stays constant over at least a 50
minute time period. Do you have any suggestions? Also, I get basically the
same exact experience from both the byte-code and the native ocaml.

I just looked at your program, and it actually chokes the type-checker.
The big application involving a zillion "oper" variables doesn't go
down. The type-checker is not looping, as far as I can say, just
walking huge types over and over again. (Even if the memory usage
remains low: with sharing, you can get compact representations of data
structures that will take forever to traverse entirely.)

I have no idea whether we can do something about this issue. ML type
inference has tremendously high complexity, and you might just have
hit one of the cases where it's impossible to infer a type in a
reasonable time. Maybe other Caml developers with better familiarity
with the type-checker can tell.

At any rate, if you're goign to generate OCaml code, you'd better
generate something that looks more like what a human would write.

Best wishes,

  • Xavier Leroy

@vicuna
Copy link
Author

vicuna commented Nov 22, 2001

Comment author: administrator

The problem you reported seems related to #3000, which was corrected in ocaml
3.03 alpha.

By the way, with the current version of the compiler, I get a type error on your
code:

suiren-tmp> ocamlc -c sparcrec_closed.ml
File "sparcrec_closed.ml", line 346, characters 7-629:
This expression has type
unit ->
RP.exp * unit ->
RP.const * unit ->
'a list ->
string ->
'b list ->
RP.exp ->
RP.exp ->
int ->
'c * 'd ->
RP.const ->
RP.loc ->
int ->
unit ->
'e * 'f * 'g * 'h * 'i ->
char ->
RP.aggregation ->
int ->
unit -> unit -> unit -> 'j -> unit -> unit -> unit -> 'k -> 'l -> int
but is here used with type
unit ->
RP.exp * unit ->
RP.const * unit ->
'a list ->
string ->
'b list ->
RP.exp ->
RP.exp ->
int ->
'c * 'd ->
RP.const ->
RP.loc ->
int -> unit -> 'e * 'f * 'g * 'h * 'i -> RP.opr -> RP.exp list -> 'm
Type char is not compatible with type RP.opr = string * RP.width list

@vicuna
Copy link
Author

vicuna commented Nov 22, 2001

Comment author: administrator

Solved together with #3000 (2001-09-22).

@vicuna vicuna closed this as completed Nov 22, 2001
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant