From: Richard Biener Date: Mon, 5 Jul 2021 09:53:07 +0000 (+0200) Subject: middle-end/101291 - set loop copy of versioned loop X-Git-Tag: upstream/12.2.0~6694 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=38872c6c0db1b10b17d3913b277c499913208d0b;p=platform%2Fupstream%2Fgcc.git middle-end/101291 - set loop copy of versioned loop This fixes the vectorizer loop versioning code failing to clear niter related info on the scalar loop as it assumed get_loop_copy would work even for the outermost loop. The patch makes that assumption hold by adjusting the loop versioning code. 2021-07-05 Richard Biener PR middle-end/101291 * cfgloopmanip.c (loop_version): Set the loop copy of the versioned loop to the new loop. --- diff --git a/gcc/cfgloopmanip.c b/gcc/cfgloopmanip.c index e6df280..2af59fe 100644 --- a/gcc/cfgloopmanip.c +++ b/gcc/cfgloopmanip.c @@ -1731,6 +1731,7 @@ loop_version (class loop *loop, then_scale, else_scale); copy_loop_info (loop, nloop); + set_loop_copy (loop, nloop); /* loopify redirected latch_edge. Update its PENDING_STMTS. */ lv_flush_pending_stmts (latch_edge);