2005-01-18 Eric Botcazou <ebotcazou@libertysurf.fr>
+ * 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.
+
+2005-01-18 Eric Botcazou <ebotcazou@libertysurf.fr>
+
* config/sparc/sparc.c (load_pic_register): Emit the appropriate
variant of the load_pcrel_sym pattern.
* config/sparc/sparc.md (P macro): Move to the top.
end_sequence ();
if (flag_unsafe_math_optimizations
&& fndecl
- && DECL_BUILT_IN (fndecl)
+ && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL
&& (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_SQRT
|| DECL_FUNCTION_CODE (fndecl) == BUILT_IN_SQRTF
|| DECL_FUNCTION_CODE (fndecl) == BUILT_IN_SQRTL))
tree arglist = TREE_OPERAND (exp, 1);
if (fndecl
- && DECL_BUILT_IN (fndecl)
+ && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL
&& DECL_FUNCTION_CODE (fndecl) == BUILT_IN_EXPECT
&& arglist != NULL_TREE
&& TREE_CHAIN (arglist) != NULL_TREE)
tree arglist;
if (fndecl
- && DECL_BUILT_IN (fndecl)
- && DECL_BUILT_IN_CLASS (fndecl) != BUILT_IN_MD
+ && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL
&& DECL_FUNCTION_CODE (fndecl) == BUILT_IN_STRLEN
&& (arglist = TREE_OPERAND (arg0, 1))
&& TREE_CODE (TREE_TYPE (TREE_VALUE (arglist))) == POINTER_TYPE
{
tree fndecl = get_callee_fndecl (t);
tree arglist = TREE_OPERAND (t, 1);
- if (fndecl
- && DECL_BUILT_IN (fndecl)
- && DECL_BUILT_IN_CLASS (fndecl) != BUILT_IN_MD)
+ if (fndecl && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL)
switch (DECL_FUNCTION_CODE (fndecl))
{
#define CASE_BUILTIN_F(BUILT_IN_FN) \
return GS_OK;
}
- if (DECL_FUNCTION_CODE (decl) == BUILT_IN_VA_START)
+ if (DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL
+ && DECL_FUNCTION_CODE (decl) == BUILT_IN_VA_START)
{
tree arglist = TREE_OPERAND (*expr_p, 1);
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;
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))
{
tree decl = get_callee_fndecl (x);
- if (decl && DECL_BUILT_IN (decl))
+ if (decl && DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL)
switch (DECL_FUNCTION_CODE (decl))
{
case BUILT_IN_CONSTANT_P:
/* Unless the call is a builtin_constant_p; this always folds to a
constant, so moving it is useless. */
rhs = get_callee_fndecl (rhs);
- if (DECL_BUILT_IN (rhs)
+ if (DECL_BUILT_IN_CLASS (rhs) == BUILT_IN_NORMAL
&& DECL_FUNCTION_CODE (rhs) == BUILT_IN_CONSTANT_P)
return 0;