tree-ssa.h: Don't include gimple-low.h...
authorAndrew MacLeod <amacleod@redhat.com>
Fri, 18 Oct 2013 19:35:40 +0000 (19:35 +0000)
committerAndrew Macleod <amacleod@gcc.gnu.org>
Fri, 18 Oct 2013 19:35:40 +0000 (19:35 +0000)
* tree-ssa.h: Don't include gimple-low.h, tree-ssa-address.h, sbitmap.h,
tree-ssa-threadedge.h, tree-ssa-dom.h, and tree-cfgcleanup.h.
* gimple-low.c (gimple_check_call_arg,
gimple_check_call_matching_types): Move to cgraph.c.
* gimple-low.h: Remove prototype.
* cgraph.c: (gimple_check_call_arg, gimple_check_call_matching_types):
Relocate from gimple-low.c.
* cgraph.h: Add prototype.  Don't include basic-block.h.
* gimplify.c: Add gimple-low to include list.
* omp-low.c: Add gimple-low and tree-cfgcleanup.h to include list.
* tree-eh.c: Add gimple-low to include list.
* tree-nested.c: Likewise.
* cfgexpand.c: Add tree-ssa-address.h to include list.
* expr.c: Likewise.
* gimple-fold.c: Likewise.
* gimple-ssa-strength-reduction.c: Likewise.
* trans-mem.c: Likewise.
* tree-mudflap.c: Likewise.
* tree-ssa-loop-ivopts.c: Likewise.
* tree-ssa-dom.c: Include tree-ssa-threadedge.h and tree-ssa-dom.h.
(degenerate_phi_result): Move to tree-phinodes.c.
* tree-ssa-loop-ch.c: Include tree-ssa-threadedge.h.
* tree-ssa-threadedge.c: Likewise.
* tree-vrp.c: Likewise.
* tree-phinodes.c (degenerate_phi_result): Relocate here.
* tree-ssa-dom.h (degenerate_phi_result): Remove Prototype.
* tree-phinodes.h (degenerate_phi_result): Add prototype.
* tree-ssa-copy.c: Include tree-ssa-dom.h.
* tree-ssa-forwprop.c: Likewise.
* tree-cfgcleanup.c (execute_cleanup_cfg_post_optimizing,
pass_data_cleanup_cfg_post_optimizing,
make_pass_cleanup_cfg_post_optimizing): Relocate from tree-optimize.c.
* tree-optimize.c: Delete File.
* graphite.c: Include tree-cfgcleanup.h.
* passes.c: Likewise.
* tree-cfg.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-dse.c: Likewise.
* tree-ssa-loop-ivcanon.c: Likewise.
* tree-switch-conversion.c: Don't include tree-ssa-operands.h.
* tree-outof-ssa.c: Include sbitmap.h.
* tree-ssa-live.c: Likewise.
* tree-ssa-propagate.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* tree-stdarg.c: Likewise.
* Makefile.in (OBJS): Delete tree-optimize.o.
* basic-block.h (gcov_type, gcov_type_unsigned): Move to coretypes.h.
* coretypes.h (gcov_type, gcov_type_unsigned): Relocate here.
* varasm.c: Include basic-block.h.
* cfgloop.h: Include function.h instead of basic-block.h
(bb_loop_depth): Move to cfgloop.c.
* cfgloop.c (bb_loop_depth): Relocate from cfgloop.h.

From-SVN: r203833

46 files changed:
gcc/ChangeLog
gcc/Makefile.in
gcc/basic-block.h
gcc/cfgexpand.c
gcc/cfgloop.c
gcc/cfgloop.h
gcc/cgraph.c
gcc/cgraph.h
gcc/coretypes.h
gcc/expr.c
gcc/gimple-fold.c
gcc/gimple-low.c
gcc/gimple-low.h
gcc/gimple-ssa-strength-reduction.c
gcc/gimplify.c
gcc/graphite.c
gcc/omp-low.c
gcc/passes.c
gcc/trans-mem.c
gcc/tree-cfg.c
gcc/tree-cfgcleanup.c
gcc/tree-eh.c
gcc/tree-mudflap.c
gcc/tree-nested.c
gcc/tree-optimize.c [deleted file]
gcc/tree-outof-ssa.c
gcc/tree-phinodes.c
gcc/tree-phinodes.h
gcc/tree-profile.c
gcc/tree-ssa-copy.c
gcc/tree-ssa-dom.c
gcc/tree-ssa-dom.h
gcc/tree-ssa-dse.c
gcc/tree-ssa-forwprop.c
gcc/tree-ssa-live.c
gcc/tree-ssa-loop-ch.c
gcc/tree-ssa-loop-ivcanon.c
gcc/tree-ssa-loop-ivopts.c
gcc/tree-ssa-propagate.c
gcc/tree-ssa-structalias.c
gcc/tree-ssa-threadedge.c
gcc/tree-ssa.h
gcc/tree-stdarg.c
gcc/tree-switch-conversion.c
gcc/tree-vrp.c
gcc/varasm.c

