aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-phinodes.c
diff options
context:
space:
mode:
authorAndrew Pinski <apinski@marvell.com>2021-09-06 00:52:18 +0000
committerAndrew Pinski <apinski@marvell.com>2021-09-06 07:45:06 +0000
commit564efbf40077c25623cdd6ce2f911c56b5b08f6c (patch)
tree8bf0eedcb74c2c09f50af6cac6a39fff122e7e42 /gcc/tree-phinodes.c
parent637dfcf43cfd2f01f4757abfd84d376d4011b0b2 (diff)
downloadgcc-564efbf40077c25623cdd6ce2f911c56b5b08f6c.zip
gcc-564efbf40077c25623cdd6ce2f911c56b5b08f6c.tar.gz
gcc-564efbf40077c25623cdd6ce2f911c56b5b08f6c.tar.bz2
Fix PR tree-optimization/63184: add simplification of (& + A) != (& + B)
These two testcases have been failing since GCC 5 but things have improved such that adding a simplification to match.pd for this case is easier than before. In the end we have the following IR: .... _5 = &a[1] + _4; _7 = &a + _13; if (_5 != _7) So we can fold the _5 != _7 into: (&a[1] - &a) + _4 != _13 The subtraction is folded into constant by ptr_difference_const. In this case, the full expression gets folded into a constant and we are able to remove the if statement. OK? Bootstrapped and tested on aarch64-linux-gnu with no regressions. gcc/ChangeLog: PR tree-optimization/63184 * match.pd: Add simplification of pointer_diff of two pointer_plus with addr_expr in the first operand of each pointer_plus. Add simplificatoin of ne/eq of two pointer_plus with addr_expr in the first operand of each pointer_plus. gcc/testsuite/ChangeLog: PR tree-optimization/63184 * c-c++-common/pr19807-2.c: Enable for all targets and remove the xfail. * c-c++-common/pr19807-3.c: Likewise.
Diffstat (limited to 'gcc/tree-phinodes.c')
0 files changed, 0 insertions, 0 deletions