Fix a typo in two_value_replacement function
authorLi Jia He <helijia@linux.ibm.com>
Tue, 7 May 2019 05:39:01 +0000 (05:39 +0000)
committerLi Jia He <helijia@gcc.gnu.org>
Tue, 7 May 2019 05:39:01 +0000 (05:39 +0000)
commitb65307e96ef90ce24de6b33af765977c2bc88d17
tree33713d11b52a1900863265277464bd4401aa551e
parentcaa3bffa03aedb538809aa36cab8e9441fe79e55
Fix a typo in two_value_replacement function

GCC revision 267634 implemented two_value_replacement function.
However, a typo occurred during the parameter check, which caused
us to miss some optimizations.

The intent of the code might be to check that the input parameters
are const int and their difference is one.  However, when I read
the code, I found that it is wrong to detect whether an input data
plus one is equal to itself.  This could be a typo.

2019-05-07  Li Jia He  <helijia@linux.ibm.com>

* tree-ssa-phiopt.c (two_value_replacement): Fix a typo in parameter
detection.
* gcc.dg/tree-ssa/pr37508.c: Add the no-ssa-phiopt option to skip phi
optimization.
* gcc.dg/tree-ssa/pr88676-2.c: New testcase.

From-SVN: r270934
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/pr37508.c
gcc/testsuite/gcc.dg/tree-ssa/pr88676-2.c [new file with mode: 0644]
gcc/tree-ssa-phiopt.c