is in VISITED_BBs
PR tree-optimization/68013
* tree-ssa-threadbackward.c
(fsm_find_control_statement_thread_paths): Make sure the first block
in the path is in VISITED_BBs.
PR tree-optimization/68013
* gcc.c-torture/compile/pr68013.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229375
138bc75d-0d04-0410-961f-
82ee72b054a4
+2015-10-26 Jeff Law <law@redhat.com>
+
+ PR tree-optimization/68013
+ * tree-ssa-threadbackward.c
+ (fsm_find_control_statement_thread_paths): Make sure the first block
+ in the path is in VISITED_BBs.
+
2015-10-26 Richard Biener <rguenther@suse.de>
Dominik Vogt <vogt@linux.vnet.ibm.com>
+2015-10-26 Jeff Law <law@redhat.com>
+
+ PR tree-optimization/68013
+ * gcc.c-torture/compile/pr68013.c: New test.
+
2015-10-26 Richard Biener <rguenther@suse.de>
Dominik Vogt <vogt@linux.vnet.ibm.com>
--- /dev/null
+int a, b, c, d, e, f;
+
+void
+fn1 ()
+{
+ for (; e;)
+ {
+ e = f;
+ for (; b;)
+ {
+ b = a;
+ f = a || d ? 0 : c;
+ }
+ d = 0;
+ }
+}
vec<basic_block, va_gc> *next_path;
vec_alloc (next_path, n_basic_blocks_for_fn (cfun));
+ /* When VAR_BB == LAST_BB_IN_PATH, then the first block in the path
+ will already be in VISITED_BBS. When they are not equal, then we
+ must ensure that first block is accounted for to ensure we do not
+ create bogus jump threading paths. */
+ visited_bbs->add ((*path)[0]);
FOR_EACH_EDGE (e, ei, last_bb_in_path->preds)
{
hash_set<basic_block> *visited_bbs = new hash_set<basic_block>;