diff options
author | Richard Biener <rguenther@suse.de> | 2014-02-07 09:33:23 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2014-02-07 09:33:23 +0000 |
commit | 32cab212f2dd2f17c80c2894e6d9095912db02cc (patch) | |
tree | 629d882ca041bd4388e6a8674102352639e71fa5 /gcc/tree-ssa-structalias.c | |
parent | 1c51d6883ae957c26cbd2a71c09291e34a21f73c (diff) | |
download | gcc-32cab212f2dd2f17c80c2894e6d9095912db02cc.zip gcc-32cab212f2dd2f17c80c2894e6d9095912db02cc.tar.gz gcc-32cab212f2dd2f17c80c2894e6d9095912db02cc.tar.bz2 |
re PR middle-end/60092 (posix_memalign not recognized to derive alias and alignment info)
2014-02-07 Richard Biener <rguenther@suse.de>
PR middle-end/60092
* builtin-types.def (BT_FN_INT_PTRPTR_SIZE_SIZE): Add.
* builtins.def (BUILT_IN_POSIX_MEMALIGN): Likewise.
* tree-ssa-structalias.c (find_func_aliases_for_builtin_call):
Handle BUILT_IN_POSIX_MEMALIGN.
(find_func_clobbers): Likewise.
* tree-ssa-alias.c (ref_maybe_used_by_call_p_1): Likewise.
(call_may_clobber_ref_p_1): Likewise.
* gcc.dg/tree-ssa/alias-30.c: New testcase.
* gcc.dg/tree-ssa/alias-31.c: Likewise.
From-SVN: r207595
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r-- | gcc/tree-ssa-structalias.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index 0ce134d..402b3d1 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -3982,7 +3982,7 @@ handle_lhs_call (gimple stmt, tree lhs, int flags, vec<ce_s> rhsc, struct constraint_expr tmpc; rhsc.create (0); vi = make_heapvar ("HEAP"); - /* We marking allocated storage local, we deal with it becoming + /* We are marking allocated storage local, we deal with it becoming global by escaping and setting of vars_contains_escaped_heap. */ DECL_EXTERNAL (vi->decl) = 0; vi->is_global_var = 0; @@ -4231,6 +4231,26 @@ find_func_aliases_for_builtin_call (gimple t) lhsc.release (); return true; } + case BUILT_IN_POSIX_MEMALIGN: + { + tree ptrptr = gimple_call_arg (t, 0); + get_constraint_for (ptrptr, &lhsc); + do_deref (&lhsc); + varinfo_t vi = make_heapvar ("HEAP"); + /* We are marking allocated storage local, we deal with it becoming + global by escaping and setting of vars_contains_escaped_heap. */ + DECL_EXTERNAL (vi->decl) = 0; + vi->is_global_var = 0; + struct constraint_expr tmpc; + tmpc.var = vi->id; + tmpc.offset = 0; + tmpc.type = ADDRESSOF; + rhsc.safe_push (tmpc); + process_all_all_constraints (lhsc, rhsc); + lhsc.release (); + rhsc.release (); + return true; + } case BUILT_IN_ASSUME_ALIGNED: { tree res = gimple_call_lhs (t); @@ -4960,6 +4980,7 @@ find_func_clobbers (gimple origt) its argument. */ case BUILT_IN_MEMSET: case BUILT_IN_MEMSET_CHK: + case BUILT_IN_POSIX_MEMALIGN: { tree dest = gimple_call_arg (t, 0); unsigned i; |