This adds EDGE_COPY_SRC_JOINER_BLOCK sources to the set of blocks
we need to check we can duplicate.
PR tree-optimization/106497
* tree-ssa-threadupdate.cc (fwd_jt_path_registry::update_cfg):
Also verify we can copy EDGE_COPY_SRC_JOINER_BLOCK.
* gcc.dg/torture/pr106497.c: New testcase.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-additional-options "-fno-tree-dce" } */
+
+int n;
+
+__attribute__ ((pure,returns_twice)) int
+bar (void);
+
+int
+foo (int x)
+{
+ n = 0;
+
+ bar ();
+
+ if (x && n)
+ return 0;
+
+ foo (x);
+}
{
edge e = (*path)[j]->e;
if (m_removed_edges->find_slot (e, NO_INSERT)
- || ((*path)[j]->type == EDGE_COPY_SRC_BLOCK
+ || (((*path)[j]->type == EDGE_COPY_SRC_BLOCK
+ || (*path)[j]->type == EDGE_COPY_SRC_JOINER_BLOCK)
&& !can_duplicate_block_p (e->src)))
break;
}