diff options
author | Jakub Jelinek <jakub@redhat.com> | 2011-09-30 16:58:27 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2011-09-30 16:58:27 +0200 |
commit | 915afed63edcfbc614b3357d0862a4124a156d3a (patch) | |
tree | 547d9c6e16c8da1b5c7e98044325a0f5be53cc1e /gcc/tree-ssa-structalias.c | |
parent | 49f836ba6fdf80354f675af50837fbdb7144e081 (diff) | |
download | gcc-915afed63edcfbc614b3357d0862a4124a156d3a.zip gcc-915afed63edcfbc614b3357d0862a4124a156d3a.tar.gz gcc-915afed63edcfbc614b3357d0862a4124a156d3a.tar.bz2 |
tree-ssa-structalias.c (find_func_aliases_for_builtin_call): Handle BUILT_IN_STRDUP and BUILT_IN_STRNDUP.
* tree-ssa-structalias.c (find_func_aliases_for_builtin_call): Handle
BUILT_IN_STRDUP and BUILT_IN_STRNDUP.
* tree-ssa-alias.c (call_may_clobber_ref_p_1): Likewise. Fix
handling of BUILT_IN_STRNCAT and BUILT_IN_STRNCAT_CHK.
(ref_maybe_used_by_call_p_1): Fix handling of BUILT_IN_STRCAT,
BUILT_IN_STRNCAT, BUILT_IN_STRCAT_CHK and BUILT_IN_STRNCAT_CHK.
* gcc.dg/strlenopt-21.c: New test.
Co-Authored-By: Richard Guenther <rguenther@suse.de>
From-SVN: r179387
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r-- | gcc/tree-ssa-structalias.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index 1023acf..821fc7d 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -4130,6 +4130,24 @@ find_func_aliases_for_builtin_call (gimple t) case BUILT_IN_REMQUOL: case BUILT_IN_FREE: return true; + case BUILT_IN_STRDUP: + case BUILT_IN_STRNDUP: + if (gimple_call_lhs (t)) + { + handle_lhs_call (t, gimple_call_lhs (t), gimple_call_flags (t), + NULL, fndecl); + get_constraint_for_ptr_offset (gimple_call_lhs (t), + NULL_TREE, &lhsc); + get_constraint_for_ptr_offset (gimple_call_arg (t, 0), + NULL_TREE, &rhsc); + do_deref (&lhsc); + do_deref (&rhsc); + process_all_all_constraints (lhsc, rhsc); + VEC_free (ce_s, heap, lhsc); + VEC_free (ce_s, heap, rhsc); + return true; + } + break; /* Trampolines are special - they set up passing the static frame. */ case BUILT_IN_INIT_TRAMPOLINE: |