new file mode 100644
@@ -0,0 +1,26 @@
+/* { dg-do run } */
+/* { dg-additional-options "-ftree-loop-distribution" } */
+
+extern void abort (void);
+
+signed char a, c;
+int b, d, *e = &d, g;
+signed static char f;
+int main() {
+ int h = 0;
+ int a_ = a;
+ for (; a_ < 1; a = ++a_) {
+ int *i[5], **j = &i[4], ***k[3][2] = {{&j}}, ****l = &k[2][1], *****m = &l;
+ char *n = &c;
+ f = *e = g = 0;
+ for (; g < 2; g++) {
+ for (b = 0; b < 3; b++)
+ h = (h && (*n = 0)) == 0;
+ if (g)
+ break;
+ }
+ }
+ if (f != 0)
+ abort ();
+ return 0;
+}
@@ -3203,6 +3203,16 @@ find_seed_stmts_for_distribution (class loop *loop, vec<gimple *> *work_list)
/* Initialize the worklist with stmts we seed the partitions with. */
for (unsigned i = 0; i < loop->num_nodes; ++i)
{
+ /* In irreducible sub-regions we don't know how to redirect
+ conditions, so fail. See PR100492. */
+ if (bbs[i]->flags & BB_IRREDUCIBLE_LOOP)
+ {
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file, "loop %d contains an irreducible region.\n",
+ loop->num);
+ work_list->truncate (0);
+ break;
+ }
for (gphi_iterator gsi = gsi_start_phis (bbs[i]);
!gsi_end_p (gsi); gsi_next (&gsi))
{