aboutsummaryrefslogtreecommitdiff
path: root/gcc/match.pd
diff options
context:
space:
mode:
authorPrathamesh Kulkarni <prathamesh.kulkarni@linaro.org>2016-08-06 05:04:07 +0000
committerPrathamesh Kulkarni <prathamesh3492@gcc.gnu.org>2016-08-06 05:04:07 +0000
commit467719fbf259d4c8f01cd370b1de53043497024e (patch)
treed960feb43ecb26f38086a6e842c15adfc2f5f5d1 /gcc/match.pd
parente0f69f36ea1e068cb9aa48ea0d274b98530f2488 (diff)
downloadgcc-467719fbf259d4c8f01cd370b1de53043497024e.zip
gcc-467719fbf259d4c8f01cd370b1de53043497024e.tar.gz
gcc-467719fbf259d4c8f01cd370b1de53043497024e.tar.bz2
match.pd ((intptr_t) x eq/ne CST to x eq/ne (typeof x) cst): Disable transform if operand's type is pointer to function or method.
2016-08-06 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> * match.pd ((intptr_t) x eq/ne CST to x eq/ne (typeof x) cst): Disable transform if operand's type is pointer to function or method. From-SVN: r239190
Diffstat (limited to 'gcc/match.pd')
-rw-r--r--gcc/match.pd12
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/match.pd b/gcc/match.pd
index 2380d90d..ac7cfff 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -2528,12 +2528,18 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
{ neeq == EQ_EXPR ? boolean_false_node : boolean_true_node; })))
/* PR70920: Transform (intptr_t)x eq/ne CST to x eq/ne (typeof x) CST.
- and (typeof ptr_cst) x eq/ne ptr_cst to x eq/ne (typeof x) CST */
+ and (typeof ptr_cst) x eq/ne ptr_cst to x eq/ne (typeof x) CST.
+ Disable the transform if either operand is pointer to function.
+ This broke pr22051-2.c for arm where function pointer
+ canonicalizaion is not wanted. */
+
(for cmp (ne eq)
(simplify
(cmp (convert @0) INTEGER_CST@1)
- (if ((POINTER_TYPE_P (TREE_TYPE (@0)) && INTEGRAL_TYPE_P (TREE_TYPE (@1)))
- || (INTEGRAL_TYPE_P (TREE_TYPE (@0)) && POINTER_TYPE_P (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)))))
(cmp @0 (convert @1)))))
/* Non-equality compare simplifications from fold_binary */