index 43ae71725794b81dd6431c7e68e3dc2cff643c17..93a357a7481e55e821655073b6bec7fd56d4dc08 100644 (file)
@@ -1,3 +1,58 @@
+2013-10-18  Andrew MacLeod  <amacleod@redhat.com>
+
+       * tree-ssa.h: Don't include gimple-low.h, tree-ssa-address.h, sbitmap.h,
+       tree-ssa-threadedge.h, tree-ssa-dom.h, and tree-cfgcleanup.h.
+       * gimple-low.c (gimple_check_call_arg,
+       gimple_check_call_matching_types): Move to cgraph.c.
+       * gimple-low.h: Remove prototype.
+       * cgraph.c: (gimple_check_call_arg, gimple_check_call_matching_types):
+       Relocate from gimple-low.c.
+       * cgraph.h: Add prototype.  Don't include basic-block.h.
+       * gimplify.c: Add gimple-low to include list.
+       * omp-low.c: Add gimple-low and tree-cfgcleanup.h to include list.
+       * tree-eh.c: Add gimple-low to include list.
+       * tree-nested.c: Likewise.
+       * cfgexpand.c: Add tree-ssa-address.h to include list.
+       * expr.c: Likewise.
+       * gimple-fold.c: Likewise.
+       * gimple-ssa-strength-reduction.c: Likewise.
+       * trans-mem.c: Likewise.
+       * tree-mudflap.c: Likewise.
+       * tree-ssa-loop-ivopts.c: Likewise.
+       * tree-ssa-dom.c: Include tree-ssa-threadedge.h and tree-ssa-dom.h.
+       (degenerate_phi_result): Move to tree-phinodes.c.
+       * tree-ssa-loop-ch.c: Include tree-ssa-threadedge.h.
+       * tree-ssa-threadedge.c: Likewise.
+       * tree-vrp.c: Likewise.
+       * tree-phinodes.c (degenerate_phi_result): Relocate here.
+       * tree-ssa-dom.h (degenerate_phi_result): Remove Prototype.
+       * tree-phinodes.h (degenerate_phi_result): Add prototype.
+       * tree-ssa-copy.c: Include tree-ssa-dom.h.
+       * tree-ssa-forwprop.c: Likewise.
+       * tree-cfgcleanup.c (execute_cleanup_cfg_post_optimizing,
+       pass_data_cleanup_cfg_post_optimizing,
+       make_pass_cleanup_cfg_post_optimizing): Relocate from tree-optimize.c.
+       * tree-optimize.c: Delete File.
+       * graphite.c: Include tree-cfgcleanup.h.
+       * passes.c: Likewise.
+       * tree-cfg.c: Likewise.
+       * tree-profile.c: Likewise.
+       * tree-ssa-dse.c: Likewise.
+       * tree-ssa-loop-ivcanon.c: Likewise.
+       * tree-switch-conversion.c: Don't include tree-ssa-operands.h.
+       * tree-outof-ssa.c: Include sbitmap.h.
+       * tree-ssa-live.c: Likewise.
+       * tree-ssa-propagate.c: Likewise.
+       * tree-ssa-structalias.c: Likewise.
+       * tree-stdarg.c: Likewise.
+       * Makefile.in (OBJS): Delete tree-optimize.o.
+       * basic-block.h (gcov_type, gcov_type_unsigned): Move to coretypes.h.
+       * coretypes.h (gcov_type, gcov_type_unsigned): Relocate here.
+       * varasm.c: Include basic-block.h.
+       * cfgloop.h: Include function.h instead of basic-block.h
+       (bb_loop_depth): Move to cfgloop.c.
+       * cfgloop.c (bb_loop_depth): Relocate from cfgloop.h.
+
 2013-10-18  Teresa Johnson  <tejohnson@google.com>
 
        * predict.c (probably_never_executed): Compare frequency-based
index ba39ac934ad3d1ba2c54e57b5439838701d28d49..f0b8c5a23f278dcf66cff0e515c89d683e8abeb9 100644 (file)
@@ -1391,7 +1391,6 @@ OBJS = \
        tree-nomudflap.o \
        tree-nrv.o \
        tree-object-size.o \
-       tree-optimize.o \
        tree-outof-ssa.o \
        tree-parloops.o \
        tree-phinodes.o \
index f51de82f6c206adca87525fa9262d612e345bf2b..f0820b297d0333740320d46b3e2d43ddc37503a7 100644 (file)
@@ -24,13 +24,11 @@ along with GCC; see the file COPYING3.  If not see
 #include "vec.h"
 #include "function.h"
 
-/* Type we use to hold basic block counters.  Should be at least
+/* Use gcov_type to hold basic block counters.  Should be at least
    64bit.  Although a counter cannot be negative, we use a signed
    type, because erroneous negative counts can be generated when the
    flow graph is manipulated by various optimizations.  A signed type
    makes those easy to detect.  */
-typedef HOST_WIDEST_INT gcov_type;
-typedef unsigned HOST_WIDEST_INT gcov_type_unsigned;
 
 /* Control flow edge information.  */
 struct GTY((user)) edge_def {
index 7ed29f5c227311a78e894ea6bd08016aea055c34..5a78bb68b35a75ef7c2adaf9247471a903432167 100644 (file)
@@ -47,6 +47,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "regs.h" /* For reg_renumber.  */
 #include "insn-attr.h" /* For INSN_SCHEDULING.  */
 #include "asan.h"
+#include "tree-ssa-address.h"
 
 /* This variable holds information helping the rewriting of SSA trees
    into RTL.  */
index 28e30eaa905ebb76b1ed2da053c3591a82decf7f..3babf777fae70da367a196f758db124ebf9ff6c8 100644 (file)
@@ -1912,4 +1912,10 @@ get_max_loop_iterations_int (struct loop *loop)
   return hwi_nit < 0 ? -1 : hwi_nit;
 }
 
+/* Returns the loop depth of the loop BB belongs to.  */
 
+int
+bb_loop_depth (const_basic_block bb)
+{
+  return bb->loop_father ? loop_depth (bb->loop_father) : 0;
+}
index b9676ec02514dba70a222be1ace7e1d20a2555f8..87086d49022b1bcb93b54ee20245a58b571c921d 100644 (file)
@@ -20,11 +20,10 @@ along with GCC; see the file COPYING3.  If not see
 #ifndef GCC_CFGLOOP_H
 #define GCC_CFGLOOP_H
 
-#include "basic-block.h"
 #include "double-int.h"
-
 #include "bitmap.h"
 #include "sbitmap.h"
+#include "function.h"
 
 /* Structure to hold decision about unrolling/peeling.  */
 enum lpt_dec
@@ -455,14 +454,6 @@ loop_depth (const struct loop *loop)
   return vec_safe_length (loop->superloops);
 }
 
