Commit 1691b2e1 by Tom de Vries Committed by Tom de Vries

Handle internal_fn in operand_equal_p

2015-04-17  Tom de Vries  <tom@codesourcery.com>

	* fold-const.c (operand_equal_p): Handle INTERNAL_FNs.
	* calls.c (call_expr_flags): Same.

From-SVN: r222172
parent 302f0807
2015-04-17 Tom de Vries <tom@codesourcery.com> 2015-04-17 Tom de Vries <tom@codesourcery.com>
* fold-const.c (operand_equal_p): Handle INTERNAL_FNs.
* calls.c (call_expr_flags): Same.
2015-04-17 Tom de Vries <tom@codesourcery.com>
* tree-stdarg.c (optimize_va_list_gpr_fpr_size): Factor out of ... * tree-stdarg.c (optimize_va_list_gpr_fpr_size): Factor out of ...
(pass_stdarg::execute): ... here. (pass_stdarg::execute): ... here.
......
...@@ -847,6 +847,8 @@ call_expr_flags (const_tree t) ...@@ -847,6 +847,8 @@ call_expr_flags (const_tree t)
if (decl) if (decl)
flags = flags_from_decl_or_type (decl); flags = flags_from_decl_or_type (decl);
else if (CALL_EXPR_FN (t) == NULL_TREE)
flags = internal_fn_flags (CALL_EXPR_IFN (t));
else else
{ {
t = TREE_TYPE (CALL_EXPR_FN (t)); t = TREE_TYPE (CALL_EXPR_FN (t));
......
...@@ -3045,11 +3045,26 @@ operand_equal_p (const_tree arg0, const_tree arg1, unsigned int flags) ...@@ -3045,11 +3045,26 @@ operand_equal_p (const_tree arg0, const_tree arg1, unsigned int flags)
switch (TREE_CODE (arg0)) switch (TREE_CODE (arg0))
{ {
case CALL_EXPR: case CALL_EXPR:
/* If the CALL_EXPRs call different functions, then they if ((CALL_EXPR_FN (arg0) == NULL_TREE)
clearly can not be equal. */ != (CALL_EXPR_FN (arg1) == NULL_TREE))
if (! operand_equal_p (CALL_EXPR_FN (arg0), CALL_EXPR_FN (arg1), /* If not both CALL_EXPRs are either internal or normal function
flags)) functions, then they are not equal. */
return 0; return 0;
else if (CALL_EXPR_FN (arg0) == NULL_TREE)
{
/* If the CALL_EXPRs call different internal functions, then they
are not equal. */
if (CALL_EXPR_IFN (arg0) != CALL_EXPR_IFN (arg1))
return 0;
}
else
{
/* If the CALL_EXPRs call different functions, then they are not
equal. */
if (! operand_equal_p (CALL_EXPR_FN (arg0), CALL_EXPR_FN (arg1),
flags))
return 0;
}
{ {
unsigned int cef = call_expr_flags (arg0); unsigned int cef = call_expr_flags (arg0);
......
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