calls.c (expand_call): Check DECL_BUILT_IN_CLASS before accessing DECL_FUNCTION_CODE.
authorEric Botcazou <ebotcazou@libertysurf.fr>
Tue, 18 Jan 2005 23:06:59 +0000 (00:06 +0100)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Tue, 18 Jan 2005 23:06:59 +0000 (23:06 +0000)
* 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.

From-SVN: r93864

gcc/ChangeLog
gcc/calls.c
gcc/dojump.c
gcc/fold-const.c
gcc/gimplify.c
gcc/predict.c
gcc/tree-inline.c
gcc/tree-ssa-loop-im.c

index a8c2a0a87b028ca190d0e0779069dbb5ace8c242..aa1a18106dd826b7c2335f09198b3056936f9ef6 100644 (file)
@@ -1,3 +1,16 @@
+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
index 72cba4914036016165950adb81f3384fabac5375..9e228ac0e3f2671deb0e05b44e01812a39f80165 100644 (file)
@@ -2722,7 +2722,7 @@ expand_call (tree exp, rtx target, int ignore)
              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))
index 650e51aeb1408fc6477ff1dcd6550b475750b5b4..c10ea39c36684be855359288e0b9142ab4c1d478 100644 (file)
@@ -527,7 +527,7 @@ do_jump (tree exp, rtx if_false_label, rtx if_true_label)
        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)
index f22411d924e55edd63c7afa0025ff42f4f0ffa50..cdefe7611fb2f1408209b990dde8c6a3d4425b7c 100644 (file)
@@ -8982,8 +8982,7 @@ fold (tree expr)
          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
@@ -9809,9 +9808,7 @@ tree_expr_nonnegative_p (tree t)
       {
        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) \
index 29c733bd52e860cb98ad3e4954621a3f021635a2..d86379ca2c82886600bf7ba53750a22418ae4e26 100644 (file)
@@ -1748,7 +1748,8 @@ gimplify_call_expr (tree *expr_p, tree *pre_p, bool want_value)
          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);
          
index daf98398f299ed9ae011f7792f524d24062ab716..c6e9b7dfe71f2fdc5dc1fdc1b5d0817205a9c8a6 100644 (file)
@@ -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))
index a578e1cad84a0ba6f247b4b01318ba1b7ce6540a..247c6873e4d465fced01fc87d263e8ea0458e299 100644 (file)
@@ -1348,7 +1348,7 @@ estimate_num_insns_1 (tree *tp, int *walk_subtrees, void *data)
       {
        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:
index 05970f8d2e1b6f7c10ae590650311731297df792..d032fee28e8d772562f3b5bd314b3e043069bd76 100644 (file)
@@ -376,7 +376,7 @@ stmt_cost (tree stmt)
       /* 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;