-/* Returns the loop depth of the loop BB belongs to.  */
-
-static inline int
-bb_loop_depth (const_basic_block bb)
-{
-  return bb->loop_father ? loop_depth (bb->loop_father) : 0;
-}
-
 /* Returns the immediate superloop of LOOP, or NULL if LOOP is the outermost
    loop.  */
 
@@ -744,6 +735,7 @@ extern HOST_WIDE_INT get_estimated_loop_iterations_int (struct loop *);
 extern HOST_WIDE_INT get_max_loop_iterations_int (struct loop *);
 extern bool get_estimated_loop_iterations (struct loop *loop, double_int *nit);
 extern bool get_max_loop_iterations (struct loop *loop, double_int *nit);
+extern int bb_loop_depth (const_basic_block);
 
 /* Converts VAL to double_int.  */
 
index 124ee0adf8556586d0b7e915a7d490f3eeb6616f..6ebd0c71e02628828e1b42d31efa3ed79cce0814 100644 (file)
@@ -2998,4 +2998,99 @@ cgraph_get_body (struct cgraph_node *node)
   return true;
 }
 
+/* Verify if the type of the argument matches that of the function
+   declaration.  If we cannot verify this or there is a mismatch,
+   return false.  */
+
+static bool
+gimple_check_call_args (gimple stmt, tree fndecl, bool args_count_match)
+{
+  tree parms, p;
+  unsigned int i, nargs;
+
+  /* Calls to internal functions always match their signature.  */
+  if (gimple_call_internal_p (stmt))
+    return true;
+
+  nargs = gimple_call_num_args (stmt);
+
+  /* Get argument types for verification.  */
+  if (fndecl)
+    parms = TYPE_ARG_TYPES (TREE_TYPE (fndecl));
+  else
+    parms = TYPE_ARG_TYPES (gimple_call_fntype (stmt));
+
+  /* Verify if the type of the argument matches that of the function
+     declaration.  If we cannot verify this or there is a mismatch,
+     return false.  */
+  if (fndecl && DECL_ARGUMENTS (fndecl))
+    {
+      for (i = 0, p = DECL_ARGUMENTS (fndecl);
+          i < nargs;
+          i++, p = DECL_CHAIN (p))
+       {
+         tree arg;
+         /* We cannot distinguish a varargs function from the case
+            of excess parameters, still deferring the inlining decision
+            to the callee is possible.  */
+         if (!p)
+           break;
+         arg = gimple_call_arg (stmt, i);
+         if (p == error_mark_node
+             || arg == error_mark_node
+             || (!types_compatible_p (DECL_ARG_TYPE (p), TREE_TYPE (arg))
+                 && !fold_convertible_p (DECL_ARG_TYPE (p), arg)))
+            return false;
+       }
+      if (args_count_match && p)
+       return false;
+    }
+  else if (parms)
+    {
+      for (i = 0, p = parms; i < nargs; i++, p = TREE_CHAIN (p))
+       {
+         tree arg;
+         /* If this is a varargs function defer inlining decision
+            to callee.  */
+         if (!p)
+           break;
+         arg = gimple_call_arg (stmt, i);
+         if (TREE_VALUE (p) == error_mark_node
+             || arg == error_mark_node
+             || TREE_CODE (TREE_VALUE (p)) == VOID_TYPE
+             || (!types_compatible_p (TREE_VALUE (p), TREE_TYPE (arg))
+                 && !fold_convertible_p (TREE_VALUE (p), arg)))
+            return false;
+       }
+    }
+  else
+    {
+      if (nargs != 0)
+        return false;
+    }
+  return true;
+}
+
+/* Verify if the type of the argument and lhs of CALL_STMT matches
+   that of the function declaration CALLEE. If ARGS_COUNT_MATCH is
+   true, the arg count needs to be the same.
+   If we cannot verify this or there is a mismatch, return false.  */
+
+bool
+gimple_check_call_matching_types (gimple call_stmt, tree callee,
+                                 bool args_count_match)
+{
+  tree lhs;
+
+  if ((DECL_RESULT (callee)
+       && !DECL_BY_REFERENCE (DECL_RESULT (callee))
+       && (lhs = gimple_call_lhs (call_stmt)) != NULL_TREE
+       && !useless_type_conversion_p (TREE_TYPE (DECL_RESULT (callee)),
+                                      TREE_TYPE (lhs))
+       && !fold_convertible_p (TREE_TYPE (DECL_RESULT (callee)), lhs))
+      || !gimple_check_call_args (call_stmt, callee, args_count_match))
+    return false;
+  return true;
+}
+
 #include "gt-cgraph.h"
index afdeaba4c3d9f90236886ea9e485cfbd19a0f2c0..69adf4d19161abe737e8e18e10ab0d87cf6e5970 100644 (file)
@@ -25,7 +25,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "plugin-api.h"
 #include "vec.h"
 #include "tree.h"
-#include "basic-block.h"
 #include "function.h"
 #include "ipa-ref.h"
 
@@ -742,6 +741,7 @@ void cgraph_speculative_call_info (struct cgraph_edge *,
                                   struct cgraph_edge *&,
                                   struct cgraph_edge *&,
                                   struct ipa_ref *&);
+extern bool gimple_check_call_matching_types (gimple, tree, bool);
 
 /* In cgraphunit.c  */
 struct asm_node *add_asm_node (tree);
index bff8f5c62d5df3f35c6ef64f9b7a9c80d02ac3ee..f7ef8d777c1f86e23ddbbec7cd6390c48c9aef24 100644 (file)
@@ -43,6 +43,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 
 #ifndef USED_FOR_TARGET
 
+typedef HOST_WIDEST_INT gcov_type;
+typedef unsigned HOST_WIDEST_INT gcov_type_unsigned;
+
 struct bitmap_head_def;
 typedef struct bitmap_head_def *bitmap;
 typedef const struct bitmap_head_def *const_bitmap;
