;; Function foo_const (foo_const) Points-to analysis Constraints: ANYTHING = &ANYTHING READONLY = &READONLY ESCAPED = *ESCAPED ESCAPED = ESCAPED + UNKNOWN *ESCAPED = NONLOCAL NONLOCAL = &NONLOCAL NONLOCAL = &ESCAPED INTEGER = &ANYTHING p = &NONLOCAL ESCAPED = p Collapsing static cycles and doing variable substitution Building predecessor graph Detecting pointer and location equivalences Rewriting constraints and unifying variables Uniting pointer but not location equivalent variables Finding indirect cycles Solving graph Points-to sets ANYTHING = { ANYTHING } READONLY = { READONLY } ESCAPED = { ESCAPED NONLOCAL } NONLOCAL = { ESCAPED NONLOCAL } STOREDANYTHING = { } INTEGER = { ANYTHING } p = { NONLOCAL } Alias information for foo_const Aliased symbols .MEM, UID D.1241, void, is global Call clobber information ESCAPED, points-to non-local, points-to vars: { } Flow-insensitive points-to information p_1(D), points-to non-local, points-to vars: { } foo_const (int * p) { : return p_1(D); } ;; Function foo_pure (foo_pure) Points-to analysis Constraints: ANYTHING = &ANYTHING READONLY = &READONLY ESCAPED = *ESCAPED ESCAPED = ESCAPED + UNKNOWN *ESCAPED = NONLOCAL NONLOCAL = &NONLOCAL NONLOCAL = &ESCAPED INTEGER = &ANYTHING p = &NONLOCAL dummy = NONLOCAL dummy.0_1 = dummy D.1238_2 = dummy.0_1 D.1239_3 = D.1238_2 D.1239_3 = &NONLOCAL D.1236_5 = p + UNKNOWN ESCAPED = D.1236_5 Collapsing static cycles and doing variable substitution Building predecessor graph Detecting pointer and location equivalences Rewriting constraints and unifying variables Uniting pointer but not location equivalent variables Finding indirect cycles Solving graph Points-to sets ANYTHING = { ANYTHING } READONLY = { READONLY } ESCAPED = { ESCAPED NONLOCAL } NONLOCAL = { ESCAPED NONLOCAL } same as dummy STOREDANYTHING = { } INTEGER = { ANYTHING } p = { NONLOCAL } dummy.0_1 = { ESCAPED NONLOCAL } same as dummy dummy = { ESCAPED NONLOCAL } D.1238_2 = { ESCAPED NONLOCAL } same as dummy D.1239_3 = { ESCAPED NONLOCAL } same as dummy D.1236_5 = { NONLOCAL } Alias information for foo_pure Aliased symbols dummy, UID D.1216, int, is global .MEM, UID D.1235, void, is global, default def: .MEM_6(D) Call clobber information ESCAPED, points-to non-local, points-to vars: { } Flow-insensitive points-to information p_4(D), points-to non-local, points-to vars: { } D.1236_5, points-to non-local, points-to vars: { } foo_pure (int * p) { long unsigned int D.1239; long unsigned int D.1238; int dummy.0; int * D.1236; : dummy.0_1 = dummy; D.1238_2 = (long unsigned int) dummy.0_1; D.1239_3 = D.1238_2 * 4; D.1236_5 = p_4(D) + D.1239_3; return D.1236_5; } ;; Function foo_normal (foo_normal) Points-to analysis Constraints: ANYTHING = &ANYTHING READONLY = &READONLY ESCAPED = *ESCAPED ESCAPED = ESCAPED + UNKNOWN *ESCAPED = NONLOCAL NONLOCAL = &NONLOCAL NONLOCAL = &ESCAPED INTEGER = &ANYTHING p = &NONLOCAL glob = NONLOCAL glob = p ESCAPED = p ESCAPED = p Collapsing static cycles and doing variable substitution Building predecessor graph Detecting pointer and location equivalences Rewriting constraints and unifying variables Uniting pointer but not location equivalent variables Finding indirect cycles Solving graph Points-to sets ANYTHING = { ANYTHING } READONLY = { READONLY } ESCAPED = { ESCAPED NONLOCAL } NONLOCAL = { ESCAPED NONLOCAL } same as glob STOREDANYTHING = { } INTEGER = { ANYTHING } p = { NONLOCAL } glob = { ESCAPED NONLOCAL } Alias information for foo_normal Aliased symbols glob, UID D.1217, int *, is global .MEM, UID D.1233, void, is global, default def: .MEM_2(D) Call clobber information ESCAPED, points-to non-local, points-to vars: { } Flow-insensitive points-to information p_1(D), points-to non-local, points-to vars: { } foo_normal (int * p) { : glob = p_1(D); return p_1(D); } ;; Function test_const (test_const) Points-to analysis Constraints: ANYTHING = &ANYTHING READONLY = &READONLY ESCAPED = *ESCAPED ESCAPED = ESCAPED + UNKNOWN *ESCAPED = NONLOCAL NONLOCAL = &NONLOCAL NONLOCAL = &ESCAPED INTEGER = &ANYTHING q_const_2 = &i q_const_2 = &NONLOCAL i = &NONLOCAL derefaddrtmp = &NONLOCAL *q_const_2 = derefaddrtmp D.1230_3 = i Collapsing static cycles and doing variable substitution Building predecessor graph Detecting pointer and location equivalences Rewriting constraints and unifying variables Uniting pointer but not location equivalent variables Finding indirect cycles Solving graph Points-to sets ANYTHING = { ANYTHING } READONLY = { READONLY } ESCAPED = { ESCAPED NONLOCAL } NONLOCAL = { ESCAPED NONLOCAL } STOREDANYTHING = { } INTEGER = { ANYTHING } i = { NONLOCAL } same as D.1230_3 q_const_2 = { NONLOCAL i } derefaddrtmp = { NONLOCAL } D.1230_3 = { NONLOCAL } Alias information for test_const Aliased symbols .MEM, UID D.1229, void, is global, default def: .MEM_4(D) i, UID D.1231, int, is addressable Call clobber information ESCAPED, points-to non-local, points-to vars: { } Flow-insensitive points-to information q_const_2, points-to non-local, points-to vars: { i } test_const () { int * q_const; int i; int D.1230; : q_const_2 = foo_const (&i); i = 1; *q_const_2 = 2; D.1230_3 = i; if (D.1230_3 != 2) goto ; else goto ; : abort (); : return; } ;; Function test (test) Points-to analysis Constraints: ANYTHING = &ANYTHING READONLY = &READONLY ESCAPED = *ESCAPED ESCAPED = ESCAPED + UNKNOWN *ESCAPED = NONLOCAL NONLOCAL = &NONLOCAL NONLOCAL = &ESCAPED INTEGER = &ANYTHING ESCAPED = &i q_normal_2 = NONLOCAL i = &NONLOCAL derefaddrtmp = &NONLOCAL *q_normal_2 = derefaddrtmp D.1226_3 = i Collapsing static cycles and doing variable substitution Building predecessor graph Detecting pointer and location equivalences Rewriting constraints and unifying variables Uniting pointer but not location equivalent variables Finding indirect cycles Solving graph Points-to sets ANYTHING = { ANYTHING } READONLY = { READONLY } ESCAPED = { ESCAPED NONLOCAL i } NONLOCAL = { ESCAPED NONLOCAL } same as q_normal_2 STOREDANYTHING = { } INTEGER = { ANYTHING } i = { ESCAPED NONLOCAL } same as D.1226_3 q_normal_2 = { ESCAPED NONLOCAL } derefaddrtmp = { NONLOCAL } D.1226_3 = { ESCAPED NONLOCAL } Alias information for test Aliased symbols .MEM, UID D.1225, void, is global, default def: .MEM_4(D) i, UID D.1227, int, is addressable Call clobber information ESCAPED, points-to non-local, points-to vars: { i } Flow-insensitive points-to information q_normal_2, points-to non-local, points-to escaped, points-to vars: { } test () { int * q_normal; int i; int D.1226; : q_normal_2 = foo_normal (&i); i = 1; *q_normal_2 = 2; D.1226_3 = i; if (D.1226_3 != 2) goto ; else goto ; : abort (); : return; } ;; Function test_pure (test_pure) Points-to analysis Constraints: ANYTHING = &ANYTHING READONLY = &READONLY ESCAPED = *ESCAPED ESCAPED = ESCAPED + UNKNOWN *ESCAPED = NONLOCAL NONLOCAL = &NONLOCAL NONLOCAL = &ESCAPED INTEGER = &ANYTHING CALLUSED = *CALLUSED CALLUSED = CALLUSED + UNKNOWN CALLUSED = &i q_pure_2 = CALLUSED q_pure_2 = NONLOCAL i = &NONLOCAL derefaddrtmp = &NONLOCAL *q_pure_2 = derefaddrtmp D.1222_3 = i Collapsing static cycles and doing variable substitution Building predecessor graph Detecting pointer and location equivalences Rewriting constraints and unifying variables Uniting pointer but not location equivalent variables Finding indirect cycles Solving graph Points-to sets ANYTHING = { ANYTHING } READONLY = { READONLY } ESCAPED = { ESCAPED NONLOCAL } NONLOCAL = { ESCAPED NONLOCAL } STOREDANYTHING = { } INTEGER = { ANYTHING } CALLUSED = { ESCAPED NONLOCAL i } CALLCLOBBERED = { } i = { NONLOCAL } same as D.1222_3 q_pure_2 = { ESCAPED NONLOCAL i } derefaddrtmp = { NONLOCAL } D.1222_3 = { NONLOCAL } Alias information for test_pure Aliased symbols .MEM, UID D.1221, void, is global, default def: .MEM_4(D) i, UID D.1223, int, is addressable Call clobber information ESCAPED, points-to non-local, points-to vars: { } Flow-insensitive points-to information q_pure_2, points-to non-local, points-to escaped, points-to vars: { i } test_pure () { int * q_pure; int i; int D.1222; : q_pure_2 = foo_pure (&i); i = 1; *q_pure_2 = 2; D.1222_3 = i; if (D.1222_3 != 2) goto ; else goto ; : abort (); : return; } ;; Function main (main) (executed once) Points-to analysis Constraints: ANYTHING = &ANYTHING READONLY = &READONLY ESCAPED = *ESCAPED ESCAPED = ESCAPED + UNKNOWN *ESCAPED = NONLOCAL NONLOCAL = &NONLOCAL NONLOCAL = &ESCAPED INTEGER = &ANYTHING ESCAPED = &NULL Collapsing static cycles and doing variable substitution Building predecessor graph Detecting pointer and location equivalences Rewriting constraints and unifying variables Uniting pointer but not location equivalent variables Finding indirect cycles Solving graph Points-to sets ANYTHING = { ANYTHING } READONLY = { READONLY } ESCAPED = { NULL } NONLOCAL = { ESCAPED NONLOCAL } STOREDANYTHING = { } INTEGER = { ANYTHING } Alias information for main Aliased symbols .MEM, UID D.1220, void, is global, default def: .MEM_1(D) Call clobber information ESCAPED, points-to NULL, points-to vars: { } Flow-insensitive points-to information main () { : test_const (); test (); test_pure (); return 0; }