Fix a typo in two_value_replacement function
authorLi Jia He <helijia@linux.ibm.com>
Mon, 6 May 2019 06:00:03 +0000 (06:00 +0000)
committerLi Jia He <helijia@gcc.gnu.org>
Mon, 6 May 2019 06:00:03 +0000 (06:00 +0000)
commit94adc935af1e1e6a90c0d6127707f7b3a53b692d
treec087347418aaae4e42d5073352a705e1fc506f7b
parent3997383be17b15752a55f6af948ff3d33be57858
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-06  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: r270894
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