index 4975a64e1d869ffb2ed3fed21045811fe9b080e9..76ee9e0ab7f0bec803ca85710a8c4410ba036312 100644 (file)
@@ -52,6 +52,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree-outof-ssa.h"
 #include "target-globals.h"
 #include "params.h"
+#include "tree-ssa-address.h"
 
 /* Decide whether a function's arguments should be processed
    from first to last or from last to first.
index 33e677f246eb7adc7e83ed3157041ef5b52b6ca1..d1349588fbdf82fdea42d309a60d59f9d11d92d7 100644 (file)
@@ -31,6 +31,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "target.h"
 #include "ipa-utils.h"
 #include "gimple-pretty-print.h"
+#include "tree-ssa-address.h"
 
 /* Return true when DECL can be referenced from current unit.
    FROM_DECL (if non-null) specify constructor of variable DECL was taken from.
index aa4c024b1ced3c1378587f1656ed0392ed9841a7..cf61204c411a74a1717868b08b9adb18c239048b 100644 (file)
@@ -32,6 +32,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "diagnostic-core.h"
 #include "tree-pass.h"
 #include "langhooks.h"
+#include "gimple-low.h"
 
 /* The differences between High GIMPLE and Low GIMPLE are the
    following:
@@ -215,103 +216,6 @@ make_pass_lower_cf (gcc::context *ctxt)
   return new pass_lower_cf (ctxt);
 }
 
-
-
-/* Verify if the type of the argument matches that of the function
-   declaration.  If we cannot verify this or there is a mismatch,
-   return false.  */
-
-static bool
-gimple_check_call_args (gimple stmt, tree fndecl, bool args_count_match)
-{
-  tree parms, p;
-  unsigned int i, nargs;
-
-  /* Calls to internal functions always match their signature.  */
-  if (gimple_call_internal_p (stmt))
-    return true;
-
-  nargs = gimple_call_num_args (stmt);
-
-  /* Get argument types for verification.  */
-  if (fndecl)
-    parms = TYPE_ARG_TYPES (TREE_TYPE (fndecl));
-  else
-    parms = TYPE_ARG_TYPES (gimple_call_fntype (stmt));
-
-  /* Verify if the type of the argument matches that of the function
-     declaration.  If we cannot verify this or there is a mismatch,
-     return false.  */
-  if (fndecl && DECL_ARGUMENTS (fndecl))
-    {
-      for (i = 0, p = DECL_ARGUMENTS (fndecl);
-          i < nargs;
-          i++, p = DECL_CHAIN (p))
-       {
-         tree arg;
-         /* We cannot distinguish a varargs function from the case
-            of excess parameters, still deferring the inlining decision
-            to the callee is possible.  */
-         if (!p)
-           break;
-         arg = gimple_call_arg (stmt, i);
-         if (p == error_mark_node
-             || arg == error_mark_node
-             || (!types_compatible_p (DECL_ARG_TYPE (p), TREE_TYPE (arg))
-                 && !fold_convertible_p (DECL_ARG_TYPE (p), arg)))
-            return false;
-       }
-      if (args_count_match && p)
-       return false;
-    }
-  else if (parms)
-    {
-      for (i = 0, p = parms; i < nargs; i++, p = TREE_CHAIN (p))
-       {
-         tree arg;
-         /* If this is a varargs function defer inlining decision
-            to callee.  */
-         if (!p)
-           break;
-         arg = gimple_call_arg (stmt, i);
-         if (TREE_VALUE (p) == error_mark_node
-             || arg == error_mark_node
-             || TREE_CODE (TREE_VALUE (p)) == VOID_TYPE
-             || (!types_compatible_p (TREE_VALUE (p), TREE_TYPE (arg))
-                 && !fold_convertible_p (TREE_VALUE (p), arg)))
-            return false;
-       }
-    }
-  else
-    {
-      if (nargs != 0)
-        return false;
-    }
-  return true;
-}
-
-/* Verify if the type of the argument and lhs of CALL_STMT matches
-   that of the function declaration CALLEE. If ARGS_COUNT_MATCH is
-   true, the arg count needs to be the same.
-   If we cannot verify this or there is a mismatch, return false.  */
-
-bool
-gimple_check_call_matching_types (gimple call_stmt, tree callee,
-                                 bool args_count_match)
-{
-  tree lhs;
-
-  if ((DECL_RESULT (callee)
-       && !DECL_BY_REFERENCE (DECL_RESULT (callee))
-       && (lhs = gimple_call_lhs (call_stmt)) != NULL_TREE
-       && !useless_type_conversion_p (TREE_TYPE (DECL_RESULT (callee)),
-                                      TREE_TYPE (lhs))
-       && !fold_convertible_p (TREE_TYPE (DECL_RESULT (callee)), lhs))
-      || !gimple_check_call_args (call_stmt, callee, args_count_match))
-    return false;
-  return true;
-}
-
 /* Lower sequence SEQ.  Unlike gimplification the statements are not relowered
    when they are changed -- if this has to be done, the lowering routine must
    do it explicitly.  DATA is passed through the recursion.  */
index b66de2ef2c2cf25a120c90b5be82298461ad0306..7e8ff6c74d8bf414736f6e1ad33ab218eaa5085a 100644 (file)
@@ -20,7 +20,6 @@ along with GCC; see the file COPYING3.  If not see
 #ifndef GCC_GIMPLE_LOW_H
 #define GCC_GIMPLE_LOW_H
 
-extern bool gimple_check_call_matching_types (gimple, tree, bool);
 extern bool gimple_stmt_may_fallthru (gimple);
 extern bool gimple_seq_may_fallthru (gimple_seq);
 extern void record_vars_into (tree, tree);
index a558f349c410a7ba86f702dfc3ee9bdff91b0703..2b5e69f772515b8b1260eeb4c39ba9f368af5634 100644 (file)
@@ -48,6 +48,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "expmed.h"
 #include "params.h"
 #include "hash-table.h"
