aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-operands.c
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@redhat.com>2004-09-16 22:16:56 +0000
committerDiego Novillo <dnovillo@gcc.gnu.org>2004-09-16 18:16:56 -0400
commit1800536a055eefcd5877c11cdea3fa25d692589e (patch)
tree7260cac5c75003316b7d9996ef8b23d0b770c64e /gcc/tree-ssa-operands.c
parent42759f1ea05f7893f3bee4adbab74becf1a9f764 (diff)
downloadgcc-1800536a055eefcd5877c11cdea3fa25d692589e.zip
gcc-1800536a055eefcd5877c11cdea3fa25d692589e.tar.gz
gcc-1800536a055eefcd5877c11cdea3fa25d692589e.tar.bz2
tree-ssa-operands.c (add_call_clobber_ops): Make read-only test apply only to TREE_STATIC and DECL_EXTERNAL.
* tree-ssa-operands.c (add_call_clobber_ops): Make read-only test apply only to TREE_STATIC and DECL_EXTERNAL. From-SVN: r87615
Diffstat (limited to 'gcc/tree-ssa-operands.c')
-rw-r--r--gcc/tree-ssa-operands.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c
index 8daadc7..a007b50 100644
--- a/gcc/tree-ssa-operands.c
+++ b/gcc/tree-ssa-operands.c
@@ -1620,9 +1620,15 @@ add_call_clobber_ops (tree stmt, tree callee)
with a module static or we may not. So we still must look
anywhere else we can (such as the TREE_READONLY) to get
better info. */
+
/* If VAR is read-only, don't add a V_MAY_DEF, just a
- VUSE operand. */
- else if (TREE_READONLY (var))
+ VUSE operand. FIXME, this is quirky. TREE_READONLY
+ by itself is not enough here. We can only decide
+ that the call will not affect VAR if all these
+ conditions are met. One would think that
+ TREE_READONLY should be sufficient. */
+ else if (TREE_READONLY (var)
+ && (TREE_STATIC (var) || DECL_EXTERNAL (var)))
add_stmt_operand (&var, stmt, opf_none);
else
add_stmt_operand (&var, stmt, opf_is_def);