https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89779
--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> --- Author: rguenth Date: Mon Mar 25 12:18:38 2019 New Revision: 269914 URL: https://gcc.gnu.org/viewcvs?rev=269914&root=gcc&view=rev Log: 2019-03-25 Richard Biener <rguent...@suse.de> PR tree-optimization/89779 * tree-ssa-loop-ivopts.c (remove_unused_ivs): Return to remove IV defs, delay actual removal. (tree_ssa_iv_optimize_loop): Likewise. Avoid SCEV reset. (tree_ssa_iv_optimize): Remove eliminated IV defs at the very end, properly also reset loop control IV information. Modified: trunk/gcc/ChangeLog trunk/gcc/tree-ssa-loop-ivopts.c