+2016-07-11 David Malcolm <dmalcolm@redhat.com>
+
+ * Makefile.in (selftest-valgrind): New phony target.
+ * function-tests.c (selftest::build_cfg): Delete pass instances
+ created by the test.
+ (selftest::convert_to_ssa): Likewise.
+ (selftest::test_expansion_to_rtl): Likewise.
+ * tree-cfg.c (selftest::test_linear_chain): Release dominator
+ vectors.
+ (selftest::test_diamond): Likewise.
+
2016-07-11 Richard Biener <rguenther@suse.de>
PR tree-optimization/71816
selftest-gdb: $(GCC_PASSES) cc1$(exeext) stmp-int-hdrs
$(GCC_FOR_TARGET) -xc -S -c /dev/null -fself-test -wrapper gdb,--args
+# Convenience method for running selftests under valgrind:
+.PHONY: selftest-valgrind
+selftest-valgrind: $(GCC_PASSES) cc1$(exeext) stmp-int-hdrs
+ $(GCC_FOR_TARGET) -xc -S -c /dev/null -fself-test \
+ -wrapper valgrind,--leak-check=full
+
# Recompile all the language-independent object files.
# This is used only if the user explicitly asks for it.
compilations: $(BACKEND)
push_cfun (fun);
lower_cf_pass->execute (fun);
pop_cfun ();
+ delete lower_cf_pass;
/* We can now convert to CFG form; for our trivial test function this
gives us:
push_cfun (fun);
build_cfg_pass->execute (fun);
pop_cfun ();
+ delete build_cfg_pass;
}
/* Convert a gimple+CFG function to SSA form. */
push_cfun (fun);
build_ssa_pass->execute (fun);
pop_cfun ();
+ delete build_ssa_pass;
}
/* Assuming we have a simple 3-block CFG like this:
init_function_start (fndecl);
expand_pass->execute (fun);
pop_cfun ();
+ delete expand_pass;
/* On x86_64, I get this:
(note 3 1 2 2 [bb 2] NOTE_INSN_BASIC_BLOCK)
ASSERT_EQ (1, dom_by_b.length ());
ASSERT_EQ (bb_c, dom_by_b[0]);
free_dominance_info (CDI_DOMINATORS);
+ dom_by_b.release ();
/* Similarly for post-dominance: each BB in our chain is post-dominated
by the one after it. */
ASSERT_EQ (1, postdom_by_b.length ());
ASSERT_EQ (bb_a, postdom_by_b[0]);
free_dominance_info (CDI_POST_DOMINATORS);
+ postdom_by_b.release ();
pop_cfun ();
}
ASSERT_EQ (bb_a, get_immediate_dominator (CDI_DOMINATORS, bb_d));
vec<basic_block> dom_by_a = get_dominated_by (CDI_DOMINATORS, bb_a);
ASSERT_EQ (3, dom_by_a.length ()); /* B, C, D, in some order. */
+ dom_by_a.release ();
vec<basic_block> dom_by_b = get_dominated_by (CDI_DOMINATORS, bb_b);
ASSERT_EQ (0, dom_by_b.length ());
+ dom_by_b.release ();
free_dominance_info (CDI_DOMINATORS);
/* Similarly for post-dominance. */
ASSERT_EQ (bb_d, get_immediate_dominator (CDI_POST_DOMINATORS, bb_c));
vec<basic_block> postdom_by_d = get_dominated_by (CDI_POST_DOMINATORS, bb_d);
ASSERT_EQ (3, postdom_by_d.length ()); /* A, B, C in some order. */
+ postdom_by_d.release ();
vec<basic_block> postdom_by_b = get_dominated_by (CDI_POST_DOMINATORS, bb_b);
ASSERT_EQ (0, postdom_by_b.length ());
+ postdom_by_b.release ();
free_dominance_info (CDI_POST_DOMINATORS);
pop_cfun ();