aboutsummaryrefslogtreecommitdiff
path: root/gcc/predict.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@libertysurf.fr>2005-01-18 23:06:59 +0000
committerEric Botcazou <ebotcazou@libertysurf.fr>2005-01-18 23:06:59 +0000
commita6abbac0a1446bb7083d8f6df06acbc405cf37f5 (patch)
treeb422c0dfed9c70d016f242be350aaef240a4c22d /gcc/predict.c
parent8c804d851cf2c3fcd32d986fcd8bb5d203f2aca5 (diff)
* calls.c (expand_call): Check DECL_BUILT_IN_CLASS before
accessing DECL_FUNCTION_CODE. * dojump.c (do_jump): Likewise. * gimplify.c (gimplify_call_expr): Likewise. * predict.c (expr_expected_value): Likewise. (strip_builtin_expect): Likewise. * tree-inline.c (estimate_num_insns_1): Likewise. * tree-ssa-loop-im.c (stmt_cost): Likewise * fold-const.c (fold): Test for BUILT_IN_NORMAL. (tree_expr_nonnegative_p): Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@93864 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/predict.c')
-rw-r--r--gcc/predict.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/predict.c b/gcc/predict.c
index daf98398f29..c6e9b7dfe71 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -947,7 +947,8 @@ expr_expected_value (tree expr, bitmap visited)
tree decl = get_callee_fndecl (expr);
if (!decl)
return NULL;
- if (DECL_BUILT_IN (decl) && DECL_FUNCTION_CODE (decl) == BUILT_IN_EXPECT)
+ if (DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL
+ && DECL_FUNCTION_CODE (decl) == BUILT_IN_EXPECT)
{
tree arglist = TREE_OPERAND (expr, 1);
tree val;
@@ -1006,7 +1007,7 @@ strip_builtin_expect (void)
if (TREE_CODE (stmt) == MODIFY_EXPR
&& TREE_CODE (TREE_OPERAND (stmt, 1)) == CALL_EXPR
&& (fndecl = get_callee_fndecl (TREE_OPERAND (stmt, 1)))
- && DECL_BUILT_IN (fndecl)
+ && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL
&& DECL_FUNCTION_CODE (fndecl) == BUILT_IN_EXPECT
&& (arglist = TREE_OPERAND (TREE_OPERAND (stmt, 1), 1))
&& TREE_CHAIN (arglist))