diff options
author | Diego Novillo <dnovillo@redhat.com> | 2004-08-12 14:34:11 +0000 |
---|---|---|
committer | Diego Novillo <dnovillo@gcc.gnu.org> | 2004-08-12 10:34:11 -0400 |
commit | c597ef4eab9a2de9ad0b2187547ac9bac0b53132 (patch) | |
tree | a0fa15664fe5d4dfd7f6bced8b73b4839f33dfcb /gcc/tree.h | |
parent | ab5c8549a48977b865f8ed8dd4bd4e745b1cec75 (diff) | |
download | gcc-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.h')
-rw-r--r-- | gcc/tree.h | 13 |
1 files changed, 2 insertions, 11 deletions
@@ -2161,15 +2161,6 @@ struct tree_binfo GTY (()) (! DECL_CONTEXT (EXP) \ || TREE_CODE (DECL_CONTEXT (EXP)) == TRANSLATION_UNIT_DECL) -/* Nonzero for a decl that has been marked as needing a memory slot. - NOTE: Never use this macro directly. It will give you incomplete - information. Most of the time this bit will only be set after alias - analysis in the tree optimizers. It's always better to call - needs_to_live_in_memory instead. To mark memory variables use - mark_call_clobbered. */ -#define DECL_NEEDS_TO_LIVE_IN_MEMORY_INTERNAL(DECL) \ - DECL_CHECK (DECL)->decl.needs_to_live_in_memory - /* Nonzero for a decl that cgraph has decided should be inlined into at least one call site. It is not meaningful to look at this directly; always use cgraph_function_possibly_inlined_p. */ @@ -2242,9 +2233,8 @@ struct tree_decl GTY(()) unsigned lang_flag_6 : 1; unsigned lang_flag_7 : 1; - unsigned needs_to_live_in_memory : 1; unsigned possibly_inlined : 1; - /* 14 unused bits. */ + /* 15 unused bits. */ union tree_decl_u1 { /* In a FUNCTION_DECL for which DECL_BUILT_IN holds, this is @@ -3479,6 +3469,7 @@ extern void expand_function_end (void); extern void expand_function_start (tree); extern void expand_pending_sizes (tree); extern void recompute_tree_invarant_for_addr_expr (tree); +extern bool is_global_var (tree t); extern bool needs_to_live_in_memory (tree); extern tree reconstruct_complex_type (tree, tree); |