On Mon, 30 Nov 2015, Tom de Vries wrote: > Hi, > > this patch fixes PR46032. > > It handles a call: > ... > __builtin_GOMP_parallel (fn, data, num_threads, flags) > ... > as: > ... > fn (data) > ... > in ipa-pta. > > This improves ipa-pta alias analysis in the parallelized function fn, and > allows vectorization in the testcase without a runtime alias test. > > Bootstrapped and reg-tested on x86_64. > > OK for stage3 trunk?
+ /* Assign the passed argument to the appropriate incoming + parameter of the function. */ + struct constraint_expr lhs ; + lhs = get_function_part_constraint (fi, fi_parm_base + 0); + auto_vec<ce_s, 2> rhsc; + struct constraint_expr *rhsp; + get_constraint_for_rhs (arg, &rhsc); + while (rhsc.length () != 0) + { + rhsp = &rhsc.last (); + process_constraint (new_constraint (lhs, *rhsp)); + rhsc.pop (); + } please use style used elsewhere with FOR_EACH_VEC_ELT (rhsc, j, rhsp) process_constraint (new_constraint (lhs, *rhsp)); rhsc.truncate (0); + /* Parameter passed by value is used. */ + lhs = get_function_part_constraint (fi, fi_uses); + struct constraint_expr *rhsp; + get_constraint_for_address_of (arg, &rhsc); This isn't correct - you want to use get_constraint_for (arg, &rhsc). After all rhs is already an ADDR_EXPR. + FOR_EACH_VEC_ELT (rhsc, j, rhsp) + process_constraint (new_constraint (lhs, *rhsp)); + rhsc.truncate (0); + + /* The caller clobbers what the callee does. */ + lhs = get_function_part_constraint (fi, fi_clobbers); + rhs = get_function_part_constraint (cfi, fi_clobbers); + process_constraint (new_constraint (lhs, rhs)); + + /* The caller uses what the callee does. */ + lhs = get_function_part_constraint (fi, fi_uses); + rhs = get_function_part_constraint (cfi, fi_uses); + process_constraint (new_constraint (lhs, rhs)); I don't see why you need those. The solver should compute these in even better precision (context sensitive on the call side). The same is true for the function parameter. That is, the only needed part of the patch should be that making sure we see the "direct" call and assign parameters correctly. Richard.