On Mon, Jun 29, 2020 at 08:58:57AM +0200, Richard Biener via Gcc-patches wrote: > Most of the cases I've seen involve transforms that make _b_c_p constant > on one path and then introduce a new PHI merging two _b_c_p values > to be then tested in a not simplified condition. I'm not sure how to fend > off jump threading (yeah, it's nearly always jump threading doing this...) > doing this but certainly the easiest way would be to simply disallow > [jump threading] from duplicating _b_c_p calls. > > Or fold _b_c_p even earlier (though I definitely saw early backwards > jump threading mess up such a case).
Yeah, perhaps disallow duplicating bcp calls in the threading before IPA (for bcp to work well, we want to preserve it until inlining had a chance to propagate constants in there) and after IPA allow that, but just fold them into 0 during that on both paths. Jakub