From ca7c8a8aa0f0047a232cb84ef524b7ea34a3dbc0 Mon Sep 17 00:00:00 2001 From: Tristan Le Gall <tristan.le-gall@cea.fr> Date: Tue, 14 Feb 2023 17:33:01 +0100 Subject: [PATCH] [alias] code clean-up --- src/plugins/alias/analysis.ml | 78 +- .../tests/basic/oracle/assignment1.res.oracle | 8 + .../tests/basic/oracle/assignment2.res.oracle | 8 + .../tests/basic/oracle/assignment3.res.oracle | 6 + .../tests/basic/oracle/assignment4.res.oracle | 8 + .../alias/tests/basic/oracle/cast1.res.oracle | 7 + .../basic/oracle/conditional1.res.oracle | 19 +- .../basic/oracle/conditional2.res.oracle | 20 +- .../tests/basic/oracle/function1.res.oracle | 12 + .../tests/basic/oracle/function2.res.oracle | 8 + .../tests/basic/oracle/function3.res.oracle | 58 +- .../tests/basic/oracle/function4.res.oracle | 6 + .../tests/basic/oracle/function5.res.oracle | 76 +- .../tests/basic/oracle/switch1.res.oracle | 54 +- .../tests/basic/oracle/switch2.res.oracle | 69 +- .../tests/basic/oracle/while_for1.res.oracle | 70 +- .../tests/basic/oracle/while_for2.res.oracle | 54 +- .../tests/basic/oracle/while_for3.res.oracle | 222 +--- .../real_world/oracle/example1.res.oracle | 1115 +++-------------- 19 files changed, 387 insertions(+), 1511 deletions(-) diff --git a/src/plugins/alias/analysis.ml b/src/plugins/alias/analysis.ml index 9ce557b25af..57068c48c99 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,7 +49,7 @@ 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 @@ -61,16 +61,24 @@ 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 @@ -122,7 +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; + Options.feedback "ANALYSING %a" Printer.pp_stmt s; match i with Set(lv,exp,_) -> let new_a = do_assignment a lv exp in @@ -171,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 *) @@ -203,38 +211,7 @@ struct let doGuard _ _ a = Dataflow.GUse a, Dataflow.GUse a -let doStmt _ _ = Dataflow.SDefault -(* - 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 @@ -270,14 +247,14 @@ let doFunction (kf:kernel_function) = F.compute first_stmts; let return_stmt = Kernel_function.find_return kf in let final_state : Abstract_state.t option = - try (*Stmt_table.find return_stmt*)D.find return_stmt + try Stmt_table.find return_stmt with Not_found -> begin (* 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*)D.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; *) @@ -352,7 +329,7 @@ let compute () = | Some s -> Abstract_state.pretty_summary ~function_name fmt s in if Options.ShowStmtTable.get() then - (*Stmt_table*)D.iter (print_stmt_table_elt Format.std_formatter); + Stmt_table.iter (print_stmt_table_elt Format.std_formatter); if Options.ShowFunctionTable.get() then begin Function_table.iter (print_function_table_elt Format.std_formatter) @@ -361,18 +338,13 @@ let compute () = let clear () = computed_flag := false; - (*Stmt_table*)D.clear() + (*Stmt_table*)Stmt_table.clear() let get_abstract_state _ stmt = if is_computed () then - try (*Stmt_table*)D.find stmt with + try Stmt_table.find stmt with Not_found -> None else None -module Stmt_table = struct -include D -type key = stmt -type value = data -end diff --git a/src/plugins/alias/tests/basic/oracle/assignment1.res.oracle b/src/plugins/alias/tests/basic/oracle/assignment1.res.oracle index 364a5364058..6df5e3bb463 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 949d0dbc35b..599e2006886 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 551c980ced1..909a5696fb8 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 41bdea2499e..4e349bedc97 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 28b0d71a5ac..43fb5960a70 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 cc37f90c3f5..620ecc8110a 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 9cd69b4095a..8debbdfefd1 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 56585d3707b..5b768c382f8 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 b69f7452c5d..5a9efeef4ae 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 d67f7024949..e1edc96653c 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 c59c9e79c8a..08058c8a44d 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 7e54cb3f9a9..66b4e2ee538 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 c2c0d2c015f..cab732089eb 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 e4462bb4039..e710b245dc3 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 08efe0061a7..50f84214cb7 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 97b3ab043e4..1b99076a2e2 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 f5011d57130..4be25748257 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/real_world/oracle/example1.res.oracle b/src/plugins/alias/tests/real_world/oracle/example1.res.oracle index 66054e34916..acffaafc5c3 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 -- GitLab