aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-phiopt.c
diff options
context:
space:
mode:
authorLi Jia He <helijia@linux.ibm.com>2019-05-06 06:00:03 +0000
committerLi Jia He <helijia@gcc.gnu.org>2019-05-06 06:00:03 +0000
commit94adc935af1e1e6a90c0d6127707f7b3a53b692d (patch)
treec087347418aaae4e42d5073352a705e1fc506f7b /gcc/tree-ssa-phiopt.c
parent3997383be17b15752a55f6af948ff3d33be57858 (diff)
downloadgcc-94adc935af1e1e6a90c0d6127707f7b3a53b692d.zip
gcc-94adc935af1e1e6a90c0d6127707f7b3a53b692d.tar.gz
gcc-94adc935af1e1e6a90c0d6127707f7b3a53b692d.tar.bz2
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
Diffstat (limited to 'gcc/tree-ssa-phiopt.c')
-rw-r--r--gcc/tree-ssa-phiopt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/tree-ssa-phiopt.c b/gcc/tree-ssa-phiopt.c
index 219791e..90674a2 100644
--- a/gcc/tree-ssa-phiopt.c
+++ b/gcc/tree-ssa-phiopt.c
@@ -602,7 +602,7 @@ two_value_replacement (basic_block cond_bb, basic_block middle_bb,
|| TREE_CODE (arg1) != INTEGER_CST
|| (tree_int_cst_lt (arg0, arg1)
? wi::to_widest (arg0) + 1 != wi::to_widest (arg1)
- : wi::to_widest (arg1) + 1 != wi::to_widest (arg1)))
+ : wi::to_widest (arg1) + 1 != wi::to_widest (arg0)))
return false;
if (!empty_block_p (middle_bb))