+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
--- /dev/null
+/* { 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"} } */
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.
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);
}
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));
}
}