diff options
| author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-17 10:29:26 +0000 |
|---|---|---|
| committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-17 10:29:26 +0000 |
| commit | 7f7f16d4deb75c7ea1eb3de1ad1c32c2ab154526 (patch) | |
| tree | 782952ba2e1e9c698d64bfd383ed0f45f0756c48 | |
| parent | 395f8e2edc01b66e32767865ab0add2ba3e7a8ce (diff) | |
| download | ppe42-gcc-7f7f16d4deb75c7ea1eb3de1ad1c32c2ab154526.tar.gz ppe42-gcc-7f7f16d4deb75c7ea1eb3de1ad1c32c2ab154526.zip | |
2009-04-17 Richard Guenther <rguenther@suse.de>
PR tree-optimization/39746
* tree-ssa-alias.c (ref_maybe_used_by_call_p_1): Remove
special-casing for builtins and static variable use/def.
(call_may_clobber_ref_p_1): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146240 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 7 | ||||
| -rw-r--r-- | gcc/tree-ssa-alias.c | 26 |
2 files changed, 15 insertions, 18 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 89aa22c094e..22f1aac0deb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2009-04-17 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/39746 + * tree-ssa-alias.c (ref_maybe_used_by_call_p_1): Remove + special-casing for builtins and static variable use/def. + (call_may_clobber_ref_p_1): Likewise. + 2009-04-16 Ian Lance Taylor <iant@google.com> * df.h: Include "timevar.h". diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c index b9cd54732b9..5207bc962f1 100644 --- a/gcc/tree-ssa-alias.c +++ b/gcc/tree-ssa-alias.c @@ -737,7 +737,7 @@ refs_may_alias_p (tree ref1, tree ref2) static bool ref_maybe_used_by_call_p_1 (gimple call, tree ref) { - tree base, fndecl; + tree base; unsigned i; int flags = gimple_call_flags (call); @@ -758,14 +758,8 @@ ref_maybe_used_by_call_p_1 (gimple call, tree ref) cannot possibly use it. */ if (DECL_P (base) && !may_be_aliased (base) - /* But local statics can be used through recursion! */ - && (!is_global_var (base) - /* But not via builtins. - ??? We just assume that this is true if we are not a - builtin function ourself. */ - || (!DECL_BUILT_IN (cfun->decl) - && (fndecl = gimple_call_fndecl (call)) - && DECL_BUILT_IN (fndecl)))) + /* But local statics can be used through recursion. */ + && !is_global_var (base)) goto process_args; /* Check if base is a global static variable that is not read @@ -865,7 +859,7 @@ ref_maybe_used_by_stmt_p (gimple stmt, tree ref) static bool call_may_clobber_ref_p_1 (gimple call, tree ref) { - tree fndecl, base; + tree base; /* If the call is pure or const it cannot clobber anything. */ if (gimple_call_flags (call) @@ -884,15 +878,11 @@ call_may_clobber_ref_p_1 (gimple call, tree ref) cannot possibly clobber it. */ if (DECL_P (base) && !may_be_aliased (base) - /* But local non-readonly statics can be modified through recursion! */ + /* But local non-readonly statics can be modified through recursion + or the call may implement a threading barrier which we must + treat as may-def. */ && (TREE_READONLY (base) - || !is_global_var (base) - /* But not via builtins. - ??? We just assume that this is true if we are not a - builtin function ourself. */ - || (!DECL_BUILT_IN (cfun->decl) - && (fndecl = gimple_call_fndecl (call)) - && DECL_BUILT_IN (fndecl)))) + || !is_global_var (base))) return false; /* Check if base is a global static variable that is not written |