+#include "tree-ssa-address.h"
 \f
 /* Information about a strength reduction candidate.  Each statement
    in the candidate table represents an expression of one of the
index a67f1a3746ec2ae2a6bcb3f10c9704b86b0ad6f7..193e0170178e8c1e6c4d411b028fe4d6dfe5e6b9 100644 (file)
@@ -43,6 +43,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "splay-tree.h"
 #include "vec.h"
 #include "omp-low.h"
+#include "gimple-low.h"
 
 #include "langhooks-def.h"     /* FIXME: for lhd_set_decl_assembler_name */
 #include "tree-pass.h"         /* FIXME: only for PROP_gimple_any */
index 7273c1120844d3cdb628db1030a65ea787f68422..b26c520abcbfa7fff0327587d8ca148113feeba3 100644 (file)
@@ -57,6 +57,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "dbgcnt.h"
 #include "tree-parloops.h"
 #include "tree-pass.h"
+#include "tree-cfgcleanup.h"
 
 #ifdef HAVE_cloog
 
index 208f20c407de0f695904a051f67c7050490fc774..3326e9ecf0cf6f9df05f5e92c77a08746cefc2f4 100644 (file)
@@ -44,6 +44,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "cfgloop.h"
 #include "target.h"
 #include "omp-low.h"
+#include "gimple-low.h"
+#include "tree-cfgcleanup.h"
 
 
 /* Lowering of OpenMP parallel and workshare constructs proceeds in two
index 5e6b8e5cc0167cb275a38a3cac4ec20fe91361dd..95fc66694408823324d6d15fe1caf6a1f5d85d14 100644 (file)
@@ -73,6 +73,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "context.h"
 #include "pass_manager.h"
 #include "tree-ssa-live.h"  /* For remove_unused_locals.  */
+#include "tree-cfgcleanup.h"
 
 using namespace gcc;
 
index 82f3ee08a39bd140201c1afe4f7f214b33cc4f6c..037cbcef7436a26189bad1ee021dbbecd140c509 100644 (file)
@@ -35,6 +35,7 @@
 #include "langhooks.h"
 #include "gimple-pretty-print.h"
 #include "cfgloop.h"
+#include "tree-ssa-address.h"
 
 
 #define PROB_VERY_UNLIKELY     (REG_BR_PROB_BASE / 2000 - 1)
index 9268615395abbd6a0c0cb8555d8cf6524850d567..3a1319132d56174e69c04de45cf293bb7335ced0 100644 (file)
@@ -43,6 +43,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "target.h"
 #include "tree-ssa-live.h"
 #include "omp-low.h"
+#include "tree-cfgcleanup.h"
 
 /* This file contains functions for building the Control Flow Graph (CFG)
    for a function tree.  */
index cd4307ec9b8bcfc8e3b7f49af8866debd99fad64..830cdf36b6b91a67ce20c9987b62e77c4b9a6d52 100644 (file)
@@ -1027,3 +1027,90 @@ make_pass_merge_phi (gcc::context *ctxt)
 {
   return new pass_merge_phi (ctxt);
 }
+
+/* Pass: cleanup the CFG just before expanding trees to RTL.
+   This is just a round of label cleanups and case node grouping
+   because after the tree optimizers have run such cleanups may
+   be necessary.  */
+
+static unsigned int
+execute_cleanup_cfg_post_optimizing (void)
+{
+  unsigned int todo = 0;
+  if (cleanup_tree_cfg ())
+    todo |= TODO_update_ssa;
+  maybe_remove_unreachable_handlers ();
+  cleanup_dead_labels ();
+  group_case_labels ();
+  if ((flag_compare_debug_opt || flag_compare_debug)
+      && flag_dump_final_insns)
+    {
+      FILE *final_output = fopen (flag_dump_final_insns, "a");
+
+      if (!final_output)
+       {
+         error ("could not open final insn dump file %qs: %m",
+                flag_dump_final_insns);
+         flag_dump_final_insns = NULL;
+       }
+      else
+       {
+         int save_unnumbered = flag_dump_unnumbered;
+         int save_noaddr = flag_dump_noaddr;
+
+         flag_dump_noaddr = flag_dump_unnumbered = 1;
+         fprintf (final_output, "\n");
+         dump_enumerated_decls (final_output, dump_flags | TDF_NOUID);
+         flag_dump_noaddr = save_noaddr;
+         flag_dump_unnumbered = save_unnumbered;
+         if (fclose (final_output))
+           {
+             error ("could not close final insn dump file %qs: %m",
+                    flag_dump_final_insns);
+             flag_dump_final_insns = NULL;
+           }
+       }
+    }
+  return todo;
+}
+
+namespace {
+
+const pass_data pass_data_cleanup_cfg_post_optimizing =
+{
+  GIMPLE_PASS, /* type */
+  "optimized", /* name */
+  OPTGROUP_NONE, /* optinfo_flags */
+  false, /* has_gate */
+  true, /* has_execute */
+  TV_TREE_CLEANUP_CFG, /* tv_id */
+  PROP_cfg, /* properties_required */
+  0, /* properties_provided */
+  0, /* properties_destroyed */
+  0, /* todo_flags_start */
+  TODO_remove_unused_locals, /* todo_flags_finish */
+};
+
+class pass_cleanup_cfg_post_optimizing : public gimple_opt_pass
+{
+public:
+  pass_cleanup_cfg_post_optimizing (gcc::context *ctxt)
+    : gimple_opt_pass (pass_data_cleanup_cfg_post_optimizing, ctxt)
+  {}
+
+  /* opt_pass methods: */
+  unsigned int execute () {
+    return execute_cleanup_cfg_post_optimizing ();
+  }
+
+}; // class pass_cleanup_cfg_post_optimizing
+
+} // anon namespace
+
+gimple_opt_pass *
+make_pass_cleanup_cfg_post_optimizing (gcc::context *ctxt)
+{
+  return new pass_cleanup_cfg_post_optimizing (ctxt);
+}
+
+
index 9eaae1170ab10aade7da24c2b17c3adb5d82650e..9c7817d42e254c19817fc47bb0528d71fe65386a 100644 (file)
@@ -36,6 +36,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "gimple.h"
 #include "target.h"
 #include "cfgloop.h"
