Commit 467719fb by Prathamesh Kulkarni Committed by Prathamesh Kulkarni

match.pd ((intptr_t) x eq/ne CST to x eq/ne (typeof x) cst): Disable transform…

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
parent e0f69f36
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
......
......@@ -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 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment