summaryrefslogtreecommitdiff
path: root/gcc/dojump.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2003-08-20 15:27:49 -0400
committerJason Merrill <jason@gcc.gnu.org>2003-08-20 15:27:49 -0400
commit2f5030259ccb5944c83dfd4c10306ae1844bec38 (patch)
tree5818d3a73137a0b34a7c1c1e65be34505d270b05 /gcc/dojump.c
parent47d4c811980d2793dc7502bd3949de2bac374304 (diff)
downloadgcc-2f5030259ccb5944c83dfd4c10306ae1844bec38.tar.gz
builtins.c (expand_builtin_mathfn): Use get_callee_fndecl.
* builtins.c (expand_builtin_mathfn): Use get_callee_fndecl. (expand_builtin_mathfn2, expand_builtin, builtin_mathfn_code, fold_trunc_transparent_mathfn, fold_builtin): Likewise. * dojump.c (do_jump): Likewise. * fold-const.c (operand_equal_p, fold): Likewise. (tree_expr_nonnegative_p): Likewise. From-SVN: r70611
Diffstat (limited to 'gcc/dojump.c')
-rw-r--r--gcc/dojump.c41
1 files changed, 20 insertions, 21 deletions
diff --git a/gcc/dojump.c b/gcc/dojump.c
index c213cd0e967..2ed014bacf9 100644
--- a/gcc/dojump.c
+++ b/gcc/dojump.c
@@ -530,27 +530,26 @@ do_jump (tree exp, rtx if_false_label, rtx if_true_label)
operation produced a 1 or 0. */
case CALL_EXPR:
/* Check for a built-in function. */
- if (TREE_CODE (TREE_OPERAND (exp, 0)) == ADDR_EXPR)
- {
- tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0);
- tree arglist = TREE_OPERAND (exp, 1);
-
- if (TREE_CODE (fndecl) == FUNCTION_DECL
- && DECL_BUILT_IN (fndecl)
- && DECL_FUNCTION_CODE (fndecl) == BUILT_IN_EXPECT
- && arglist != NULL_TREE
- && TREE_CHAIN (arglist) != NULL_TREE)
- {
- rtx seq = expand_builtin_expect_jump (exp, if_false_label,
- if_true_label);
-
- if (seq != NULL_RTX)
- {
- emit_insn (seq);
- return;
- }
- }
- }
+ {
+ tree fndecl = get_callee_fndecl (exp);
+ tree arglist = TREE_OPERAND (exp, 1);
+
+ if (fndecl
+ && DECL_BUILT_IN (fndecl)
+ && DECL_FUNCTION_CODE (fndecl) == BUILT_IN_EXPECT
+ && arglist != NULL_TREE
+ && TREE_CHAIN (arglist) != NULL_TREE)
+ {
+ rtx seq = expand_builtin_expect_jump (exp, if_false_label,
+ if_true_label);
+
+ if (seq != NULL_RTX)
+ {
+ emit_insn (seq);
+ return;
+ }
+ }
+ }
/* Fall through and generate the normal code. */
default: