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: releases/gcc-11.2.0~77 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5df86357becfc5c3a676b9f506bf2c1c625306f2;p=thirdparty%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. (cherry picked from commit 38872c6c0db1b10b17d3913b277c499913208d0b) --- diff --git a/gcc/cfgloopmanip.c b/gcc/cfgloopmanip.c index 4a9ab74642c5..99a88b855e11 100644 --- a/gcc/cfgloopmanip.c +++ b/gcc/cfgloopmanip.c @@ -1733,6 +1733,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);