re PR tree-optimization/19853 (incorrect vops after exposing a new global variable)

PR tree-optimization/19853
	* tree-dfa.c (add_referenced_var): Always examine DECL_INITIAL.


testsuite/ChangeLog

	PR tree-optimization/19853
	* gcc.c-torture/compile/pr19853.c: New test.

From-SVN: r95040
This commit is contained in:
Diego Novillo 2005-02-14 14:46:08 -05:00
parent f769035f7c
commit 9a06c1cb10
4 changed files with 35 additions and 6 deletions

View File

@ -1,3 +1,8 @@
2005-02-14 Diego Novillo <dnovillo@redhat.com>
PR tree-optimization/19853
* tree-dfa.c (add_referenced_var): Always examine DECL_INITIAL.
2005-02-14 Kazu Hirata <kazu@cs.umass.edu>
* passes.c (rest_of_handle_loop_optimize): Remove calls to
@ -9,7 +14,7 @@
swapping commutative operands.
2005-02-14 Sebastian Pop <pop@cri.ensmp.fr>
* lambda-code.c (lambda_loopnest_to_gcc_loopnest, perfect_nestify):
Use standard_iv_increment_position for computing the bsi position
for create_iv.
@ -19,9 +24,10 @@
2005-02-13 Zdenek Dvorak <dvorakz@suse.cz>
PR target/17428
* cfgrtl.c (safe_insert_insn_on_edge): Avoid extending life range of hard
registers.
* value-prof.c (insn_prefetch_values_to_profile): Only scan normal insns.
* cfgrtl.c (safe_insert_insn_on_edge): Avoid extending
life range of hard registers.
* value-prof.c (insn_prefetch_values_to_profile): Only
scan normal insns.
* value-prof.c (rtl_find_values_to_profile): Do not look for values to
profile in libcalls.

View File

@ -1,3 +1,8 @@
2005-02-14 Diego Novillo <dnovillo@redhat.com>
PR tree-optimization/19853
* gcc.c-torture/compile/pr19853.c: New test.
2005-02-14 Nathan Sidwell <nathan@codesourcery.com>
PR c++/19608

View File

@ -0,0 +1,19 @@
struct test { int *x; } global_test;
int global_int;
int flag;
void test (char *dummy)
{
static const struct test const_test = { &global_int };
struct test local_test;
int i;
for (i = 0; i < 1; i++)
*dummy = 0;
if (flag)
__builtin_memset (dummy, 0, 16);
local_test = const_test;
global_test = local_test;
}

View File

@ -901,8 +901,7 @@ add_referenced_var (tree var, struct walk_state *walk_state)
/* Scan DECL_INITIAL for pointer variables as they may contain
address arithmetic referencing the address of other
variables. */
if (DECL_INITIAL (var)
&& POINTER_TYPE_P (TREE_TYPE (var)))
if (DECL_INITIAL (var))
walk_tree (&DECL_INITIAL (var), find_vars_r, walk_state, 0);
}
}