OSDN Git Service

* calls.c (expand_call): Check DECL_BUILT_IN_CLASS before
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 18 Jan 2005 23:06:59 +0000 (23:06 +0000)
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 18 Jan 2005 23:06:59 +0000 (23:06 +0000)
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: svn+ssh://gcc.gnu.org/svn/gcc/trunk@93864 138bc75d-0d04-0410-961f-82ee72b054a4

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 a8c2a0a..aa1a181 100644 (file)
@@ -1,5 +1,18 @@
 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.
index 72cba49..9e228ac 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 650e51a..c10ea39 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 f22411d..cdefe76 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 29c733b..d86379c 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 daf9839..c6e9b7d 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 a578e1c..247c687 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 05970f8..d032fee 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;