+#include "gimple-low.h"
 
 /* In some instances a tree and a gimple need to be stored in a same table,
    i.e. in hash tables. This is a structure to do this. */
index 9616762f24ed051518931d70e884504674d3158a..4c0d71d757bd52eee9c935df558dae6ef2ff2203 100644 (file)
@@ -42,6 +42,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "ggc.h"
 #include "cgraph.h"
 #include "gimple.h"
+#include "tree-ssa-address.h"
 
 extern void add_bb_to_loop (basic_block, struct loop *);
 
index 7582289c1c2c0d3aafaa91f1de3a195d0a83aac4..b0922f6aabdd9e9681b34fd28c1ea618601c8d68 100644 (file)
@@ -33,6 +33,7 @@
 #include "expr.h"      /* FIXME: For STACK_SAVEAREA_MODE and SAVE_NONLOCAL.  */
 #include "langhooks.h"
 #include "pointer-set.h"
+#include "gimple-low.h"
 
 
 /* The object of this pass is to lower the representation of a set of nested
diff --git a/gcc/tree-optimize.c b/gcc/tree-optimize.c
deleted file mode 100644 (file)
index d823dbe..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-/* Top-level control of tree optimizations.
-   Copyright (C) 2001-2013 Free Software Foundation, Inc.
-   Contributed by Diego Novillo <dnovillo@redhat.com>
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3, or (at your option)
-any later version.
-
-GCC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING3.  If not see
-<http://www.gnu.org/licenses/>.  */
-
-#include "config.h"
-#include "system.h"
-#include "coretypes.h"
-#include "tm.h"
-#include "tree.h"
-#include "tm_p.h"
-#include "basic-block.h"
-#include "flags.h"
-#include "tree-ssa.h"
-#include "function.h"
-#include "langhooks.h"
-#include "diagnostic-core.h"
-#include "toplev.h"
-#include "flags.h"
-#include "cgraph.h"
-#include "tree-inline.h"
-#include "tree-pass.h"
-#include "ggc.h"
-#include "cgraph.h"
-#include "cfgloop.h"
-#include "except.h"
-#include "plugin.h"
-
-
-/* Pass: cleanup the CFG just before expanding trees to RTL.
-   This is just a round of label cleanups and case node grouping
-   because after the tree optimizers have run such cleanups may
-   be necessary.  */
-
-static unsigned int
-execute_cleanup_cfg_post_optimizing (void)
-{
-  unsigned int todo = 0;
-  if (cleanup_tree_cfg ())
-    todo |= TODO_update_ssa;
-  maybe_remove_unreachable_handlers ();
-  cleanup_dead_labels ();
-  group_case_labels ();
-  if ((flag_compare_debug_opt || flag_compare_debug)
-      && flag_dump_final_insns)
-    {
-      FILE *final_output = fopen (flag_dump_final_insns, "a");
-
-      if (!final_output)
-       {
-         error ("could not open final insn dump file %qs: %m",
-                flag_dump_final_insns);
-         flag_dump_final_insns = NULL;
-       }
-      else
-       {
-         int save_unnumbered = flag_dump_unnumbered;
-         int save_noaddr = flag_dump_noaddr;
-
-         flag_dump_noaddr = flag_dump_unnumbered = 1;
-         fprintf (final_output, "\n");
-         dump_enumerated_decls (final_output, dump_flags | TDF_NOUID);
-         flag_dump_noaddr = save_noaddr;
-         flag_dump_unnumbered = save_unnumbered;
-         if (fclose (final_output))
-           {
-             error ("could not close final insn dump file %qs: %m",
-                    flag_dump_final_insns);
-             flag_dump_final_insns = NULL;
-           }
-       }
-    }
-  return todo;
-}
-
-namespace {
-
-const pass_data pass_data_cleanup_cfg_post_optimizing =
-{
-  GIMPLE_PASS, /* type */
-  "optimized", /* name */
-  OPTGROUP_NONE, /* optinfo_flags */
-  false, /* has_gate */
-  true, /* has_execute */
-  TV_TREE_CLEANUP_CFG, /* tv_id */
-  PROP_cfg, /* properties_required */
-  0, /* properties_provided */
-  0, /* properties_destroyed */
-  0, /* todo_flags_start */
-  TODO_remove_unused_locals, /* todo_flags_finish */
-};
-
-class pass_cleanup_cfg_post_optimizing : public gimple_opt_pass
-{
-public:
-  pass_cleanup_cfg_post_optimizing (gcc::context *ctxt)
-    : gimple_opt_pass (pass_data_cleanup_cfg_post_optimizing, ctxt)
-  {}
-
-  /* opt_pass methods: */
-  unsigned int execute () {
-    return execute_cleanup_cfg_post_optimizing ();
-  }
-
-}; // class pass_cleanup_cfg_post_optimizing
-
-} // anon namespace
-
-gimple_opt_pass *
-make_pass_cleanup_cfg_post_optimizing (gcc::context *ctxt)
-{
-  return new pass_cleanup_cfg_post_optimizing (ctxt);
-}
-
-
index 42c90d49a1807d65de26aad43f8a7510e05c67b7..f732e09d6fe76cbd99a727b1ae52b03d766f2d11 100644 (file)
@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "basic-block.h"
 #include "gimple-pretty-print.h"
 #include "bitmap.h"
+#include "sbitmap.h"
 #include "tree-ssa.h"
 #include "dumpfile.h"
 #include "diagnostic-core.h"
