On Fri, Jun 09, 2017 at 11:29:48AM +0200, Richard Biener wrote: > > force_gimple_operand_gsi called by update_range_test can using match.pd > > simplifications sometimes return INTEGER_CST (especially when cunroll > > unrolled code isn't really optimized by forwprop/ccp and similar passes > > before reassoc2), but that is something not acceptable to the rest of > > the optimize_range* code, because it needs to know not just the value, > > but also some gimple_stmt_iterator to insert related code etc. > > > > This patch makes sure we have a SSA_NAME even in that case. > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? > > Ok. > > In the end this results in a missed optimization downstream but I > guess we can't resolve this w/o major refactoring?
The constants should be propagated into uses soon afterwards, there is both forwprop and ccp shortly after the first reassoc pass and e.g. dom/vrp2 after second reassoc pass that should fix it up. Jakub