https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77362
Martin Liška <marxin at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |marxin at gcc dot gnu.org --- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> --- Problem is that original PHI node that we want to copy lives in a single loop: <bb 12>: _13 = f2_lsm.11_24 + 2; _59 = (unsigned short) f2_lsm.11_24; _20 = _59 + 2; _58 = (unsigned short) _20; _21 = (short int) _58; if (_21 >= 0) goto <bb 7>; else goto <bb 8>; <bb 7>: hm.8_8 = (unsigned short) _21; _9 = hm.8_8 + 1; _10 = (short int) _9; <bb 8>: # hm_lsm.13_12 = PHI <_21(12), _10(7)> k1_22 = k1_28 + 1; if (k1_22 != 2) goto <bb 9>; else goto <bb 10>; So applying following patch would trigger that earlier: diff --git a/gcc/graphite-isl-ast-to-gimple.c b/gcc/graphite-isl-ast-to-gimple.c index fb9c8468ebc..b3f72010507 100644 --- a/gcc/graphite-isl-ast-to-gimple.c +++ b/gcc/graphite-isl-ast-to-gimple.c @@ -1826,7 +1826,7 @@ get_loc (tree op) std::pair<edge, edge> get_edges (basic_block bb) { - std::pair<edge, edge> edges; + std::pair<edge, edge> edges (NULL, NULL); edge e; edge_iterator ei; FOR_EACH_EDGE (e, ei, bb->preds) @@ -1834,14 +1834,17 @@ get_edges (basic_block bb) edges.first = e; else edges.second = e; + + gcc_checking_assert (edges.first != NULL); + gcc_checking_assert (edges.second != NULL); + return edges; } As I've been reading the transformed loop nest, I don't know how to fix that copied PHI.