diff --git a/src/plugins/alias/analysis.ml b/src/plugins/alias/analysis.ml index 5ed18ec07365673d0b8c7907cc6b03a2b47f716a..e6f0780dbf25c7d6e371f4cac17af376673259a6 100644 --- a/src/plugins/alias/analysis.ml +++ b/src/plugins/alias/analysis.ml @@ -37,7 +37,7 @@ module type InternalTable = sig include Table val add : key -> value -> unit val iter : (key -> value -> unit) -> unit - val clear : unit -> unit + (* val clear : unit -> unit*) end @@ -49,28 +49,36 @@ module Make_table(H: Hashtbl.S)(V: sig type t val size :int end) : InternalTable let find = H.find tbl let iter f = H.iter f tbl - let clear () = H.clear tbl + (* let clear () = H.clear tbl*) end module A = struct type t = Abstract_state.t option let size = 7 end module R = struct type t = Abstract_state.summary option let size = 7 end -module Stmt_table = Make_table(Cil_datatype.Stmt.Hashtbl)(A) +(*module Stmt_table = Make_table(Cil_datatype.Stmt.Hashtbl)(A)*) module Function_table = Make_table(Kernel_function.Hashtbl)(R) let function_compute_ref = Extlib.mk_fun "function_compute" -(* functions from abtract_state, exended to options *) -let union a1 a2 = - match a1,a2 with - None, None -> None - | None, _ -> a2 - | _, None -> a1 - | Some a1, Some a2 -> Some (Abstract_state.union a1 a2) +(* (\* functions from abtract_state, exended to options *\) + * let _union a1 a2 = + * match a1,a2 with + * None, None -> None + * | None, _ -> a2 + * | _, None -> a1 + * | Some a1, Some a2 -> Some (Abstract_state.union a1 a2) *) module D = Dataflow.StartData(A) +module Stmt_table = struct + include D + type key = stmt + type value = data +end + + + let do_assignment (a:Abstract_state.t option) (lv:lval) (exp:exp) : Abstract_state.t option= (* Format.printf "State before do_assignment %a = %a : @[%a@]@." Lval.pretty lv Exp.pretty exp pretty_debug a; *) match (a,lv, find_basic_lval exp) with @@ -95,7 +103,7 @@ let do_assignment (a:Abstract_state.t option) (lv:lval) (exp:exp) : Abstract_sta begin match e1.enode with Lval lv1 -> Some (Abstract_state.assignment_ptr_x_y a lv1 lv2) - | _ -> (Options.feedback "Skipping assignment @[%a@] = @[%a@] (BUG do_assignment 2)" Lval.pretty lv Exp.pretty exp; Some a) (* failwith " do_assignment not implemented 2" *) + | _ -> (Options.feedback "Skipping assignment @[%a@] = @[%a@] (BUG do_assignment 2)" Lval.pretty lv Exp.pretty exp; Some a) end (* cases *x = cst *) | (Some a, (Mem e1, NoOffset), BNone) -> @@ -122,6 +130,7 @@ let feedback_only_once s = end let do_instr (s:stmt) (i:instr) (a:Abstract_state.t option) : Abstract_state.t option = + (* Options.feedback "ANALYSING %a" Printer.pp_stmt s; *) match i with Set(lv,exp,_) -> let new_a = do_assignment a lv exp in @@ -170,7 +179,7 @@ struct type t = Abstract_state.t option - module StmtStartData = D + module StmtStartData = Stmt_table let copy x = x (* we only have persistant data *) @@ -202,36 +211,7 @@ struct let doGuard _ _ a = Dataflow.GUse a, Dataflow.GUse a - let rec process_Stmt (s:stmt) (a:t) : t = - (* Format.printf "DEBUG: process_smt <%a>@. Abstract state:@.@[%a@]@." Cil_types_debug.pp_stmt s pretty_debug a; *) - (* register a before stmt *) - Stmt_table.add s a; - match s.skind with - Instr i -> doInstr s i a - | Block b -> process_block b a - | If (_,b1, b2, _ ) -> - let a1 = process_block b1 a - and a2 = process_block b2 a - in - union a1 a2 - | Loop (_,b,_,_,_) -> process_block b a - | Return _ -> a - | Switch (_,b,ls,_) -> - let a =process_block b a in (* TODO : is it correct ?*) - List.fold_left (fun acc s -> process_Stmt s acc) a ls - | Break _ | Goto _ | Continue _ | UnspecifiedSequence _ - | Throw _ | TryCatch _ | TryFinally _ - | TryExcept _ -> (Options.feedback "Skiping @[%a@] (doStmt not implemented)" Stmt.pretty s; a) - - and process_block b a = - List.fold_left - (fun acc s -> process_Stmt s acc) - a - b.bstmts - - let doStmt (s:stmt) (a:t) = - Dataflow.SUse (process_Stmt s a) - + let doStmt _ _ = Dataflow.SDefault let doEdge _ _ a = a end @@ -274,7 +254,7 @@ let doFunction (kf:kernel_function) = (* let f_dec = Kernel_function.get_definition kf in *) Options.warning "DEBUG return stmt of %a not in table" Kernel_function.pretty kf; (* List.iter - * (fun k -> let v = try Stmt_table.find k with Not_found -> (Format.printf "%a is missing" print_key k ; None) in + * (fun k -> let v = try (*Stmt_table*)Stmt_table.find k with Not_found -> (Format.printf "%a is missing" print_key k ; None) in * Options.feedback "Before statement %a :@.@[<hov 2> %a@]@." print_key k print_value v * ) * f_dec.sallstmts; *) @@ -358,7 +338,7 @@ let compute () = let clear () = computed_flag := false; - Stmt_table.clear() + (*Stmt_table*)Stmt_table.clear() let get_abstract_state _ stmt = if is_computed () @@ -367,3 +347,4 @@ let get_abstract_state _ stmt = Not_found -> None else None + diff --git a/src/plugins/alias/tests/basic/oracle/assignment1.res.oracle b/src/plugins/alias/tests/basic/oracle/assignment1.res.oracle index 364a5364058c136249c4e6bb00072846a7430338..6df5e3bb46320c438a4516e247c69e8433ce84d6 100644 --- a/src/plugins/alias/tests/basic/oracle/assignment1.res.oracle +++ b/src/plugins/alias/tests/basic/oracle/assignment1.res.oracle @@ -1,5 +1,13 @@ [kernel] Parsing assignment1.c (with preprocessing) [alias] Parsing done +[alias] ANALYSING int *a = (int *)0; +[alias] ANALYSING int *b = (int *)0; +[alias] ANALYSING int *c = (int *)0; +[alias] ANALYSING int *d = (int *)0; +[alias] ANALYSING a = b; +[alias] ANALYSING b = c; +[alias] ANALYSING a = d; +[alias] ANALYSING __retres = 0; [alias] May-aliases at the end of function main: <list of may-alias> {a; b; c; d; } are aliased diff --git a/src/plugins/alias/tests/basic/oracle/assignment2.res.oracle b/src/plugins/alias/tests/basic/oracle/assignment2.res.oracle index 949d0dbc35baeea7cf93d64483a2fbe7fae1c9a6..599e200688676f6802514392cad401767985cd03 100644 --- a/src/plugins/alias/tests/basic/oracle/assignment2.res.oracle +++ b/src/plugins/alias/tests/basic/oracle/assignment2.res.oracle @@ -1,5 +1,13 @@ [kernel] Parsing assignment2.c (with preprocessing) [alias] Parsing done +[alias] ANALYSING int **a = (int **)0; +[alias] ANALYSING int *b = (int *)0; +[alias] ANALYSING int **c = (int **)0; +[alias] ANALYSING int *d = (int *)0; +[alias] ANALYSING *a = b; +[alias] ANALYSING *c = d; +[alias] ANALYSING a = c; +[alias] ANALYSING __retres = 0; [alias] May-aliases at the end of function main: <list of may-alias> {*b; *d; } are aliased diff --git a/src/plugins/alias/tests/basic/oracle/assignment3.res.oracle b/src/plugins/alias/tests/basic/oracle/assignment3.res.oracle index 551c980ced187f0dc47bf71afd2ffad9832a26c8..909a5696fb83a6138aff27e9555f568da1f5d0d8 100644 --- a/src/plugins/alias/tests/basic/oracle/assignment3.res.oracle +++ b/src/plugins/alias/tests/basic/oracle/assignment3.res.oracle @@ -1,5 +1,11 @@ [kernel] Parsing assignment3.c (with preprocessing) [alias] Parsing done +[alias] ANALYSING int *a = (int *)0; +[alias] ANALYSING int b = 0; +[alias] ANALYSING int *c = (int *)0; +[alias] ANALYSING a = & b; +[alias] ANALYSING c = & b; +[alias] ANALYSING __retres = 0; [alias] May-aliases at the end of function main: <list of may-alias> {a; c; } are aliased diff --git a/src/plugins/alias/tests/basic/oracle/assignment4.res.oracle b/src/plugins/alias/tests/basic/oracle/assignment4.res.oracle index 41bdea2499ea52676ca65069b38f7b3fd9bc192c..4e349bedc971a004ace22b6ad0c608848f48df0c 100644 --- a/src/plugins/alias/tests/basic/oracle/assignment4.res.oracle +++ b/src/plugins/alias/tests/basic/oracle/assignment4.res.oracle @@ -1,5 +1,13 @@ [kernel] Parsing assignment4.c (with preprocessing) [alias] Parsing done +[alias] ANALYSING int **a = (int **)0; +[alias] ANALYSING int *b = (int *)0; +[alias] ANALYSING int **c = (int **)0; +[alias] ANALYSING int *d = (int *)0; +[alias] ANALYSING *a = b; +[alias] ANALYSING *c = d; +[alias] ANALYSING b = d; +[alias] ANALYSING __retres = 0; [alias] May-aliases at the end of function main: <list of may-alias> {*b; *d; } are aliased diff --git a/src/plugins/alias/tests/basic/oracle/cast1.res.oracle b/src/plugins/alias/tests/basic/oracle/cast1.res.oracle index 28b0d71a5ac51a5f4a78b78b806e19cfbef4c115..43fb5960a7027327b7860d379fdb81b95958b735 100644 --- a/src/plugins/alias/tests/basic/oracle/cast1.res.oracle +++ b/src/plugins/alias/tests/basic/oracle/cast1.res.oracle @@ -1,5 +1,12 @@ [kernel] Parsing cast1.c (with preprocessing) [alias] Parsing done +[alias] ANALYSING int *a = (int *)0; +[alias] ANALYSING int *b = (int *)0; +[alias] ANALYSING float *c = (float *)0; +[alias] ANALYSING float *d = (float *)0; +[alias] ANALYSING a = (int *)c; +[alias] ANALYSING d = (float *)b; +[alias] ANALYSING __retres = 0; [alias] May-aliases at the end of function main: <list of may-alias> {a; c; } are aliased diff --git a/src/plugins/alias/tests/basic/oracle/conditional1.res.oracle b/src/plugins/alias/tests/basic/oracle/conditional1.res.oracle index cc37f90c3f55035019caff3cdb41bc7a92d1e882..620ecc8110abf88c96d88d73e6d025f0f87dbeff 100644 --- a/src/plugins/alias/tests/basic/oracle/conditional1.res.oracle +++ b/src/plugins/alias/tests/basic/oracle/conditional1.res.oracle @@ -1,5 +1,12 @@ [kernel] Parsing conditional1.c (with preprocessing) [alias] Parsing done +[alias] ANALYSING int *a = (int *)0; +[alias] ANALYSING int *b = (int *)0; +[alias] ANALYSING int *c = (int *)0; +[alias] ANALYSING a = b; +[alias] ANALYSING a = c; +[alias] ANALYSING *a = 4; +[alias] ANALYSING __retres = 0; [alias] May-aliases at the end of function main: <list of may-alias> {a; b; c; } are aliased @@ -24,18 +31,6 @@ Before statement if (a) a = b; else a = c; : Before statement a = b; : <list of may-alias> -{a; b; c; } are aliased -{*a; *b; *c; } are aliased -<end of list> - -Before statement a = b; : - <list of may-alias> -<end of list> - -Before statement a = c; : - <list of may-alias> -{a; b; c; } are aliased -{*a; *b; *c; } are aliased <end of list> Before statement a = c; : diff --git a/src/plugins/alias/tests/basic/oracle/conditional2.res.oracle b/src/plugins/alias/tests/basic/oracle/conditional2.res.oracle index 9cd69b4095a0d2e25d85494d96627ce6098affb4..8debbdfefd107cf1075309232181b3665e3a4d6c 100644 --- a/src/plugins/alias/tests/basic/oracle/conditional2.res.oracle +++ b/src/plugins/alias/tests/basic/oracle/conditional2.res.oracle @@ -1,5 +1,11 @@ [kernel] Parsing conditional2.c (with preprocessing) [alias] Parsing done +[alias] ANALYSING b = & c; +[alias] ANALYSING c = & d; +[alias] ANALYSING d = & e; +[alias] ANALYSING a = b; +[alias] ANALYSING a = & c; +[alias] ANALYSING __retres = 0; [alias] May-aliases at the end of function main: <list of may-alias> {d; *c; } are aliased @@ -28,26 +34,12 @@ Before statement if (a) a = b; else a = & c; : {d; *c; } are aliased <end of list> -Before statement a = b; : - <list of may-alias> -{d; *c; } are aliased -{a; b; } are aliased -{c; *a; *b; } are aliased -<end of list> - Before statement a = b; : <list of may-alias> {c; *b; } are aliased {d; *c; } are aliased <end of list> -Before statement a = & c; : - <list of may-alias> -{d; *c; } are aliased -{a; b; } are aliased -{c; *a; *b; } are aliased -<end of list> - Before statement a = & c; : <list of may-alias> {c; *b; } are aliased diff --git a/src/plugins/alias/tests/basic/oracle/function1.res.oracle b/src/plugins/alias/tests/basic/oracle/function1.res.oracle index 56585d3707bf49953de8f55cb8e46074ded9a75b..5b768c382f8a0c5287fec2e809574ff0c18dc286 100644 --- a/src/plugins/alias/tests/basic/oracle/function1.res.oracle +++ b/src/plugins/alias/tests/basic/oracle/function1.res.oracle @@ -1,5 +1,16 @@ [kernel] Parsing function1.c (with preprocessing) [alias] Parsing done +[alias] ANALYSING int *a = (int *)0; +[alias] ANALYSING int *b = (int *)0; +[alias] ANALYSING int *c = (int *)0; +[alias] ANALYSING int *d = (int *)0; +[alias] ANALYSING swap(a,b); +[alias] ANALYSING int *z = (int *)0; +[alias] ANALYSING z = x; +[alias] ANALYSING x = y; +[alias] ANALYSING y = z; +[alias] ANALYSING swap(c,d); +[alias] ANALYSING __retres = 0; [alias] May-aliases at the end of function main: <list of may-alias> {a; b; } are aliased @@ -7,6 +18,7 @@ {c; d; } are aliased {*c; *d; } are aliased <end of list> +[alias] ANALYSING int *z = (int *)0; [alias] Functions done Before statement int *z = (int *)0; : <list of may-alias> diff --git a/src/plugins/alias/tests/basic/oracle/function2.res.oracle b/src/plugins/alias/tests/basic/oracle/function2.res.oracle index b69f7452c5d8e31b5267fc41100f9d898daad0c2..5a9efeef4aeda564a74718a947e717bca93c4364 100644 --- a/src/plugins/alias/tests/basic/oracle/function2.res.oracle +++ b/src/plugins/alias/tests/basic/oracle/function2.res.oracle @@ -1,8 +1,16 @@ [kernel] Parsing function2.c (with preprocessing) [alias] Parsing done +[alias] ANALYSING int *a = (int *)0; +[alias] ANALYSING int *b = (int *)0; +[alias] ANALYSING a = my_malloc(2); +[alias] ANALYSING int *res = (int *)0; +[alias] ANALYSING res = (int *)malloc((size_t)size); +[alias] ANALYSING b = my_malloc(3); +[alias] ANALYSING __retres = 0; [alias] May-aliases at the end of function main: <list of may-alias> <end of list> +[alias] ANALYSING int *res = (int *)0; [alias] Functions done Before statement int *res = (int *)0; : <list of may-alias> diff --git a/src/plugins/alias/tests/basic/oracle/function3.res.oracle b/src/plugins/alias/tests/basic/oracle/function3.res.oracle index d67f7024949ecad6c5ce2676a943dd2fb335e6f0..e1edc96653c6d479717ab498822101ece1266267 100644 --- a/src/plugins/alias/tests/basic/oracle/function3.res.oracle +++ b/src/plugins/alias/tests/basic/oracle/function3.res.oracle @@ -1,8 +1,16 @@ [kernel] Parsing function3.c (with preprocessing) [alias] Parsing done -[alias] Skiping break; (doStmt not implemented) -[alias] Skiping break; (doStmt not implemented) -[alias] Skiping break; (doStmt not implemented) +[alias] ANALYSING int *tmp = x; +[alias] ANALYSING x = y; +[alias] ANALYSING y = tmp; +[alias] ANALYSING __retres = (void *)0; +[alias] ANALYSING int *a = (int *)0; +[alias] ANALYSING int *b = (int *)0; +[alias] ANALYSING int *c = (int *)0; +[alias] ANALYSING int *d = (int *)0; +[alias] ANALYSING f1(a,b); +[alias] ANALYSING f1(c,d); +[alias] ANALYSING __retres = 0; [alias] May-aliases at the end of function main: <list of may-alias> {a; b; } are aliased @@ -39,14 +47,6 @@ Before statement return __retres; : {*c; *d; } are aliased <end of list> -Before statement x = y; - y = tmp; - break; : - <list of may-alias> -{x; y; tmp; } are aliased -{*x; *y; *tmp; } are aliased -<end of list> - Before statement x = y; y = tmp; break; : @@ -55,18 +55,6 @@ Before statement x = y; {*x; *tmp; } are aliased <end of list> -Before statement x = y; : - <list of may-alias> -{x; y; tmp; } are aliased -{*x; *y; *tmp; } are aliased -<end of list> - -Before statement x = y; : - <list of may-alias> -{x; y; tmp; } are aliased -{*x; *y; *tmp; } are aliased -<end of list> - Before statement x = y; : <list of may-alias> {x; tmp; } are aliased @@ -79,30 +67,6 @@ Before statement y = tmp; : {*x; *y; *tmp; } are aliased <end of list> -Before statement y = tmp; : - <list of may-alias> -{x; y; tmp; } are aliased -{*x; *y; *tmp; } are aliased -<end of list> - -Before statement y = tmp; : - <list of may-alias> -{x; y; tmp; } are aliased -{*x; *y; *tmp; } are aliased -<end of list> - -Before statement break; : - <list of may-alias> -{x; y; tmp; } are aliased -{*x; *y; *tmp; } are aliased -<end of list> - -Before statement break; : - <list of may-alias> -{x; y; tmp; } are aliased -{*x; *y; *tmp; } are aliased -<end of list> - Before statement break; : <list of may-alias> {x; y; tmp; } are aliased diff --git a/src/plugins/alias/tests/basic/oracle/function4.res.oracle b/src/plugins/alias/tests/basic/oracle/function4.res.oracle index c59c9e79c8ae1347097f30054e4ab2a816f819d1..08058c8a44d27e4c67f9551bac02d843a5d3926c 100644 --- a/src/plugins/alias/tests/basic/oracle/function4.res.oracle +++ b/src/plugins/alias/tests/basic/oracle/function4.res.oracle @@ -1,5 +1,11 @@ [kernel] Parsing function4.c (with preprocessing) [alias] Parsing done +[alias] ANALYSING int *a = (int *)0; +[alias] ANALYSING int *b = (int *)0; +[alias] ANALYSING int c = 0; +[alias] ANALYSING a = addr(& c); +[alias] ANALYSING b = & c; +[alias] ANALYSING __retres = 0; [alias] May-aliases at the end of function main: <list of may-alias> {a; b; } are aliased diff --git a/src/plugins/alias/tests/basic/oracle/function5.res.oracle b/src/plugins/alias/tests/basic/oracle/function5.res.oracle index 7e54cb3f9a911c8816e190db387b001516c627d9..66b4e2ee538eea53a14682068bf131abe8465949 100644 --- a/src/plugins/alias/tests/basic/oracle/function5.res.oracle +++ b/src/plugins/alias/tests/basic/oracle/function5.res.oracle @@ -1,42 +1,25 @@ [kernel] Parsing function5.c (with preprocessing) [alias] Parsing done -[alias] Skiping goto return_label; (doStmt not implemented) -[alias] Skiping goto return_label; (doStmt not implemented) -[alias] Skiping goto return_label; (doStmt not implemented) -[alias] Skiping goto return_label; (doStmt not implemented) -[alias] Skiping goto return_label; (doStmt not implemented) -[alias] Skiping goto return_label; (doStmt not implemented) +[alias] ANALYSING int c = 0; +[alias] ANALYSING __retres = x; +[alias] ANALYSING __retres = y; +[alias] ANALYSING int *a = (int *)0; +[alias] ANALYSING int *b = (int *)0; +[alias] ANALYSING int *c = (int *)0; +[alias] ANALYSING c = choice(a,b); +[alias] ANALYSING __retres = 0; [alias] May-aliases at the end of function main: <list of may-alias> {a; b; c; } are aliased {*a; *b; *c; } are aliased <end of list> [alias] Functions done -Before statement goto return_label; : - <list of may-alias> -{x; y; __retres; } are aliased -{*x; *y; *__retres; } are aliased -<end of list> - -Before statement goto return_label; : - <list of may-alias> -{x; y; __retres; } are aliased -{*x; *y; *__retres; } are aliased -<end of list> - Before statement goto return_label; : <list of may-alias> {x; __retres; } are aliased {*x; *__retres; } are aliased <end of list> -Before statement __retres = y; - goto return_label; : - <list of may-alias> -{x; y; __retres; } are aliased -{*x; *y; *__retres; } are aliased -<end of list> - Before statement __retres = y; goto return_label; : <list of may-alias> @@ -46,18 +29,6 @@ Before statement int c = 0; : <list of may-alias> <end of list> -Before statement goto return_label; : - <list of may-alias> -{x; y; __retres; } are aliased -{*x; *y; *__retres; } are aliased -<end of list> - -Before statement goto return_label; : - <list of may-alias> -{x; y; __retres; } are aliased -{*x; *y; *__retres; } are aliased -<end of list> - Before statement goto return_label; : <list of may-alias> {y; __retres; } are aliased @@ -87,34 +58,10 @@ Before statement return __retres; : {*a; *b; *c; } are aliased <end of list> -Before statement __retres = x; : - <list of may-alias> -{x; y; __retres; } are aliased -{*x; *y; *__retres; } are aliased -<end of list> - -Before statement __retres = x; : - <list of may-alias> -{x; y; __retres; } are aliased -{*x; *y; *__retres; } are aliased -<end of list> - Before statement __retres = x; : <list of may-alias> <end of list> -Before statement __retres = y; : - <list of may-alias> -{x; y; __retres; } are aliased -{*x; *y; *__retres; } are aliased -<end of list> - -Before statement __retres = y; : - <list of may-alias> -{x; y; __retres; } are aliased -{*x; *y; *__retres; } are aliased -<end of list> - Before statement __retres = y; : <list of may-alias> <end of list> @@ -141,13 +88,6 @@ Before statement __retres = 0; : {*a; *b; *c; } are aliased <end of list> -Before statement __retres = x; - goto return_label; : - <list of may-alias> -{x; y; __retres; } are aliased -{*x; *y; *__retres; } are aliased -<end of list> - Before statement __retres = x; goto return_label; : <list of may-alias> diff --git a/src/plugins/alias/tests/basic/oracle/switch1.res.oracle b/src/plugins/alias/tests/basic/oracle/switch1.res.oracle index c2c0d2c015f283a91e4156ac79ada405e5838f86..cab732089ebc7a0701257cac717c1a5e499e0b0e 100644 --- a/src/plugins/alias/tests/basic/oracle/switch1.res.oracle +++ b/src/plugins/alias/tests/basic/oracle/switch1.res.oracle @@ -1,9 +1,13 @@ [kernel] Parsing switch1.c (with preprocessing) [alias] Parsing done -[alias] Skiping break; (doStmt not implemented) -[alias] Skiping break; (doStmt not implemented) -[alias] Skiping break; (doStmt not implemented) -[alias] Skiping break; (doStmt not implemented) +[alias] ANALYSING int *a = (int *)0; +[alias] ANALYSING int *b = (int *)0; +[alias] ANALYSING int *c = (int *)0; +[alias] ANALYSING int *d = (int *)0; +[alias] ANALYSING int e = 0; +[alias] ANALYSING case 1: a = d; +[alias] ANALYSING case 2: b = d; +[alias] ANALYSING __retres = 0; [alias] May-aliases at the end of function main: <list of may-alias> {a; b; d; } are aliased @@ -41,24 +45,6 @@ Before statement switch (e) { Before statement case 1: a = d; : <list of may-alias> -{a; b; d; } are aliased -{*a; *b; *d; } are aliased -<end of list> - -Before statement case 1: a = d; : - <list of may-alias> -{a; b; d; } are aliased -{*a; *b; *d; } are aliased -<end of list> - -Before statement case 1: a = d; : - <list of may-alias> -<end of list> - -Before statement break; : - <list of may-alias> -{a; b; d; } are aliased -{*a; *b; *d; } are aliased <end of list> Before statement break; : @@ -69,32 +55,12 @@ Before statement break; : Before statement case 2: b = d; : <list of may-alias> -{a; b; d; } are aliased -{*a; *b; *d; } are aliased -<end of list> - -Before statement case 2: b = d; : - <list of may-alias> -{a; b; d; } are aliased -{*a; *b; *d; } are aliased -<end of list> - -Before statement case 2: b = d; : - <list of may-alias> -{a; d; } are aliased -{*a; *d; } are aliased -<end of list> - -Before statement break; : - <list of may-alias> -{a; b; d; } are aliased -{*a; *b; *d; } are aliased <end of list> Before statement break; : <list of may-alias> -{a; b; d; } are aliased -{*a; *b; *d; } are aliased +{b; d; } are aliased +{*b; *d; } are aliased <end of list> Before statement __retres = 0; : diff --git a/src/plugins/alias/tests/basic/oracle/switch2.res.oracle b/src/plugins/alias/tests/basic/oracle/switch2.res.oracle index e4462bb403953b0c653165d21bed8c6b4e06835d..e710b245dc3bd37dd5f64f7c1fb46629f7cc95f4 100644 --- a/src/plugins/alias/tests/basic/oracle/switch2.res.oracle +++ b/src/plugins/alias/tests/basic/oracle/switch2.res.oracle @@ -1,9 +1,14 @@ [kernel] Parsing switch2.c (with preprocessing) [alias] Parsing done -[alias] Skiping break; (doStmt not implemented) -[alias] Skiping break; (doStmt not implemented) -[alias] Skiping break; (doStmt not implemented) -[alias] Skiping break; (doStmt not implemented) +[alias] ANALYSING int *a = (int *)0; +[alias] ANALYSING int *b = (int *)0; +[alias] ANALYSING int *c = (int *)0; +[alias] ANALYSING int *d = (int *)0; +[alias] ANALYSING int e = 0; +[alias] ANALYSING case 1: a = d; +[alias] ANALYSING case 2: b = d; +[alias] ANALYSING default: c = d; +[alias] ANALYSING __retres = 0; [alias] May-aliases at the end of function main: <list of may-alias> {a; b; c; d; } are aliased @@ -40,28 +45,10 @@ Before statement switch (e) { <list of may-alias> <end of list> -Before statement case 1: a = d; : - <list of may-alias> -{a; b; c; d; } are aliased -{*a; *b; *c; *d; } are aliased -<end of list> - -Before statement case 1: a = d; : - <list of may-alias> -{a; b; c; d; } are aliased -{*a; *b; *c; *d; } are aliased -<end of list> - Before statement case 1: a = d; : <list of may-alias> <end of list> -Before statement break; : - <list of may-alias> -{a; b; c; d; } are aliased -{*a; *b; *c; *d; } are aliased -<end of list> - Before statement break; : <list of may-alias> {a; d; } are aliased @@ -70,50 +57,16 @@ Before statement break; : Before statement case 2: b = d; : <list of may-alias> -{a; b; c; d; } are aliased -{*a; *b; *c; *d; } are aliased -<end of list> - -Before statement case 2: b = d; : - <list of may-alias> -{a; b; c; d; } are aliased -{*a; *b; *c; *d; } are aliased -<end of list> - -Before statement case 2: b = d; : - <list of may-alias> -{a; d; } are aliased -{*a; *d; } are aliased -<end of list> - -Before statement break; : - <list of may-alias> -{a; b; c; d; } are aliased -{*a; *b; *c; *d; } are aliased <end of list> Before statement break; : <list of may-alias> -{a; b; d; } are aliased -{*a; *b; *d; } are aliased -<end of list> - -Before statement default: c = d; : - <list of may-alias> -{a; b; c; d; } are aliased -{*a; *b; *c; *d; } are aliased -<end of list> - -Before statement default: c = d; : - <list of may-alias> -{a; b; c; d; } are aliased -{*a; *b; *c; *d; } are aliased +{b; d; } are aliased +{*b; *d; } are aliased <end of list> Before statement default: c = d; : <list of may-alias> -{a; b; d; } are aliased -{*a; *b; *d; } are aliased <end of list> Before statement __retres = 0; : diff --git a/src/plugins/alias/tests/basic/oracle/while_for1.res.oracle b/src/plugins/alias/tests/basic/oracle/while_for1.res.oracle index 08efe0061a7dbad374dd794e6b670e2355ea035a..50f84214cb75a552b205f36e258bb52e0ae0168a 100644 --- a/src/plugins/alias/tests/basic/oracle/while_for1.res.oracle +++ b/src/plugins/alias/tests/basic/oracle/while_for1.res.oracle @@ -1,9 +1,12 @@ [kernel] Parsing while_for1.c (with preprocessing) [alias] Parsing done -[alias] Skiping break; (doStmt not implemented) -[alias] Skiping break; (doStmt not implemented) -[alias] Skiping break; (doStmt not implemented) -[alias] Skiping break; (doStmt not implemented) +[alias] ANALYSING int *s = (int *)0; +[alias] ANALYSING int idx = 0; +[alias] ANALYSING s = (int *)malloc((size_t)idx); +[alias] ANALYSING idx ++; +[alias] ANALYSING s = (int *)malloc((size_t)idx); +[alias] ANALYSING idx ++; +[alias] ANALYSING __retres = 0; [alias] May-aliases at the end of function main: <list of may-alias> <end of list> @@ -26,10 +29,6 @@ Before statement int idx = 0; : <list of may-alias> <end of list> -Before statement int idx = 0; : - <list of may-alias> -<end of list> - Before statement while (idx < 10) { s = (int *)malloc((size_t)idx); idx ++; @@ -37,45 +36,14 @@ Before statement while (idx < 10) { <list of may-alias> <end of list> -Before statement while (idx < 10) { - s = (int *)malloc((size_t)idx); - idx ++; - } : - <list of may-alias> -<end of list> - -Before statement if (! (idx < 10)) break; : - <list of may-alias> -<end of list> - Before statement if (! (idx < 10)) break; : <list of may-alias> <end of list> -Before statement if (! (idx < 10)) break; : - <list of may-alias> -<end of list> - -Before statement break; : - <list of may-alias> -<end of list> - Before statement break; : <list of may-alias> <end of list> -Before statement break; : - <list of may-alias> -<end of list> - -Before statement break; : - <list of may-alias> -<end of list> - -Before statement s = (int *)malloc((size_t)idx); : - <list of may-alias> -<end of list> - Before statement s = (int *)malloc((size_t)idx); : <list of may-alias> <end of list> @@ -84,30 +52,6 @@ Before statement s = (int *)malloc((size_t)idx); : <list of may-alias> <end of list> -Before statement s = (int *)malloc((size_t)idx); : - <list of may-alias> -<end of list> - -Before statement s = (int *)malloc((size_t)idx); : - <list of may-alias> -<end of list> - -Before statement s = (int *)malloc((size_t)idx); : - <list of may-alias> -<end of list> - -Before statement s = (int *)malloc((size_t)idx); : - <list of may-alias> -<end of list> - -Before statement idx ++; : - <list of may-alias> -<end of list> - -Before statement idx ++; : - <list of may-alias> -<end of list> - Before statement idx ++; : <list of may-alias> <end of list> diff --git a/src/plugins/alias/tests/basic/oracle/while_for2.res.oracle b/src/plugins/alias/tests/basic/oracle/while_for2.res.oracle index 97b3ab043e4539aa8b0ab2f3b8140d47f3193254..1b99076a2e28d090b3c042c1db708351812f021d 100644 --- a/src/plugins/alias/tests/basic/oracle/while_for2.res.oracle +++ b/src/plugins/alias/tests/basic/oracle/while_for2.res.oracle @@ -1,15 +1,10 @@ [kernel] Parsing while_for2.c (with preprocessing) [alias] Parsing done -[alias] Skiping break; (doStmt not implemented) -[alias] Skiping break; (doStmt not implemented) -[alias] Skiping break; (doStmt not implemented) -[alias] Skiping break; - a = c; - break; (doStmt not implemented) -[alias] Skiping break; - a = c; - break; (doStmt not implemented) -[alias] Skiping break; (doStmt not implemented) +[alias] ANALYSING int *a = (int *)0; +[alias] ANALYSING int *b = (int *)0; +[alias] ANALYSING int *c = (int *)0; +[alias] ANALYSING a = b; +[alias] ANALYSING __retres = 0; [alias] May-aliases at the end of function main: <list of may-alias> {a; b; } are aliased @@ -44,25 +39,6 @@ Before statement while (1) { Before statement a = b; break; : <list of may-alias> -{a; b; } are aliased -{*a; *b; } are aliased -<end of list> - -Before statement a = b; - break; : - <list of may-alias> -<end of list> - -Before statement a = b; : - <list of may-alias> -{a; b; } are aliased -{*a; *b; } are aliased -<end of list> - -Before statement a = b; : - <list of may-alias> -{a; b; } are aliased -{*a; *b; } are aliased <end of list> Before statement a = b; : @@ -75,18 +51,6 @@ Before statement break; : {*a; *b; } are aliased <end of list> -Before statement break; : - <list of may-alias> -{a; b; } are aliased -{*a; *b; } are aliased -<end of list> - -Before statement break; : - <list of may-alias> -{a; b; } are aliased -{*a; *b; } are aliased -<end of list> - Before statement while (1) { break; a = c; @@ -105,14 +69,6 @@ Before statement break; {*a; *b; } are aliased <end of list> -Before statement break; - a = c; - break; : - <list of may-alias> -{a; b; } are aliased -{*a; *b; } are aliased -<end of list> - Before statement break; : <list of may-alias> {a; b; } are aliased diff --git a/src/plugins/alias/tests/basic/oracle/while_for3.res.oracle b/src/plugins/alias/tests/basic/oracle/while_for3.res.oracle index f5011d5713080fd4ba7147adf22169ab323f5f00..4be257482573694baca3d06e3b9970b7082a280c 100644 --- a/src/plugins/alias/tests/basic/oracle/while_for3.res.oracle +++ b/src/plugins/alias/tests/basic/oracle/while_for3.res.oracle @@ -1,24 +1,36 @@ [kernel] Parsing while_for3.c (with preprocessing) [alias] Parsing done -[alias] Skiping break; (doStmt not implemented) -[alias] Skiping goto __Cont; (doStmt not implemented) -[alias] Skiping break; (doStmt not implemented) -[alias] Skiping goto __Cont; (doStmt not implemented) -[alias] Skiping break; (doStmt not implemented) -[alias] Skiping goto __Cont; (doStmt not implemented) -[alias] Skiping goto __Cont; (doStmt not implemented) -[alias] Skiping goto __Cont; (doStmt not implemented) -[alias] Skiping break; (doStmt not implemented) +[alias] ANALYSING int *a = (int *)0; +[alias] ANALYSING int *b = (int *)0; +[alias] ANALYSING int *c = (int *)0; +[alias] ANALYSING int i = 0; +[alias] ANALYSING a = b; +[alias] ANALYSING __Cont: i ++; +[alias] ANALYSING a = b; +[alias] ANALYSING __Cont: i ++; +[alias] ANALYSING __retres = 0; [alias] May-aliases at the end of function main: <list of may-alias> - {a; b; c; } are aliased - {*a; *b; *c; } are aliased + {a; b; } are aliased + {*a; *b; } are aliased <end of list> [alias] Functions done +Before statement __retres = 0; : + <list of may-alias> +{a; b; } are aliased +{*a; *b; } are aliased +<end of list> + Before statement int *a = (int *)0; : <list of may-alias> <end of list> +Before statement return __retres; : + <list of may-alias> +{a; b; } are aliased +{*a; *b; } are aliased +<end of list> + Before statement int *b = (int *)0; : <list of may-alias> <end of list> @@ -41,23 +53,6 @@ Before statement { Before statement int i = 0; : <list of may-alias> -{a; b; c; } are aliased -{*a; *b; *c; } are aliased -<end of list> - -Before statement int i = 0; : - <list of may-alias> -<end of list> - -Before statement while (i < 10) { - a = b; - goto __Cont; - a = c; - __Cont: i ++; - } : - <list of may-alias> -{a; b; c; } are aliased -{*a; *b; *c; } are aliased <end of list> Before statement while (i < 10) { @@ -67,165 +62,44 @@ Before statement while (i < 10) { __Cont: i ++; } : <list of may-alias> +{a; b; } are aliased +{*a; *b; } are aliased <end of list> Before statement if (! (i < 10)) break; : <list of may-alias> -{a; b; c; } are aliased -{*a; *b; *c; } are aliased -<end of list> - -Before statement if (! (i < 10)) break; : - <list of may-alias> -{a; b; c; } are aliased -{*a; *b; *c; } are aliased -<end of list> - -Before statement if (! (i < 10)) break; : - <list of may-alias> -<end of list> - -Before statement break; : - <list of may-alias> -{a; b; c; } are aliased -{*a; *b; *c; } are aliased -<end of list> - -Before statement break; : - <list of may-alias> -{a; b; c; } are aliased -{*a; *b; *c; } are aliased -<end of list> - -Before statement break; : - <list of may-alias> -{a; b; c; } are aliased -{*a; *b; *c; } are aliased +{a; b; } are aliased +{*a; *b; } are aliased <end of list> Before statement break; : <list of may-alias> +{a; b; } are aliased +{*a; *b; } are aliased <end of list> Before statement a = b; goto __Cont; a = c; : <list of may-alias> -{a; b; c; } are aliased -{*a; *b; *c; } are aliased -<end of list> - -Before statement a = b; - goto __Cont; - a = c; : - <list of may-alias> -{a; b; c; } are aliased -{*a; *b; *c; } are aliased -<end of list> - -Before statement a = b; - goto __Cont; - a = c; : - <list of may-alias> -<end of list> - -Before statement a = b; - goto __Cont; : - <list of may-alias> -{a; b; c; } are aliased -{*a; *b; *c; } are aliased -<end of list> - -Before statement a = b; - goto __Cont; : - <list of may-alias> -{a; b; c; } are aliased -{*a; *b; *c; } are aliased -<end of list> - -Before statement a = b; - goto __Cont; : - <list of may-alias> -{a; b; c; } are aliased -{*a; *b; *c; } are aliased +{a; b; } are aliased +{*a; *b; } are aliased <end of list> Before statement a = b; goto __Cont; : <list of may-alias> +{a; b; } are aliased +{*a; *b; } are aliased <end of list> Before statement a = b; : <list of may-alias> -{a; b; c; } are aliased -{*a; *b; *c; } are aliased -<end of list> - -Before statement a = b; : - <list of may-alias> -{a; b; c; } are aliased -{*a; *b; *c; } are aliased -<end of list> - -Before statement a = b; : - <list of may-alias> -{a; b; c; } are aliased -{*a; *b; *c; } are aliased -<end of list> - -Before statement a = b; : - <list of may-alias> -{a; b; c; } are aliased -{*a; *b; *c; } are aliased -<end of list> - -Before statement a = b; : - <list of may-alias> -<end of list> - -Before statement goto __Cont; : - <list of may-alias> -{a; b; c; } are aliased -{*a; *b; *c; } are aliased -<end of list> - -Before statement goto __Cont; : - <list of may-alias> -{a; b; c; } are aliased -{*a; *b; *c; } are aliased -<end of list> - -Before statement goto __Cont; : - <list of may-alias> -{a; b; c; } are aliased -{*a; *b; *c; } are aliased -<end of list> - -Before statement goto __Cont; : - <list of may-alias> -{a; b; c; } are aliased -{*a; *b; *c; } are aliased -<end of list> - -Before statement goto __Cont; : - <list of may-alias> {a; b; } are aliased {*a; *b; } are aliased <end of list> -Before statement a = c; : - <list of may-alias> -{a; b; c; } are aliased -{*a; *b; *c; } are aliased -<end of list> - -Before statement a = c; : - <list of may-alias> -{a; b; c; } are aliased -{*a; *b; *c; } are aliased -<end of list> - -Before statement a = c; : +Before statement goto __Cont; : <list of may-alias> {a; b; } are aliased {*a; *b; } are aliased @@ -233,32 +107,8 @@ Before statement a = c; : Before statement __Cont: i ++; : <list of may-alias> -{a; b; c; } are aliased -{*a; *b; *c; } are aliased -<end of list> - -Before statement __Cont: i ++; : - <list of may-alias> -{a; b; c; } are aliased -{*a; *b; *c; } are aliased -<end of list> - -Before statement __Cont: i ++; : - <list of may-alias> -{a; b; c; } are aliased -{*a; *b; *c; } are aliased -<end of list> - -Before statement __retres = 0; : - <list of may-alias> -{a; b; c; } are aliased -{*a; *b; *c; } are aliased -<end of list> - -Before statement return __retres; : - <list of may-alias> -{a; b; c; } are aliased -{*a; *b; *c; } are aliased +{a; b; } are aliased +{*a; *b; } are aliased <end of list> [alias] Analysis complete diff --git a/src/plugins/alias/tests/basic/while_for3.c b/src/plugins/alias/tests/basic/while_for3.c index 0e60b5be18ea545fcf57cbd114c82b67fe3b7aef..8bbd9d968a4a4788e7b4235e81e64e1956a71aa1 100644 --- a/src/plugins/alias/tests/basic/while_for3.c +++ b/src/plugins/alias/tests/basic/while_for3.c @@ -6,7 +6,7 @@ int main () { int *a=0, *b=0, *c=0; for (int i=0; i<10 ;i++) { - if (1){ + if (1) { a = b; continue; } diff --git a/src/plugins/alias/tests/real_world/oracle/example1.res.oracle b/src/plugins/alias/tests/real_world/oracle/example1.res.oracle index 66054e3491623e6688ec65b6fbae0cef0672ede3..acffaafc5c3beeb7c5ca521b258882fa79296124 100644 --- a/src/plugins/alias/tests/real_world/oracle/example1.res.oracle +++ b/src/plugins/alias/tests/real_world/oracle/example1.res.oracle @@ -1,885 +1,171 @@ [kernel] Parsing example1.c (with preprocessing) [alias] Parsing done +[alias] ANALYSING ty *tmp = x; +[alias] ANALYSING idata = (double *)malloc((unsigned long)10 * sizeof(double)); +[alias] ANALYSING idata = tmp->t2[*(tmp->n2)]; [alias] Skipping assignment idata = tmp->t2[*(tmp->n2)] (not implemented) +[alias] ANALYSING odata = tmp->t1[*(tmp->n1)]; [alias] Skipping assignment odata = tmp->t1[*(tmp->n1)] (not implemented) -[alias] Skiping break; (doStmt not implemented) -[alias] Skiping tmp_1 = sin(*(idata + idx)); - *(odata + idx) = 0.5 * tmp_1; (doStmt not implemented) -[alias] DEBUG: call function - formal variable not as we expected -[alias] Skipping assignment idata = tmp->t2[*(tmp->n2)] (not implemented) -[alias] Skipping assignment odata = tmp->t1[*(tmp->n1)] (not implemented) -[alias] Skiping break; (doStmt not implemented) -[alias] Skiping tmp_1 = sin(*(idata + idx)); - *(odata + idx) = 0.5 * tmp_1; (doStmt not implemented) -[alias] DEBUG: call function - formal variable not as we expected -[alias] Skipping assignment idata = tmp->t2[*(tmp->n2)] (not implemented) -[alias] Skipping assignment idata = tmp->t2[*(tmp->n2)] (not implemented) -[alias] Skipping assignment odata = tmp->t1[*(tmp->n1)] (not implemented) -[alias] Skipping assignment odata = tmp->t1[*(tmp->n1)] (not implemented) -[alias] Skiping break; (doStmt not implemented) -[alias] Skiping tmp_1 = sin(*(idata + idx)); - *(odata + idx) = 0.5 * tmp_1; (doStmt not implemented) -[alias] Skiping break; (doStmt not implemented) -[alias] Skiping tmp_1 = sin(*(idata + idx)); - *(odata + idx) = 0.5 * tmp_1; (doStmt not implemented) -[alias] Skiping tmp_1 = sin(*(idata + idx)); - *(odata + idx) = 0.5 * tmp_1; (doStmt not implemented) +[alias] ANALYSING idx = 0; +[alias] ANALYSING tmp_1 = sin(*(idata + idx)); [alias] In a function call, parameter (x <- *(idata + idx)) is ignored) [alias] Warning: a function with no return is employed in an assignment +[alias] ANALYSING *(odata + idx) = 0.5 * tmp_1; +[alias] Skipping assignment *(odata + idx) = 0.5 * tmp_1 (BUG do_assignment 2) +[alias] ANALYSING idx ++; +[alias] ANALYSING tmp_1 = sin(*(idata + idx)); [alias] In a function call, parameter (x <- *(idata + idx)) is ignored) [alias] Warning: a function with no return is employed in an assignment +[alias] ANALYSING *(odata + idx) = 0.5 * tmp_1; [alias] Skipping assignment *(odata + idx) = 0.5 * tmp_1 (BUG do_assignment 2) -[alias] Skipping assignment *(odata + idx) = 0.5 * tmp_1 (BUG do_assignment 2) -[alias] Skiping break; (doStmt not implemented) -[alias] DEBUG: call function - formal variable not as we expected +[alias] ANALYSING idx ++; +[alias] ANALYSING swap(tmp->n1); +[alias] ANALYSING *n = 0; +[alias] ANALYSING (*n) ++; [alias] DEBUG: call function - formal variable not as we expected +[alias] ANALYSING idata = tmp->t2[*(tmp->n2)]; [alias] Skipping assignment idata = tmp->t2[*(tmp->n2)] (not implemented) +[alias] ANALYSING odata = tmp->t1[*(tmp->n1)]; [alias] Skipping assignment odata = tmp->t1[*(tmp->n1)] (not implemented) -[alias] Skiping break; (doStmt not implemented) -[alias] Skiping tmp_1 = sin(*(idata + idx)); - *(odata + idx) = 0.5 * tmp_1; (doStmt not implemented) +[alias] ANALYSING idx = 0; +[alias] ANALYSING tmp_1 = sin(*(idata + idx)); +[alias] In a function call, parameter (x <- *(idata + idx)) is ignored) +[alias] Warning: a function with no return is employed in an assignment +[alias] ANALYSING *(odata + idx) = 0.5 * tmp_1; +[alias] Skipping assignment *(odata + idx) = 0.5 * tmp_1 (BUG do_assignment 2) +[alias] ANALYSING idx ++; +[alias] ANALYSING swap(tmp->n1); [alias] DEBUG: call function - formal variable not as we expected [alias] Warning: DEBUG return stmt of f1 not in table [alias] Warning: Analysis is continuing but will not be sound +[alias] ANALYSING ty *tmp = x; +[alias] ANALYSING idata = (double *)malloc((unsigned long)10 * sizeof(double)); +[alias] ANALYSING idata = tmp->t1[*(tmp->n1)]; [alias] Skipping assignment idata = tmp->t1[*(tmp->n1)] (not implemented) +[alias] ANALYSING odata = tmp->t2[*(tmp->n2)]; [alias] Skipping assignment odata = tmp->t2[*(tmp->n2)] (not implemented) -[alias] Skiping break; (doStmt not implemented) -[alias] Skipping assignment *(odata + idx) = (double)3 * *(idata + idx) + (double)1 (BUG do_assignment 2) -[alias] DEBUG: call function - formal variable not as we expected -[alias] Skipping assignment idata = tmp->t1[*(tmp->n1)] (not implemented) -[alias] Skipping assignment odata = tmp->t2[*(tmp->n2)] (not implemented) -[alias] Skiping break; (doStmt not implemented) -[alias] Skipping assignment *(odata + idx) = (double)3 * *(idata + idx) + (double)1 (BUG do_assignment 2) -[alias] DEBUG: call function - formal variable not as we expected -[alias] Skipping assignment idata = tmp->t1[*(tmp->n1)] (not implemented) -[alias] Skipping assignment idata = tmp->t1[*(tmp->n1)] (not implemented) -[alias] Skipping assignment odata = tmp->t2[*(tmp->n2)] (not implemented) -[alias] Skipping assignment odata = tmp->t2[*(tmp->n2)] (not implemented) -[alias] Skiping break; (doStmt not implemented) +[alias] ANALYSING idx = 0; +[alias] ANALYSING *(odata + idx) = (double)3 * *(idata + idx) + (double)1; [alias] Skipping assignment *(odata + idx) = (double)3 * *(idata + idx) + (double)1 (BUG do_assignment 2) -[alias] Skiping break; (doStmt not implemented) +[alias] ANALYSING idx ++; +[alias] ANALYSING *(odata + idx) = (double)3 * *(idata + idx) + (double)1; [alias] Skipping assignment *(odata + idx) = (double)3 * *(idata + idx) + (double)1 (BUG do_assignment 2) -[alias] Skipping assignment *(odata + idx) = (double)3 * *(idata + idx) + (double)1 (BUG do_assignment 2) -[alias] Skipping assignment *(odata + idx) = (double)3 * *(idata + idx) + (double)1 (BUG do_assignment 2) -[alias] Skiping break; (doStmt not implemented) -[alias] DEBUG: call function - formal variable not as we expected +[alias] ANALYSING idx ++; +[alias] ANALYSING swap(tmp->n2); [alias] DEBUG: call function - formal variable not as we expected +[alias] ANALYSING idata = tmp->t1[*(tmp->n1)]; [alias] Skipping assignment idata = tmp->t1[*(tmp->n1)] (not implemented) +[alias] ANALYSING odata = tmp->t2[*(tmp->n2)]; [alias] Skipping assignment odata = tmp->t2[*(tmp->n2)] (not implemented) -[alias] Skiping break; (doStmt not implemented) +[alias] ANALYSING idx = 0; +[alias] ANALYSING *(odata + idx) = (double)3 * *(idata + idx) + (double)1; [alias] Skipping assignment *(odata + idx) = (double)3 * *(idata + idx) + (double)1 (BUG do_assignment 2) +[alias] ANALYSING idx ++; +[alias] ANALYSING swap(tmp->n2); [alias] DEBUG: call function - formal variable not as we expected [alias] Warning: DEBUG return stmt of f2 not in table [alias] Warning: Analysis is continuing but will not be sound -[alias] Skiping break; (doStmt not implemented) -[alias] Skipping assignment a->t1[i] = malloc() (not implemented) -[alias] Skipping assignment a->t2[i] = malloc() (not implemented) -[alias] Skiping break; (doStmt not implemented) -[alias] Skipping assignment a->t1[i] = malloc() (not implemented) -[alias] Skipping assignment a->t2[i] = malloc() (not implemented) -[alias] Skipping assignment a->t1[i] = malloc() (not implemented) +[alias] ANALYSING a = (ty *)malloc(sizeof(ty)); +[alias] ANALYSING b = (ty *)malloc(sizeof(ty)); +[alias] ANALYSING i = 0; +[alias] ANALYSING a->t1[i] = (double *)malloc((unsigned long)10 * sizeof(double)); [alias] Skipping assignment a->t1[i] = malloc() (not implemented) +[alias] ANALYSING a->t2[i] = (double *)malloc((unsigned long)10 * sizeof(double)); [alias] Skipping assignment a->t2[i] = malloc() (not implemented) -[alias] Skipping assignment a->t2[i] = malloc() (not implemented) -[alias] Skiping break; (doStmt not implemented) +[alias] ANALYSING i ++; +[alias] ANALYSING a->t1[i] = (double *)malloc((unsigned long)10 * sizeof(double)); [alias] Skipping assignment a->t1[i] = malloc() (not implemented) +[alias] ANALYSING a->t2[i] = (double *)malloc((unsigned long)10 * sizeof(double)); [alias] Skipping assignment a->t2[i] = malloc() (not implemented) -[alias] Skiping break; (doStmt not implemented) -[alias] Skipping assignment a->n1 = malloc() (not implemented) +[alias] ANALYSING i ++; +[alias] ANALYSING a->n1 = (int *)malloc(sizeof(int)); [alias] Skipping assignment a->n1 = malloc() (not implemented) +[alias] ANALYSING a->n2 = (int *)malloc(sizeof(int)); [alias] Skipping assignment a->n2 = malloc() (not implemented) -[alias] Skipping assignment a->n2 = malloc() (not implemented) -[alias] Skiping break; (doStmt not implemented) -[alias] Skipping assignment b->t1[i] = a->t1[i] (not implemented) -[alias] Skipping assignment b->t2[i] = a->t2[i] (not implemented) -[alias] Skiping break; (doStmt not implemented) -[alias] Skipping assignment b->t1[i] = a->t1[i] (not implemented) -[alias] Skipping assignment b->t2[i] = a->t2[i] (not implemented) -[alias] Skipping assignment b->t1[i] = a->t1[i] (not implemented) +[alias] ANALYSING *(a->n1) = 1; +[alias] ANALYSING *(a->n2) = 1; +[alias] ANALYSING i = 0; +[alias] ANALYSING b->t1[i] = a->t1[i]; [alias] Skipping assignment b->t1[i] = a->t1[i] (not implemented) +[alias] ANALYSING b->t2[i] = a->t2[i]; [alias] Skipping assignment b->t2[i] = a->t2[i] (not implemented) -[alias] Skipping assignment b->t2[i] = a->t2[i] (not implemented) -[alias] Skiping break; (doStmt not implemented) -[alias] Skipping assignment b->n1 = a->n1 (not implemented) +[alias] ANALYSING i ++; +[alias] ANALYSING b->n1 = a->n1; [alias] Skipping assignment b->n1 = a->n1 (not implemented) +[alias] ANALYSING b->n2 = a->n2; [alias] Skipping assignment b->n2 = a->n2 (not implemented) -[alias] Skipping assignment b->n2 = a->n2 (not implemented) +[alias] ANALYSING f1(a); +[alias] ANALYSING f2(b); +[alias] ANALYSING __retres = 0; [alias] May-aliases at the end of function main: <list of may-alias> <end of list> [alias] Functions done -Before statement if (*n == 1) *n = 0; else (*n) ++; : - <list of may-alias> -<end of list> - -Before statement if (*n == 1) *n = 0; else (*n) ++; : - <list of may-alias> -<end of list> - -Before statement *n = 0; : - <list of may-alias> -<end of list> - -Before statement *n = 0; : - <list of may-alias> -<end of list> - -Before statement *n = 0; : - <list of may-alias> -<end of list> - -Before statement (*n) ++; : - <list of may-alias> -<end of list> - -Before statement (*n) ++; : - <list of may-alias> -<end of list> - -Before statement (*n) ++; : - <list of may-alias> -<end of list> - -Before statement ty *tmp = x; : - <list of may-alias> -<end of list> - -Before statement idata = (double *)malloc((unsigned long)10 * sizeof(double)); : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement while (1) { - idata = tmp->t2[*(tmp->n2)]; - odata = tmp->t1[*(tmp->n1)]; - idx = 0; - while (idx < 10) { - { - double tmp_1; - tmp_1 = sin(*(idata + idx)); - *(odata + idx) = 0.5 * tmp_1; - } - idx ++; - } - swap(tmp->n1); - } : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement while (1) { - idata = tmp->t2[*(tmp->n2)]; - odata = tmp->t1[*(tmp->n1)]; - idx = 0; - while (idx < 10) { - { - double tmp_1; - tmp_1 = sin(*(idata + idx)); - *(odata + idx) = 0.5 * tmp_1; - } - idx ++; - } - swap(tmp->n1); - } : +Before statement b->t1[i] = a->t1[i]; : <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased <end of list> -Before statement idata = tmp->t2[*(tmp->n2)]; - odata = tmp->t1[*(tmp->n1)]; - idx = 0; - while (idx < 10) { - { - double tmp_1; - tmp_1 = sin(*(idata + idx)); - *(odata + idx) = 0.5 * tmp_1; - } - idx ++; - } - swap(tmp->n1); : +Before statement idx = 0; : <list of may-alias> {x; tmp; } are aliased {*x; *tmp; } are aliased <end of list> -Before statement idata = tmp->t2[*(tmp->n2)]; - odata = tmp->t1[*(tmp->n1)]; - idx = 0; - while (idx < 10) { - { - double tmp_1; - tmp_1 = sin(*(idata + idx)); - *(odata + idx) = 0.5 * tmp_1; - } - idx ++; - } - swap(tmp->n1); : +Before statement b->t2[i] = a->t2[i]; : <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased <end of list> -Before statement idata = tmp->t2[*(tmp->n2)]; - odata = tmp->t1[*(tmp->n1)]; - idx = 0; - while (idx < 10) { - { - double tmp_1; - tmp_1 = sin(*(idata + idx)); - *(odata + idx) = 0.5 * tmp_1; - } +Before statement while (idx < 10) { + *(odata + idx) = (double)3 * *(idata + idx) + (double)1; idx ++; - } - swap(tmp->n1); : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement idata = tmp->t2[*(tmp->n2)]; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement idata = tmp->t2[*(tmp->n2)]; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement idata = tmp->t2[*(tmp->n2)]; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement idata = tmp->t2[*(tmp->n2)]; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement odata = tmp->t1[*(tmp->n1)]; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement odata = tmp->t1[*(tmp->n1)]; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement odata = tmp->t1[*(tmp->n1)]; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement odata = tmp->t1[*(tmp->n1)]; : + } : <list of may-alias> {x; tmp; } are aliased {*x; *tmp; } are aliased <end of list> -Before statement idx = 0; : +Before statement if (*n == 1) *n = 0; else (*n) ++; : <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased <end of list> -Before statement idx = 0; : +Before statement i ++; : <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased <end of list> -Before statement idx = 0; : +Before statement if (*n == 1) *n = 0; else (*n) ++; : <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased <end of list> -Before statement idx = 0; : +Before statement b->n1 = a->n1; : <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased <end of list> -Before statement while (idx < 10) { - { - double tmp_1; - tmp_1 = sin(*(idata + idx)); - *(odata + idx) = 0.5 * tmp_1; - } - idx ++; - } : +Before statement if (! (idx < 10)) break; : <list of may-alias> {x; tmp; } are aliased {*x; *tmp; } are aliased <end of list> -Before statement while (idx < 10) { - { - double tmp_1; - tmp_1 = sin(*(idata + idx)); - *(odata + idx) = 0.5 * tmp_1; - } - idx ++; - } : +Before statement *n = 0; : <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased <end of list> -Before statement while (idx < 10) { - { - double tmp_1; - tmp_1 = sin(*(idata + idx)); - *(odata + idx) = 0.5 * tmp_1; - } - idx ++; - } : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement while (idx < 10) { - { - double tmp_1; - tmp_1 = sin(*(idata + idx)); - *(odata + idx) = 0.5 * tmp_1; - } - idx ++; - } : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement if (! (idx < 10)) break; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement if (! (idx < 10)) break; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement if (! (idx < 10)) break; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement if (! (idx < 10)) break; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement if (! (idx < 10)) break; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement break; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement break; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement break; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement break; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement break; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement break; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement { - double tmp_1; - tmp_1 = sin(*(idata + idx)); - *(odata + idx) = 0.5 * tmp_1; - } : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement { - double tmp_1; - tmp_1 = sin(*(idata + idx)); - *(odata + idx) = 0.5 * tmp_1; - } : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement { - double tmp_1; - tmp_1 = sin(*(idata + idx)); - *(odata + idx) = 0.5 * tmp_1; - } : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement { - double tmp_1; - tmp_1 = sin(*(idata + idx)); - *(odata + idx) = 0.5 * tmp_1; - } : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement { - double tmp_1; - tmp_1 = sin(*(idata + idx)); - *(odata + idx) = 0.5 * tmp_1; - } : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement tmp_1 = sin(*(idata + idx)); - *(odata + idx) = 0.5 * tmp_1; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement tmp_1 = sin(*(idata + idx)); - *(odata + idx) = 0.5 * tmp_1; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement tmp_1 = sin(*(idata + idx)); - *(odata + idx) = 0.5 * tmp_1; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement tmp_1 = sin(*(idata + idx)); - *(odata + idx) = 0.5 * tmp_1; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement tmp_1 = sin(*(idata + idx)); - *(odata + idx) = 0.5 * tmp_1; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement tmp_1 = sin(*(idata + idx)); - *(odata + idx) = 0.5 * tmp_1; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement tmp_1 = sin(*(idata + idx)); : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement *(odata + idx) = 0.5 * tmp_1; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement idx ++; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement idx ++; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement idx ++; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement idx ++; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement idx ++; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement swap(tmp->n1); : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement swap(tmp->n1); : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement swap(tmp->n1); : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement swap(tmp->n1); : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement ty *tmp = x; : - <list of may-alias> -<end of list> - -Before statement idata = (double *)malloc((unsigned long)10 * sizeof(double)); : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement while (1) { - idata = tmp->t1[*(tmp->n1)]; - odata = tmp->t2[*(tmp->n2)]; - idx = 0; - while (idx < 10) { - *(odata + idx) = (double)3 * *(idata + idx) + (double)1; - idx ++; - } - swap(tmp->n2); - } : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement while (1) { - idata = tmp->t1[*(tmp->n1)]; - odata = tmp->t2[*(tmp->n2)]; - idx = 0; - while (idx < 10) { - *(odata + idx) = (double)3 * *(idata + idx) + (double)1; - idx ++; - } - swap(tmp->n2); - } : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement idata = tmp->t1[*(tmp->n1)]; - odata = tmp->t2[*(tmp->n2)]; - idx = 0; - while (idx < 10) { - *(odata + idx) = (double)3 * *(idata + idx) + (double)1; - idx ++; - } - swap(tmp->n2); : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement idata = tmp->t1[*(tmp->n1)]; - odata = tmp->t2[*(tmp->n2)]; - idx = 0; - while (idx < 10) { - *(odata + idx) = (double)3 * *(idata + idx) + (double)1; - idx ++; - } - swap(tmp->n2); : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement idata = tmp->t1[*(tmp->n1)]; - odata = tmp->t2[*(tmp->n2)]; - idx = 0; - while (idx < 10) { - *(odata + idx) = (double)3 * *(idata + idx) + (double)1; - idx ++; - } - swap(tmp->n2); : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement idata = tmp->t1[*(tmp->n1)]; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement idata = tmp->t1[*(tmp->n1)]; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement idata = tmp->t1[*(tmp->n1)]; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement idata = tmp->t1[*(tmp->n1)]; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement odata = tmp->t2[*(tmp->n2)]; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement odata = tmp->t2[*(tmp->n2)]; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement odata = tmp->t2[*(tmp->n2)]; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement odata = tmp->t2[*(tmp->n2)]; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement idx = 0; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement idx = 0; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement idx = 0; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement idx = 0; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement while (idx < 10) { - *(odata + idx) = (double)3 * *(idata + idx) + (double)1; - idx ++; - } : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement while (idx < 10) { - *(odata + idx) = (double)3 * *(idata + idx) + (double)1; - idx ++; - } : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement while (idx < 10) { - *(odata + idx) = (double)3 * *(idata + idx) + (double)1; - idx ++; - } : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement while (idx < 10) { - *(odata + idx) = (double)3 * *(idata + idx) + (double)1; - idx ++; - } : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement if (! (idx < 10)) break; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement if (! (idx < 10)) break; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement if (! (idx < 10)) break; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement if (! (idx < 10)) break; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement if (! (idx < 10)) break; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement break; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement break; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement break; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement break; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement break; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement break; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement *(odata + idx) = (double)3 * *(idata + idx) + (double)1; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement *(odata + idx) = (double)3 * *(idata + idx) + (double)1; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement *(odata + idx) = (double)3 * *(idata + idx) + (double)1; : - <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased -<end of list> - -Before statement *(odata + idx) = (double)3 * *(idata + idx) + (double)1; : +Before statement b->n2 = a->n2; : <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased <end of list> -Before statement *(odata + idx) = (double)3 * *(idata + idx) + (double)1; : +Before statement break; : <list of may-alias> {x; tmp; } are aliased {*x; *tmp; } are aliased <end of list> -Before statement *(odata + idx) = (double)3 * *(idata + idx) + (double)1; : +Before statement (*n) ++; : <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased <end of list> -Before statement *(odata + idx) = (double)3 * *(idata + idx) + (double)1; : +Before statement f1(a); : <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased <end of list> Before statement *(odata + idx) = (double)3 * *(idata + idx) + (double)1; : @@ -888,10 +174,8 @@ Before statement *(odata + idx) = (double)3 * *(idata + idx) + (double)1; : {*x; *tmp; } are aliased <end of list> -Before statement *(odata + idx) = (double)3 * *(idata + idx) + (double)1; : +Before statement f2(b); : <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased <end of list> Before statement *(odata + idx) = (double)3 * *(idata + idx) + (double)1; : @@ -900,10 +184,8 @@ Before statement *(odata + idx) = (double)3 * *(idata + idx) + (double)1; : {*x; *tmp; } are aliased <end of list> -Before statement *(odata + idx) = (double)3 * *(idata + idx) + (double)1; : +Before statement __retres = 0; : <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased <end of list> Before statement idx ++; : @@ -912,72 +194,90 @@ Before statement idx ++; : {*x; *tmp; } are aliased <end of list> -Before statement idx ++; : +Before statement ty *tmp = x; : <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased <end of list> -Before statement idx ++; : +Before statement swap(tmp->n2); : <list of may-alias> {x; tmp; } are aliased {*x; *tmp; } are aliased <end of list> -Before statement idx ++; : +Before statement idata = (double *)malloc((unsigned long)10 * sizeof(double)); : <list of may-alias> {x; tmp; } are aliased {*x; *tmp; } are aliased <end of list> -Before statement idx ++; : +Before statement return; : <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased <end of list> -Before statement swap(tmp->n2); : +Before statement while (1) { + idata = tmp->t2[*(tmp->n2)]; + odata = tmp->t1[*(tmp->n1)]; + idx = 0; + while (idx < 10) { + { + double tmp_1; + tmp_1 = sin(*(idata + idx)); + *(odata + idx) = 0.5 * tmp_1; + } + idx ++; + } + swap(tmp->n1); + } : <list of may-alias> {x; tmp; } are aliased {*x; *tmp; } are aliased <end of list> -Before statement swap(tmp->n2); : +Before statement idata = tmp->t2[*(tmp->n2)]; + odata = tmp->t1[*(tmp->n1)]; + idx = 0; + while (idx < 10) { + { + double tmp_1; + tmp_1 = sin(*(idata + idx)); + *(odata + idx) = 0.5 * tmp_1; + } + idx ++; + } + swap(tmp->n1); : <list of may-alias> {x; tmp; } are aliased {*x; *tmp; } are aliased <end of list> -Before statement swap(tmp->n2); : +Before statement a = (ty *)malloc(sizeof(ty)); : <list of may-alias> -{x; tmp; } are aliased -{*x; *tmp; } are aliased <end of list> -Before statement swap(tmp->n2); : +Before statement idata = tmp->t2[*(tmp->n2)]; : <list of may-alias> {x; tmp; } are aliased {*x; *tmp; } are aliased <end of list> -Before statement a = (ty *)malloc(sizeof(ty)); : +Before statement b = (ty *)malloc(sizeof(ty)); : <list of may-alias> <end of list> -Before statement b = (ty *)malloc(sizeof(ty)); : +Before statement odata = tmp->t1[*(tmp->n1)]; : <list of may-alias> +{x; tmp; } are aliased +{*x; *tmp; } are aliased <end of list> Before statement i = 0; : <list of may-alias> <end of list> -Before statement while (i < 2) { - a->t1[i] = (double *)malloc((unsigned long)10 * sizeof(double)); - a->t2[i] = (double *)malloc((unsigned long)10 * sizeof(double)); - i ++; - } : +Before statement idx = 0; : <list of may-alias> +{x; tmp; } are aliased +{*x; *tmp; } are aliased <end of list> Before statement while (i < 2) { @@ -988,11 +288,20 @@ Before statement while (i < 2) { <list of may-alias> <end of list> -Before statement if (! (i < 2)) break; : +Before statement while (idx < 10) { + { + double tmp_1; + tmp_1 = sin(*(idata + idx)); + *(odata + idx) = 0.5 * tmp_1; + } + idx ++; + } : <list of may-alias> +{x; tmp; } are aliased +{*x; *tmp; } are aliased <end of list> -Before statement if (! (i < 2)) break; : +Before statement return __retres; : <list of may-alias> <end of list> @@ -1000,12 +309,10 @@ Before statement if (! (i < 2)) break; : <list of may-alias> <end of list> -Before statement break; : - <list of may-alias> -<end of list> - -Before statement break; : +Before statement if (! (idx < 10)) break; : <list of may-alias> +{x; tmp; } are aliased +{*x; *tmp; } are aliased <end of list> Before statement break; : @@ -1014,6 +321,8 @@ Before statement break; : Before statement break; : <list of may-alias> +{x; tmp; } are aliased +{*x; *tmp; } are aliased <end of list> Before statement a->t1[i] = (double *)malloc((unsigned long)10 * sizeof(double)); @@ -1021,66 +330,65 @@ Before statement a->t1[i] = (double *)malloc((unsigned long)10 * sizeof(double)) <list of may-alias> <end of list> -Before statement a->t1[i] = (double *)malloc((unsigned long)10 * sizeof(double)); - a->t2[i] = (double *)malloc((unsigned long)10 * sizeof(double)); : - <list of may-alias> -<end of list> - -Before statement a->t1[i] = (double *)malloc((unsigned long)10 * sizeof(double)); - a->t2[i] = (double *)malloc((unsigned long)10 * sizeof(double)); : - <list of may-alias> -<end of list> - -Before statement a->t1[i] = (double *)malloc((unsigned long)10 * sizeof(double)); : - <list of may-alias> -<end of list> - -Before statement a->t1[i] = (double *)malloc((unsigned long)10 * sizeof(double)); : - <list of may-alias> -<end of list> - -Before statement a->t1[i] = (double *)malloc((unsigned long)10 * sizeof(double)); : +Before statement { + double tmp_1; + tmp_1 = sin(*(idata + idx)); + *(odata + idx) = 0.5 * tmp_1; + } : <list of may-alias> +{x; tmp; } are aliased +{*x; *tmp; } are aliased <end of list> Before statement a->t1[i] = (double *)malloc((unsigned long)10 * sizeof(double)); : <list of may-alias> <end of list> -Before statement a->t2[i] = (double *)malloc((unsigned long)10 * sizeof(double)); : +Before statement tmp_1 = sin(*(idata + idx)); + *(odata + idx) = 0.5 * tmp_1; : <list of may-alias> +{x; tmp; } are aliased +{*x; *tmp; } are aliased <end of list> Before statement a->t2[i] = (double *)malloc((unsigned long)10 * sizeof(double)); : <list of may-alias> <end of list> -Before statement a->t2[i] = (double *)malloc((unsigned long)10 * sizeof(double)); : +Before statement tmp_1 = sin(*(idata + idx)); : <list of may-alias> +{x; tmp; } are aliased +{*x; *tmp; } are aliased <end of list> -Before statement a->t2[i] = (double *)malloc((unsigned long)10 * sizeof(double)); : +Before statement i ++; : <list of may-alias> <end of list> -Before statement i ++; : +Before statement *(odata + idx) = 0.5 * tmp_1; : <list of may-alias> +{x; tmp; } are aliased +{*x; *tmp; } are aliased <end of list> -Before statement i ++; : +Before statement a->n1 = (int *)malloc(sizeof(int)); : <list of may-alias> <end of list> -Before statement i ++; : +Before statement idx ++; : <list of may-alias> +{x; tmp; } are aliased +{*x; *tmp; } are aliased <end of list> -Before statement a->n1 = (int *)malloc(sizeof(int)); : +Before statement a->n2 = (int *)malloc(sizeof(int)); : <list of may-alias> <end of list> -Before statement a->n2 = (int *)malloc(sizeof(int)); : +Before statement swap(tmp->n1); : <list of may-alias> +{x; tmp; } are aliased +{*x; *tmp; } are aliased <end of list> Before statement *(a->n1) = 1; : @@ -1095,6 +403,10 @@ Before statement i = 0; : <list of may-alias> <end of list> +Before statement ty *tmp = x; : + <list of may-alias> +<end of list> + Before statement while (i < 2) { b->t1[i] = a->t1[i]; b->t2[i] = a->t2[i]; @@ -1103,29 +415,52 @@ Before statement while (i < 2) { <list of may-alias> <end of list> -Before statement if (! (i < 2)) break; : +Before statement idata = (double *)malloc((unsigned long)10 * sizeof(double)); : <list of may-alias> +{x; tmp; } are aliased +{*x; *tmp; } are aliased <end of list> -Before statement if (! (i < 2)) break; : +Before statement while (1) { + idata = tmp->t1[*(tmp->n1)]; + odata = tmp->t2[*(tmp->n2)]; + idx = 0; + while (idx < 10) { + *(odata + idx) = (double)3 * *(idata + idx) + (double)1; + idx ++; + } + swap(tmp->n2); + } : <list of may-alias> +{x; tmp; } are aliased +{*x; *tmp; } are aliased <end of list> -Before statement break; : +Before statement if (! (i < 2)) break; : <list of may-alias> <end of list> -Before statement break; : +Before statement idata = tmp->t1[*(tmp->n1)]; + odata = tmp->t2[*(tmp->n2)]; + idx = 0; + while (idx < 10) { + *(odata + idx) = (double)3 * *(idata + idx) + (double)1; + idx ++; + } + swap(tmp->n2); : <list of may-alias> +{x; tmp; } are aliased +{*x; *tmp; } are aliased <end of list> Before statement break; : <list of may-alias> <end of list> -Before statement b->t1[i] = a->t1[i]; - b->t2[i] = a->t2[i]; : +Before statement idata = tmp->t1[*(tmp->n1)]; : <list of may-alias> +{x; tmp; } are aliased +{*x; *tmp; } are aliased <end of list> Before statement b->t1[i] = a->t1[i]; @@ -1133,64 +468,10 @@ Before statement b->t1[i] = a->t1[i]; <list of may-alias> <end of list> -Before statement b->t1[i] = a->t1[i]; : - <list of may-alias> -<end of list> - -Before statement b->t1[i] = a->t1[i]; : - <list of may-alias> -<end of list> - -Before statement b->t1[i] = a->t1[i]; : - <list of may-alias> -<end of list> - -Before statement b->t2[i] = a->t2[i]; : - <list of may-alias> -<end of list> - -Before statement b->t2[i] = a->t2[i]; : - <list of may-alias> -<end of list> - -Before statement b->t2[i] = a->t2[i]; : - <list of may-alias> -<end of list> - -Before statement i ++; : - <list of may-alias> -<end of list> - -Before statement i ++; : - <list of may-alias> -<end of list> - -Before statement b->n1 = a->n1; : - <list of may-alias> -<end of list> - -Before statement b->n2 = a->n2; : - <list of may-alias> -<end of list> - -Before statement f1(a); : - <list of may-alias> -<end of list> - -Before statement f2(b); : - <list of may-alias> -<end of list> - -Before statement __retres = 0; : - <list of may-alias> -<end of list> - -Before statement return; : - <list of may-alias> -<end of list> - -Before statement return __retres; : +Before statement odata = tmp->t2[*(tmp->n2)]; : <list of may-alias> +{x; tmp; } are aliased +{*x; *tmp; } are aliased <end of list> [alias] Analysis complete