This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH][match-and-simplify] Change back default behavior of fold_stmt
- From: Richard Biener <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 14 Oct 2014 14:58:37 +0200 (CEST)
- Subject: Re: [PATCH][match-and-simplify] Change back default behavior of fold_stmt
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot LSU dot 2 dot 11 dot 1410140948110 dot 20733 at zhemvz dot fhfr dot qr>
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
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.