index 0bd5085ba99365cf8ad4dbdb266261617c2aca9f..f96dafa476c96639abd9adf275c218fb2f3542c5 100644 (file)
@@ -464,4 +464,41 @@ remove_phi_nodes (basic_block bb)
   set_phi_nodes (bb, NULL);
 }
 
+/* Given PHI, return its RHS if the PHI is a degenerate, otherwise return
+   NULL.  */
+
+tree
+degenerate_phi_result (gimple phi)
+{
+  tree lhs = gimple_phi_result (phi);
+  tree val = NULL;
+  size_t i;
+
+  /* Ignoring arguments which are the same as LHS, if all the remaining
+     arguments are the same, then the PHI is a degenerate and has the
+     value of that common argument.  */
+  for (i = 0; i < gimple_phi_num_args (phi); i++)
+    {
+      tree arg = gimple_phi_arg_def (phi, i);
+
+      if (arg == lhs)
+       continue;
+      else if (!arg)
+       break;
+      else if (!val)
+       val = arg;
+      else if (arg == val)
+       continue;
+      /* We bring in some of operand_equal_p not only to speed things
+        up, but also to avoid crashing when dereferencing the type of
+        a released SSA name.  */
+      else if (TREE_CODE (val) != TREE_CODE (arg)
+              || TREE_CODE (val) == SSA_NAME
+              || !operand_equal_p (arg, val, 0))
+       break;
+    }
+  return (i == gimple_phi_num_args (phi) ? val : NULL);
+}
+
+
 #include "gt-tree-phinodes.h"
index e36106922118ac41a28859a2b4abeb587c546813..ae6222b336edd640f785df087090aa5fb3a16e41 100644 (file)
@@ -29,7 +29,7 @@ extern void add_phi_arg (gimple, tree, edge, source_location);
 extern void remove_phi_args (edge);
 extern void remove_phi_node (gimple_stmt_iterator *, bool);
 extern void remove_phi_nodes (basic_block);
-/* Return a use_operand_p pointer for argument I of PHI node GS.  */
+extern tree degenerate_phi_result (gimple);
 
 /* Set PHI nodes of a basic block BB to SEQ.  */
 
index a0e49b5304750389a598d7510844c3267cf433e6..d5713ac65213e03ab93f394fef09212e56dc2923 100644 (file)
@@ -40,6 +40,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "cgraph.h"
 #include "profile.h"
 #include "target.h"
+#include "tree-cfgcleanup.h"
 
 static GTY(()) tree gcov_type_node;
 static GTY(()) tree tree_interval_profiler_fn;
index c85749d511dc72c6e9982e14178bbc424c778bad..4ec941bcbf0bbd7e1c1d1232a8dad3e4ff31ffb4 100644 (file)
@@ -33,6 +33,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "langhooks.h"
 #include "cfgloop.h"
 #include "tree-scalar-evolution.h"
+#include "tree-ssa-dom.h"
 
 /* This file implements the copy propagation pass and provides a
    handful of interfaces for performing const/copy propagation and
index b2c7e147ef67724c7c484ebd64ff6d33b9500c28..4ce29aed54e37c08fb064eab76939e5dcb55acd1 100644 (file)
@@ -37,6 +37,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree-ssa-threadupdate.h"
 #include "langhooks.h"
 #include "params.h"
+#include "tree-ssa-threadedge.h"
+#include "tree-ssa-dom.h"
 
 /* This file implements optimizations on the dominator tree.  */
 
@@ -2588,42 +2590,6 @@ avail_expr_hash (const void *p)
 /* PHI-ONLY copy and constant propagation.  This pass is meant to clean
    up degenerate PHIs created by or exposed by jump threading.  */
 
-/* Given PHI, return its RHS if the PHI is a degenerate, otherwise return
-   NULL.  */
-
-tree
-degenerate_phi_result (gimple phi)
-{
-  tree lhs = gimple_phi_result (phi);
-  tree val = NULL;
-  size_t i;
-
-  /* Ignoring arguments which are the same as LHS, if all the remaining
-     arguments are the same, then the PHI is a degenerate and has the
-     value of that common argument.  */
-  for (i = 0; i < gimple_phi_num_args (phi); i++)
-    {
-      tree arg = gimple_phi_arg_def (phi, i);
-
-      if (arg == lhs)
-       continue;
-      else if (!arg)
-       break;
-      else if (!val)
-       val = arg;
-      else if (arg == val)
-       continue;
-      /* We bring in some of operand_equal_p not only to speed things
-        up, but also to avoid crashing when dereferencing the type of
-        a released SSA name.  */
-      else if (TREE_CODE (val) != TREE_CODE (arg)
-              || TREE_CODE (val) == SSA_NAME
-              || !operand_equal_p (arg, val, 0))
-       break;
-    }
-  return (i == gimple_phi_num_args (phi) ? val : NULL);
-}
-
 /* Given a statement STMT, which is either a PHI node or an assignment,
    remove it from the IL.  */
 
index 89742b03a0e31fa22404b10fe4841291411fcd95..0115f9323b7d6e3197ade69ec76cc5dfbd36f1d8 100644 (file)
@@ -24,6 +24,5 @@ extern void dump_dominator_optimization_stats (FILE *);
 extern void debug_dominator_optimization_stats (void);
 extern int loop_depth_of_name (tree);
 extern bool simple_iv_increment_p (gimple);
-extern tree degenerate_phi_result (gimple);
 
 #endif /* GCC_TREE_SSA_DOM_H */
index 700824cade89e26fccd27782c0ea07bbe94daca5..f73fb3c522b9f1e23ba01f0b44fd3c3e59fdf0f2 100644 (file)
@@ -31,6 +31,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "domwalk.h"
 #include "flags.h"
 #include "langhooks.h"
