On Tue, 14 Oct 2014, Richard Biener wrote: > > This changes default behavior of fold_stmt back to _not_ following > SSA use-def chains when trying to simplify things. I had to force > that already for one caller and for the merge to trunk I'd rather > not track down issues in every other existing caller. > > This means that fold_stmt will not become more powerful, at least for now. > I still hope to get rid of its use of fold() during the merge process. > > Bootstrap and regtest ongoing on x86_64-unknown-linux-gnu. > > (yeah, I'm preparing a first batch of changes to merge from the > branch)
Unfortunately this exposes an issue with combining our SSA propagators with pattern matching which makes us miscompile tree-vect-generic.c from VRP. Consider Visiting PHI node: i_137 = PHI <0(51), i_48(63)> Argument #0 (51 -> 52 executable) 0: [0, 0] Argument #1 (63 -> 52 not executable) Found new range for i_137: [0, 0] ... i_48 = delta_25 + i_137; Found new range for i_48: VARYING _67 = (unsigned int) delta_25; Found new range for _67: [0, +INF] _78 = (unsigned int) i_48; Found new range for _78: [0, +INF] _257 = _78 - _67; (unsigned int) (delta_25 + i_137) - (unsigned int) delta_25 Match-and-simplified _78 - _67 to 0 Found new range for _257: [0, 0] now after i_137 is revisited and it becomes VARYING the SSA propagator stops at i_48 because its value does not change. Thus it fails to re-visit _257 where a pattern was applied that used the optimistic value of i_137 to its advantage. The following patch makes sure SSA propagators (CCP and VRP) do not get any benefit during their propagation phase from match-and-simplify by disabling the following of SSA use-def edges. Bootstrapped on x86_64-unknown-linux-gnu, testing in progress. Richard.