summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-alias.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-20 12:03:16 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-20 12:03:16 +0000
commit09d9c77451be2af28d5bcb5327cdb606d939a54b (patch)
tree184a74dea43f320ee54cbce63562ba24f77061d9 /gcc/tree-ssa-alias.c
parent657e45c6d68596fdc8988a7e73e0bf136f8b8e24 (diff)
downloadgcc-09d9c77451be2af28d5bcb5327cdb606d939a54b.tar.gz
2009-06-20 Richard Guenther <rguenther@suse.de>
* tree-ssa-structalias.c (find_func_aliases): For memset use a constraint from NULL if we memset to zero. * tree-ssa-alias.c (ref_maybe_used_by_call_p_1): Add builtins we explicitly handle that do not read from memory. (call_may_clobber_ref_p_1): Properly handle builtins that may set errno. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@148747 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-alias.c')
-rw-r--r--gcc/tree-ssa-alias.c43
1 files changed, 39 insertions, 4 deletions
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c
index c83488b1788..98955246aea 100644
--- a/gcc/tree-ssa-alias.c
+++ b/gcc/tree-ssa-alias.c
@@ -899,6 +899,29 @@ ref_maybe_used_by_call_p_1 (gimple call, tree ref)
tree src = gimple_call_arg (call, 1);
return ptr_deref_may_alias_ref_p (src, ref);
}
+ /* The following builtins do not read from memory. */
+ case BUILT_IN_FREE:
+ case BUILT_IN_MEMSET:
+ case BUILT_IN_FREXP:
+ case BUILT_IN_FREXPF:
+ case BUILT_IN_FREXPL:
+ case BUILT_IN_GAMMA_R:
+ case BUILT_IN_GAMMAF_R:
+ case BUILT_IN_GAMMAL_R:
+ case BUILT_IN_LGAMMA_R:
+ case BUILT_IN_LGAMMAF_R:
+ case BUILT_IN_LGAMMAL_R:
+ case BUILT_IN_MODF:
+ case BUILT_IN_MODFF:
+ case BUILT_IN_MODFL:
+ case BUILT_IN_REMQUO:
+ case BUILT_IN_REMQUOF:
+ case BUILT_IN_REMQUOL:
+ case BUILT_IN_SINCOS:
+ case BUILT_IN_SINCOSF:
+ case BUILT_IN_SINCOSL:
+ return false;
+
default:
/* Fallthru to general call handling. */;
}
@@ -1060,15 +1083,23 @@ call_may_clobber_ref_p_1 (gimple call, ao_ref *ref)
tree ptr = gimple_call_arg (call, 0);
return ptr_deref_may_alias_ref_p_1 (ptr, ref);
}
- case BUILT_IN_FREXP:
- case BUILT_IN_FREXPF:
- case BUILT_IN_FREXPL:
case BUILT_IN_GAMMA_R:
case BUILT_IN_GAMMAF_R:
case BUILT_IN_GAMMAL_R:
case BUILT_IN_LGAMMA_R:
case BUILT_IN_LGAMMAF_R:
case BUILT_IN_LGAMMAL_R:
+ {
+ tree out = gimple_call_arg (call, 1);
+ if (ptr_deref_may_alias_ref_p_1 (out, ref))
+ return true;
+ if (flag_errno_math)
+ break;
+ return false;
+ }
+ case BUILT_IN_FREXP:
+ case BUILT_IN_FREXPF:
+ case BUILT_IN_FREXPL:
case BUILT_IN_MODF:
case BUILT_IN_MODFF:
case BUILT_IN_MODFL:
@@ -1081,7 +1112,11 @@ call_may_clobber_ref_p_1 (gimple call, ao_ref *ref)
case BUILT_IN_REMQUOL:
{
tree out = gimple_call_arg (call, 2);
- return ptr_deref_may_alias_ref_p_1 (out, ref);
+ if (ptr_deref_may_alias_ref_p_1 (out, ref))
+ return true;
+ if (flag_errno_math)
+ break;
+ return false;
}
case BUILT_IN_SINCOS:
case BUILT_IN_SINCOSF: