aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-structalias.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2011-06-22 12:46:36 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2011-06-22 12:46:36 +0200
commit36dc1a88ff11de41ed1b2a313f28ad12cd3c7bd3 (patch)
tree5db992248a216e242d2e9eff0ad5aea9a9f3ebdd /gcc/tree-ssa-structalias.c
parent41cd495729ac43083ce23687b55c42f3a6c298d1 (diff)
downloadgcc-36dc1a88ff11de41ed1b2a313f28ad12cd3c7bd3.zip
gcc-36dc1a88ff11de41ed1b2a313f28ad12cd3c7bd3.tar.gz
gcc-36dc1a88ff11de41ed1b2a313f28ad12cd3c7bd3.tar.bz2
tree-ssa-ccp.c (evaluate_stmt): Try bitwise tracking for builtin calls even if likelyvalue is not CONSTANT.
* tree-ssa-ccp.c (evaluate_stmt): Try bitwise tracking for builtin calls even if likelyvalue is not CONSTANT. Handle BUILT_IN_STRDUP and BUILT_IN_STRNDUP like BUILT_IN_MALLOC. Return get_value_for_expr of first operand for BUILT_IN_{MEM{CPY,MOVE,SET},STR{,N}CPY}{,_CHK}. * tree-ssa-alias.c (ref_maybe_used_by_call_p_1): Handle BUILT_IN_{MEM{{,P}CPY,MOVE,SET},STR{,N}C{PY,AT},STPCPY}_CHK like their non-checking counterparts. (call_may_clobber_ref_p_1): Likewise. (stmt_kills_ref_p_1): Handle BUILT_IN_MEM{{,P}CPY,MOVE,SET}_CHK like their non-checking counterparts. * tree-ssa-structalias.c (find_func_aliases_for_builtin_call): Handle BUILT_IN_{MEM{{,P}CPY,MOVE,SET},STR{,N}C{PY,AT},STPCPY}_CHK like their non-checking counterparts. (find_func_clobbers): Likewise. * tree-ssa-dce.c (propagate_necessity): Handle BUILT_IN_MEMSET_CHK like BUILT_IN_MEMSET and BUILT_IN_CALLOC like BUILT_IN_MALLOC. From-SVN: r175290
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r--gcc/tree-ssa-structalias.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index 6f076dc..faf4f6a 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -1,5 +1,5 @@
/* Tree based points-to analysis
- Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010
+ Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by Daniel Berlin <dberlin@dberlin.org>
@@ -3982,6 +3982,14 @@ find_func_aliases_for_builtin_call (gimple t)
case BUILT_IN_STPNCPY:
case BUILT_IN_STRCAT:
case BUILT_IN_STRNCAT:
+ case BUILT_IN_STRCPY_CHK:
+ case BUILT_IN_STRNCPY_CHK:
+ case BUILT_IN_MEMCPY_CHK:
+ case BUILT_IN_MEMMOVE_CHK:
+ case BUILT_IN_MEMPCPY_CHK:
+ case BUILT_IN_STPCPY_CHK:
+ case BUILT_IN_STRCAT_CHK:
+ case BUILT_IN_STRNCAT_CHK:
{
tree res = gimple_call_lhs (t);
tree dest = gimple_call_arg (t, (DECL_FUNCTION_CODE (fndecl)
@@ -4011,6 +4019,7 @@ find_func_aliases_for_builtin_call (gimple t)
return true;
}
case BUILT_IN_MEMSET:
+ case BUILT_IN_MEMSET_CHK:
{
tree res = gimple_call_lhs (t);
tree dest = gimple_call_arg (t, 0);
@@ -4627,6 +4636,14 @@ find_func_clobbers (gimple origt)
case BUILT_IN_STPNCPY:
case BUILT_IN_STRCAT:
case BUILT_IN_STRNCAT:
+ case BUILT_IN_STRCPY_CHK:
+ case BUILT_IN_STRNCPY_CHK:
+ case BUILT_IN_MEMCPY_CHK:
+ case BUILT_IN_MEMMOVE_CHK:
+ case BUILT_IN_MEMPCPY_CHK:
+ case BUILT_IN_STPCPY_CHK:
+ case BUILT_IN_STRCAT_CHK:
+ case BUILT_IN_STRNCAT_CHK:
{
tree dest = gimple_call_arg (t, (DECL_FUNCTION_CODE (decl)
== BUILT_IN_BCOPY ? 1 : 0));
@@ -4649,6 +4666,7 @@ find_func_clobbers (gimple origt)
/* The following function clobbers memory pointed to by
its argument. */
case BUILT_IN_MEMSET:
+ case BUILT_IN_MEMSET_CHK:
{
tree dest = gimple_call_arg (t, 0);
unsigned i;