+#include "tree-cfgcleanup.h"
 
 /* This file implements dead store elimination.
 
index 65f7ee17d46b88bfb1d4ce7af0007f008f776afe..456725d3e3b01c2333687afdb916b1aca2688c8d 100644 (file)
@@ -34,6 +34,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "cfgloop.h"
 #include "optabs.h"
 #include "tree-ssa-propagate.h"
+#include "tree-ssa-dom.h"
 
 /* This pass propagates the RHS of assignment statements into use
    sites of the LHS of the assignment.  It's basically a specialized
index 7705f1312b86c3b32431eda85b2ef8fc1d30b9ba..94a9beead58595a2fc5058d0b9f3b000fb56bdf7 100644 (file)
@@ -26,6 +26,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree.h"
 #include "gimple-pretty-print.h"
 #include "bitmap.h"
+#include "sbitmap.h"
 #include "tree-ssa.h"
 #include "timevar.h"
 #include "dumpfile.h"
index b74855e62de830fdf7163693a65dc7f14ba6c127..15b34bb9d0c1add72edd8a704718e1baaf0e294e 100644 (file)
@@ -29,6 +29,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "cfgloop.h"
 #include "tree-inline.h"
 #include "flags.h"
+#include "tree-ssa-threadedge.h"
 
 /* Duplicates headers of loops if they are small enough, so that the statements
    in the loop body are always executed when the loop is entered.  This
index 8db5b9ede7e79834a0d8da6c40a6d7fa1ecd1700..a506706b6e8ff0d6f78f00b0c8e97a708afb56c8 100644 (file)
@@ -49,6 +49,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "flags.h"
 #include "tree-inline.h"
 #include "target.h"
+#include "tree-cfgcleanup.h"
 
 /* Specifies types of loops that may be unrolled.  */
 
index 5e8fa36f39494772c6a1ca2f80512a77c9439964..798f57f6c284f2e1f6f99fcdf0b7019629ec2bf0 100644 (file)
@@ -86,6 +86,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree-inline.h"
 #include "tree-ssa-propagate.h"
 #include "expmed.h"
+#include "tree-ssa-address.h"
 
 /* FIXME: Expressions are expanded to RTL in this pass to determine the
    cost of different addressing modes.  This should be moved to a TBD
index 591f5508f6659585361da1eee40cecf4f86ff7c1..180ae85e091a97cf74f97d34bf2f7d007521302b 100644 (file)
@@ -29,6 +29,7 @@
 #include "function.h"
 #include "gimple-pretty-print.h"
 #include "dumpfile.h"
+#include "sbitmap.h"
 #include "tree-ssa.h"
 #include "tree-ssa-propagate.h"
 #include "langhooks.h"
index 46acc9ab9add0d20e86bd774ba6adbb3a35ad795..b8cfebd3110545dbbdfdd6ec771758c0676814ac 100644 (file)
@@ -25,6 +25,7 @@
 #include "ggc.h"
 #include "obstack.h"
 #include "bitmap.h"
+#include "sbitmap.h"
 #include "flags.h"
 #include "basic-block.h"
 #include "tree.h"
index c2dd0155697e7ab5a541e054c3df1091aada8cd4..f5675572ff0361e69e293f9bd651b448f78c0e12 100644 (file)
@@ -35,6 +35,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree-ssa-threadupdate.h"
 #include "langhooks.h"
 #include "params.h"
+#include "tree-ssa-threadedge.h"
 
 /* To avoid code explosion due to jump threading, we limit the
    number of statements we are going to copy.  This variable
index 8c26fd1a2fe62d90bd56f89a25e2bdbc9034eca2..c68a044221c4ceee5f4a7353fdf320696d969ff0 100644 (file)
@@ -21,21 +21,15 @@ along with GCC; see the file COPYING3.  If not see
 #define GCC_TREE_SSA_H
 
 #include "bitmap.h"
-#include "sbitmap.h"
 #include "gimple.h"
 #include "gimple-ssa.h"
 #include "cgraph.h"
-#include "tree-cfgcleanup.h"
 #include "tree-cfg.h"
 #include "tree-phinodes.h"
 #include "ssa-iterators.h"
 #include "tree-ssanames.h"
-#include "tree-ssa-dom.h"
-#include "tree-ssa-threadedge.h"
-#include "tree-ssa-address.h"
 #include "tree-ssa-loop.h"
 #include "tree-into-ssa.h"
-#include "gimple-low.h"
 #include "tree-dfa.h"
 
 /* Mapping for redirected edges.  */
index d7cd291f3a8461a0a2721621b851f8ced8f27825..3314fbaf56ea7b8d9c16057dfb8a683ab353da30 100644 (file)
@@ -28,6 +28,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "gimple-pretty-print.h"
 #include "target.h"
 #include "tree-ssa.h"
+#include "sbitmap.h"
 #include "tree-pass.h"
 #include "tree-stdarg.h"
 
index 04beab6bf754018ec8ecb6ac68104e5b4c833a1d..862cb3870c8c735202c4b438fca246e0a16ef6e1 100644 (file)
@@ -32,7 +32,6 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
 #include "tree.h"
 #include "basic-block.h"
 #include "tree-ssa.h"
-#include "tree-ssa-operands.h"
 #include "tree-pass.h"
 #include "gimple-pretty-print.h"
 #include "cfgloop.h"
index 2bc15812e5a0a8d3d82589f4dff2862a4d047b74..0a059645c50cf1e4eda6dd9eaeafe1b35a866f58 100644 (file)
@@ -39,6 +39,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree-ssa-threadupdate.h"
 #include "expr.h"
 #include "optabs.h"
+#include "tree-ssa-threadedge.h"
 
 
 
index 12fb7c46b33c23debf0472f3ed78690065a873ab..acf8af083d4da1e42cc559cf736611c78ec951d0 100644 (file)
@@ -50,6 +50,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "cgraph.h"
 #include "pointer-set.h"
 #include "asan.h"
+#include "basic-block.h"
 
 #ifdef XCOFF_DEBUGGING_INFO
 #include "xcoffout.h"          /* Needed for external data