tree-ssa-pre.c (add_to_sets): s1 may be NULL.

2005-01-16  Daniel Berlin  <dberlin@dberlin.org>

	* tree-ssa-pre.c (add_to_sets): s1 may be NULL.
	(compute_avail): Uses don't go in tmp_gen.

From-SVN: r93749
This commit is contained in:
Daniel Berlin 2005-01-17 00:45:51 +00:00 committed by Daniel Berlin
parent 15ce652006
commit 7f233d9f54
4 changed files with 23 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2005-01-16 Daniel Berlin <dberlin@dberlin.org>
* tree-ssa-pre.c (add_to_sets): s1 may be NULL.
(compute_avail): Uses don't go in tmp_gen.
2005-01-16 Steven Bosscher <stevenb@suse.de>
* ggc-page.c (ggc_alloc_stat): Use __builtin_ctzl instead of a

View File

@ -0,0 +1,14 @@
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-pre-stats" } */
unsigned foo1 (unsigned a, unsigned b)
{
unsigned i, j, k;
for (i = 0; i != a; i++)
{
j += 4*b;
k += 4*a;
}
return j + k;
}
/* We should eliminate both 4*b and 4*a from the main body of the loop */
/* { dg-final { scan-tree-dump-times "Eliminated:2" 1 "pre"} } */

View File

@ -23,7 +23,7 @@ load_lib gcc-dg.exp
set DEFAULT_VECTCFLAGS ""
# These flags are used for all targets.
lappend DEFAULT_VECTCFLAGS "-O2" "-ftree-vectorize" "-fdump-tree-vect-stats"
lappend DEFAULT_VECTCFLAGS "-O2" "-ftree-vectorize" "-fdump-tree-vect-stats" "-fno-tree-pre"
# If the target system supports vector instructions, the default action
# for a test is 'run', otherwise it's 'compile'. Save current default.

View File

@ -1695,7 +1695,8 @@ add_to_sets (tree var, tree expr, vuse_optype vuses, bitmap_set_t s1,
if (var != expr)
vn_add (var, val, NULL);
bitmap_insert_into_set (s1, var);
if (s1)
bitmap_insert_into_set (s1, var);
bitmap_value_insert_into_set (s2, var);
}
@ -1881,8 +1882,7 @@ compute_avail (void)
for (j = 0; j < NUM_USES (STMT_USE_OPS (stmt)); j++)
{
tree use = USE_OP (STMT_USE_OPS (stmt), j);
add_to_sets (use, use, NULL, TMP_GEN (block),
AVAIL_OUT (block));
add_to_sets (use, use, NULL, NULL, AVAIL_OUT (block));
}
}