2004-05-28 Andrew Pinski <pinskia@physics.uc.edu>
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 28 May 2004 20:32:20 +0000 (20:32 +0000)
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 28 May 2004 20:32:20 +0000 (20:32 +0000)
        * c-common.c (c_estimate_num_insns_1): Kill.
        (c_estimate_num_insns): Kill.
        * c-common.h (c_estimate_num_insns): Kill.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82377 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/c-common.c
gcc/c-common.h

index ec27003..4f7f078 100644 (file)
@@ -1,10 +1,14 @@
 2004-05-28  Andrew Pinski  <pinskia@physics.uc.edu>
 
-        * gthr-posix.h: Check for _POSIX_PRIORITY_SCHEDULING
-        when checking for _POSIX_THREAD_PRIORITY_SCHEDULING.
-        Remove comment about not checking for
-        _POSIX_PRIORITY_SCHEDULING.
-        * gthr-posix.c: Likewise.
+       * c-common.c (c_estimate_num_insns_1): Kill.
+       (c_estimate_num_insns): Kill.
+       * c-common.h (c_estimate_num_insns): Kill.
+
+       * gthr-posix.h: Check for _POSIX_PRIORITY_SCHEDULING
+       when checking for _POSIX_THREAD_PRIORITY_SCHEDULING.
+       Remove comment about not checking for
+       _POSIX_PRIORITY_SCHEDULING.
+       * gthr-posix.c: Likewise.
 
 2004-05-28  Paolo Bonzini  <bonzini@gnu.org>
            Roger Sayle  <roger@eyesopen.com>
index 7f1e07a..4aa17e6 100644 (file)
@@ -5758,131 +5758,6 @@ resort_sorted_fields (void *obj,
         resort_field_decl_cmp);
 }
 
-/* Used by estimate_num_insns.  Estimate number of instructions seen
-   by given statement.  */
-static tree
-c_estimate_num_insns_1 (tree *tp, int *walk_subtrees, void *data)
-{
-  int *count = data;
-  tree x = *tp;
-
-  if (TYPE_P (x) || DECL_P (x))
-    {
-      *walk_subtrees = 0;
-      return NULL;
-    }
-  /* Assume that constants and references counts nothing.  These should
-     be majorized by amount of operations among them we count later
-     and are common target of CSE and similar optimizations.  */
-  if (TREE_CODE_CLASS (TREE_CODE (x)) == 'c'
-      || TREE_CODE_CLASS (TREE_CODE (x)) == 'r')
-    return NULL;
-  switch (TREE_CODE (x))
-    { 
-    /* Recognize assignments of large structures and constructors of
-       big arrays.  */
-    case MODIFY_EXPR:
-    case CONSTRUCTOR:
-      {
-       HOST_WIDE_INT size;
-
-       size = int_size_in_bytes (TREE_TYPE (x));
-
-       if (size < 0 || size > MOVE_MAX_PIECES * MOVE_RATIO)
-         *count += 10;
-       else
-         *count += ((size + MOVE_MAX_PIECES - 1) / MOVE_MAX_PIECES);
-      }
-      break;
-    case CALL_EXPR:
-      {
-       tree decl = get_callee_fndecl (x);
-
-       if (decl && DECL_BUILT_IN (decl))
-         switch (DECL_FUNCTION_CODE (decl))
-           {
-           case BUILT_IN_CONSTANT_P:
-             *walk_subtrees = 0;
-             return NULL_TREE;
-           case BUILT_IN_EXPECT:
-             return NULL_TREE;
-           default:
-             break;
-           }
-       *count += 10;
-       break;
-      }
-    /* Few special cases of expensive operations.  This is useful
-       to avoid inlining on functions having too many of these.  */
-    case TRUNC_DIV_EXPR:
-    case CEIL_DIV_EXPR:
-    case FLOOR_DIV_EXPR:
-    case ROUND_DIV_EXPR:
-    case TRUNC_MOD_EXPR:
-    case CEIL_MOD_EXPR:
-    case FLOOR_MOD_EXPR:
-    case ROUND_MOD_EXPR:
-    case RDIV_EXPR:
-      *count += 10;
-      break;
-    /* Various containers that will produce no code themselves.  */
-    case INIT_EXPR:
-    case TARGET_EXPR:
-    case BIND_EXPR:
-    case BLOCK:
-    case TREE_LIST:
-    case TREE_VEC:
-    case IDENTIFIER_NODE:
-    case PLACEHOLDER_EXPR:
-    case WITH_CLEANUP_EXPR:
-    case CLEANUP_POINT_EXPR:
-    case NOP_EXPR:
-    case VIEW_CONVERT_EXPR:
-    case SAVE_EXPR:
-    case UNSAVE_EXPR:
-    case COMPLEX_EXPR:
-    case REALPART_EXPR:
-    case IMAGPART_EXPR:
-    case TRY_CATCH_EXPR:
-    case TRY_FINALLY_EXPR:
-    case LABEL_EXPR:
-    case EXIT_EXPR:
-    case LABELED_BLOCK_EXPR:
-    case EXIT_BLOCK_EXPR:
-
-    case EXPR_STMT:
-    case COMPOUND_STMT:
-    case RETURN_STMT:
-    case LABEL_STMT:
-    case SCOPE_STMT:
-    case CASE_LABEL:
-    case STMT_EXPR:
-    case CLEANUP_STMT:
-
-    case SIZEOF_EXPR:
-    case ARROW_EXPR:
-    case ALIGNOF_EXPR:
-      break;
-    case DECL_STMT:
-      /* Do not account static initializers.  */
-      if (TREE_STATIC (TREE_OPERAND (x, 0)))
-       *walk_subtrees = 0;
-      break;
-    default:
-      (*count)++;
-    }
-  return NULL;
-}
-
-/*  Estimate number of instructions that will be created by expanding the body.  */
-int
-c_estimate_num_insns (tree decl)
-{
-  int num = 0;
-  walk_tree_without_duplicates (&DECL_SAVED_TREE (decl), c_estimate_num_insns_1, &num);
-  return num;
-}
-
 /* Issue the error given by MSGID, indicating that it occurred before
    TOKEN, which had the associated VALUE.  */
 
index c7b6c2f..a9a0c0e 100644 (file)
@@ -1221,7 +1221,6 @@ extern void c_common_no_more_pch (void);
 extern void builtin_define_with_value (const char *, const char *, int);
 extern void c_stddef_cpp_builtins (void);
 extern void fe_file_change (const struct line_map *);
-extern int c_estimate_num_insns (tree decl);
 extern void c_parse_error (const char *, enum cpp_ttype, tree);
 
 /* The following have been moved here from c-tree.h, since they're needed