diff options
author | Jakub Jelinek <jakub@redhat.com> | 2018-04-19 09:46:54 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2018-04-19 09:46:54 +0200 |
commit | f53e7e138cf20f1a10fbcef2c14d838f494d4610 (patch) | |
tree | e92ff9b30968ce6b604216596e2a33ba4587ecdd /gcc/match.pd | |
parent | a0e1df888de5675d071239b1db57fd48d6ff47b7 (diff) | |
download | gcc-f53e7e138cf20f1a10fbcef2c14d838f494d4610.zip gcc-f53e7e138cf20f1a10fbcef2c14d838f494d4610.tar.gz gcc-f53e7e138cf20f1a10fbcef2c14d838f494d4610.tar.bz2 |
re PR tree-optimization/85446 (wrong-code on riscv64)
PR tree-optimization/85446
* match.pd ((intptr_t) x eq/ne CST to x eq/ne (typeof x) cst): Require
the integral and pointer types to have the same precision.
From-SVN: r259488
Diffstat (limited to 'gcc/match.pd')
-rw-r--r-- | gcc/match.pd | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/match.pd b/gcc/match.pd index 1bbf09f..442aad1 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -3711,10 +3711,13 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) (for cmp (ne eq) (simplify (cmp (convert @0) INTEGER_CST@1) - (if ((POINTER_TYPE_P (TREE_TYPE (@0)) && !FUNC_OR_METHOD_TYPE_P (TREE_TYPE (TREE_TYPE (@0))) - && INTEGRAL_TYPE_P (TREE_TYPE (@1))) - || (INTEGRAL_TYPE_P (TREE_TYPE (@0)) && POINTER_TYPE_P (TREE_TYPE (@1)) - && !FUNC_OR_METHOD_TYPE_P (TREE_TYPE (TREE_TYPE (@1))))) + (if (((POINTER_TYPE_P (TREE_TYPE (@0)) + && !FUNC_OR_METHOD_TYPE_P (TREE_TYPE (TREE_TYPE (@0))) + && INTEGRAL_TYPE_P (TREE_TYPE (@1))) + || (INTEGRAL_TYPE_P (TREE_TYPE (@0)) + && POINTER_TYPE_P (TREE_TYPE (@1)) + && !FUNC_OR_METHOD_TYPE_P (TREE_TYPE (TREE_TYPE (@1))))) + && TYPE_PRECISION (TREE_TYPE (@0)) == TYPE_PRECISION (TREE_TYPE (@1))) (cmp @0 (convert @1))))) /* Non-equality compare simplifications from fold_binary */ |