Hi, > It seems loop-iv.c happily creates shared RTL in lots of places, > loop-unroll.c solves that by unsharing everything it adds, this is > an attempt to do the same in unswitching to unshare everything iv_analyze > came up with. > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
I would suggest to move the unsharing to the point where it is clear that the rtl will added, i.e., loop-unswitch.c:370 nloop = unswitch_loop (loop, bbs[i], cond, cinsn); -> nloop = unswitch_loop (loop, bbs[i], copy_rtx_if_shared (cond), cinsn); Zdenek