aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-dfa.c
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@redhat.com>2004-08-12 14:34:11 +0000
committerDiego Novillo <dnovillo@gcc.gnu.org>2004-08-12 10:34:11 -0400
commitc597ef4eab9a2de9ad0b2187547ac9bac0b53132 (patch)
treea0fa15664fe5d4dfd7f6bced8b73b4839f33dfcb /gcc/tree-dfa.c
parentab5c8549a48977b865f8ed8dd4bd4e745b1cec75 (diff)
downloadgcc-c597ef4eab9a2de9ad0b2187547ac9bac0b53132.zip
gcc-c597ef4eab9a2de9ad0b2187547ac9bac0b53132.tar.gz
gcc-c597ef4eab9a2de9ad0b2187547ac9bac0b53132.tar.bz2
re PR tree-optimization/16867 (Inline array initializer miscompilation at -O)
PR tree-optimization/16867 * tree.c (is_global_var): New function. (needs_to_live_in_memory): Check for TREE_ADDRESSABLE. Call is_global_var. * tree.h (DECL_NEEDS_TO_LIVE_IN_MEMORY_INTERNAL): Remove. Update all users. (is_global_var): Declare. * tree-dfa.c (dump_variable): Display global and addressable attributes. (add_referenced_var): Clarify documentation when marking variables call-clobbered. * tree-flow-inline.h (is_call_clobbered): Call is_global_var instead of needs_to_live_in_memory. (mark_call_clobbered): If the variable is a tag, mark it DECL_EXTERNAL. * tree-gimple.c (is_gimple_reg): Don't check for TREE_ADDRESSABLE. (is_gimple_non_addressable): Likewise. * tree-ssa-alias.c (get_nmt_for): Always check whether the tag needs to be marked call-clobbered. (setup_pointers_and_addressables): Call is_global_var instead of needs_to_live_in_memory. * tree-ssa-dce.c (need_to_preserve_store): Remove. Update all users with is_global_var. (mark_stmt_if_obviously_necessary): Fix processing of aliased stores. Don't check the virtual definitions. Rather, check whether the store is going into global memory. (find_obviously_necessary_stmts): Get the symbol from the PHI result. * tree-ssa-operands.c (get_call_expr_operands): Do not add clobbering may-defs if the call does not have side effects. libjava/ChangeLog PR tree-optimization/16867 * testsuite/libjava.lang/PR16867.java: New test. From-SVN: r85874
Diffstat (limited to 'gcc/tree-dfa.c')
-rw-r--r--gcc/tree-dfa.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c
index 9e9ee32..0273406 100644
--- a/gcc/tree-dfa.c
+++ b/gcc/tree-dfa.c
@@ -562,8 +562,11 @@ dump_variable (FILE *file, tree var)
if (ann->is_alias_tag)
fprintf (file, ", is an alias tag");
- if (needs_to_live_in_memory (var))
- fprintf (file, ", is %s", TREE_STATIC (var) ? "static" : "global");
+ if (TREE_ADDRESSABLE (var))
+ fprintf (file, ", is addressable");
+
+ if (is_global_var (var))
+ fprintf (file, ", is global");
if (is_call_clobbered (var))
fprintf (file, ", call clobbered");
@@ -900,7 +903,9 @@ add_referenced_var (tree var, struct walk_state *walk_state)
v_ann->uid = num_referenced_vars;
VARRAY_PUSH_TREE (referenced_vars, var);
- /* Global and static variables are call-clobbered, always. */
+ /* Initially assume that all memory variables are
+ call-clobbered. This will be refined later by the alias
+ analyzer. */
if (needs_to_live_in_memory (var))
mark_call_clobbered (var);