+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.
+
2016-08-05 Patrick Palka <ppalka@gcc.gnu.org>
PR tree-optimization/18046
{ 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 */