diff options
Diffstat (limited to 'gcc/tree-ssa-dom.c')
-rw-r--r-- | gcc/tree-ssa-dom.c | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c index 0f649f3..2e9498e 100644 --- a/gcc/tree-ssa-dom.c +++ b/gcc/tree-ssa-dom.c @@ -64,7 +64,7 @@ struct hashable_expr struct { enum tree_code op; tree opnd; } unary; struct { enum tree_code op; tree opnd0, opnd1; } binary; struct { enum tree_code op; tree opnd0, opnd1, opnd2; } ternary; - struct { tree fn; bool pure; size_t nargs; tree *args; } call; + struct { gimple fn_from; bool pure; size_t nargs; tree *args; } call; } ops; }; @@ -258,7 +258,7 @@ initialize_hash_element (gimple stmt, tree lhs, expr->type = TREE_TYPE (gimple_call_lhs (stmt)); expr->kind = EXPR_CALL; - expr->ops.call.fn = gimple_call_fn (stmt); + expr->ops.call.fn_from = stmt; if (gimple_call_flags (stmt) & (ECF_CONST | ECF_PURE)) expr->ops.call.pure = true; @@ -422,8 +422,8 @@ hashable_expr_equal_p (const struct hashable_expr *expr0, /* If the calls are to different functions, then they clearly cannot be equal. */ - if (! operand_equal_p (expr0->ops.call.fn, - expr1->ops.call.fn, 0)) + if (!gimple_call_same_target_p (expr0->ops.call.fn_from, + expr1->ops.call.fn_from)) return false; if (! expr0->ops.call.pure) @@ -503,9 +503,15 @@ iterative_hash_hashable_expr (const struct hashable_expr *expr, hashval_t val) { size_t i; enum tree_code code = CALL_EXPR; + gimple fn_from; val = iterative_hash_object (code, val); - val = iterative_hash_expr (expr->ops.call.fn, val); + fn_from = expr->ops.call.fn_from; + if (gimple_call_internal_p (fn_from)) + val = iterative_hash_hashval_t + ((hashval_t) gimple_call_internal_fn (fn_from), val); + else + val = iterative_hash_expr (gimple_call_fn (fn_from), val); for (i = 0; i < expr->ops.call.nargs; i++) val = iterative_hash_expr (expr->ops.call.args[i], val); } @@ -565,8 +571,14 @@ print_expr_hash_elt (FILE * stream, const struct expr_hash_elt *element) { size_t i; size_t nargs = element->expr.ops.call.nargs; - - print_generic_expr (stream, element->expr.ops.call.fn, 0); + gimple fn_from; + + fn_from = element->expr.ops.call.fn_from; + if (gimple_call_internal_p (fn_from)) + fputs (internal_fn_name (gimple_call_internal_fn (fn_from)), + stream); + else + print_generic_expr (stream, gimple_call_fn (fn_from), 0); fprintf (stream, " ("); for (i = 0; i < nargs; i++) { |