summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authoramacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-17 16:14:46 +0000
committeramacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-17 16:14:46 +0000
commite797f49f7a9dcfc88d7d9fdab01fe6b621f82dac (patch)
tree86e0ab203b8850bdf532fcbf7bc776dcbb9acde7 /gcc
parent55c250028de823364233e6074b80f0147af677e2 (diff)
downloadgcc-e797f49f7a9dcfc88d7d9fdab01fe6b621f82dac.tar.gz
* gimple.h: Reorder prototypes to match .c declaration order, and remove
protyotypes for functions not in gimple.c. (LABEL): Move to tree-into-ssa.c. * gimple.c: Remove unused prototypes. (get_base_address): Move to tree.c. * tree.c (get_base_address): Relocate from gimple.c. * builtins.h (validate_gimple_arglist): Add prototype. * trans-mem.h (compute_transaction_bits, is_tm_ending): Add prototype. * cfgexpand.h: New File. (gimple_assign_rhs_to_tree, estimated_stack_frame_size): Add protoype. * tree.h (build_addr): Move to tree-nested.h. * tree-nested.h: New File. (build_addr, lower_nested_functions, insert_field_into_struct): Add prototypes. * tree-inline.h (estimated_stack_frame_size): Remove prototype. * ipa-inline-analysis.c: Include cfgexpand.h. * cgraphunit.c: Include tree-nested.h. * omp-low.c: Likewise. * tree-parloops.c: Likewise. * gimple-low.h: Likewise. * tree-profile.h: Likewise. * expr.c: Include cfgexpand.h. * tree-affine.c: Likewise. * tree-ssa.c: Likewise. * tree-ssa-loop-im.c: Include trans-mem.h. * tree-ssa-tail-merge.c: Likewise. * value-prof.c: Include builtins.h and tree-nested.h. * tree-into-ssa.c (LABEL): Define here. * fortran/trans-intrinsic.c: Include tree-nested.h. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204919 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog31
-rw-r--r--gcc/builtins.h2
-rw-r--r--gcc/cfgexpand.h26
-rw-r--r--gcc/cgraphunit.c1
-rw-r--r--gcc/expr.c1
-rw-r--r--gcc/fortran/ChangeLog4
-rw-r--r--gcc/fortran/trans-intrinsic.c1
-rw-r--r--gcc/gimple-low.c1
-rw-r--r--gcc/gimple.c33
-rw-r--r--gcc/gimple.h119
-rw-r--r--gcc/ipa-inline-analysis.c1
-rw-r--r--gcc/omp-low.c1
-rw-r--r--gcc/trans-mem.h3
-rw-r--r--gcc/tree-affine.c1
-rw-r--r--gcc/tree-inline.h2
-rw-r--r--gcc/tree-into-ssa.c1
-rw-r--r--gcc/tree-nested.h27
-rw-r--r--gcc/tree-parloops.c1
-rw-r--r--gcc/tree-profile.c1
-rw-r--r--gcc/tree-ssa-loop-im.c1
-rw-r--r--gcc/tree-ssa-tail-merge.c1
-rw-r--r--gcc/tree-ssa.c1
-rw-r--r--gcc/tree.c28
-rw-r--r--gcc/tree.h3
-rw-r--r--gcc/value-prof.c2
25 files changed, 177 insertions, 116 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5cb07b7882f..0edc5879cbd 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,34 @@
+2013-11-17 Andrew MacLeod <amacleod@redhat.com>
+
+ * gimple.h: Reorder prototypes to match .c declaration order, and remove
+ protyotypes for functions not in gimple.c.
+ (LABEL): Move to tree-into-ssa.c.
+ * gimple.c: Remove unused prototypes.
+ (get_base_address): Move to tree.c.
+ * tree.c (get_base_address): Relocate from gimple.c.
+ * builtins.h (validate_gimple_arglist): Add prototype.
+ * trans-mem.h (compute_transaction_bits, is_tm_ending): Add prototype.
+ * cfgexpand.h: New File.
+ (gimple_assign_rhs_to_tree, estimated_stack_frame_size): Add protoype.
+ * tree.h (build_addr): Move to tree-nested.h.
+ * tree-nested.h: New File.
+ (build_addr, lower_nested_functions, insert_field_into_struct): Add
+ prototypes.
+ * tree-inline.h (estimated_stack_frame_size): Remove prototype.
+ * ipa-inline-analysis.c: Include cfgexpand.h.
+ * cgraphunit.c: Include tree-nested.h.
+ * omp-low.c: Likewise.
+ * tree-parloops.c: Likewise.
+ * gimple-low.h: Likewise.
+ * tree-profile.h: Likewise.
+ * expr.c: Include cfgexpand.h.
+ * tree-affine.c: Likewise.
+ * tree-ssa.c: Likewise.
+ * tree-ssa-loop-im.c: Include trans-mem.h.
+ * tree-ssa-tail-merge.c: Likewise.
+ * value-prof.c: Include builtins.h and tree-nested.h.
+ * tree-into-ssa.c (LABEL): Define here.
+
2013-11-16 Joern Rennecke <joern.rennecke@embecosm.com>
* config/arc/arc.c (arc_predicate_delay_insns): New function.
diff --git a/gcc/builtins.h b/gcc/builtins.h
index e9bc8766be2..0ed9479bdbf 100644
--- a/gcc/builtins.h
+++ b/gcc/builtins.h
@@ -44,4 +44,6 @@ extern struct target_builtins *this_target_builtins;
#define this_target_builtins (&default_target_builtins)
#endif
+extern bool validate_gimple_arglist (const_gimple, ...);
+
#endif
diff --git a/gcc/cfgexpand.h b/gcc/cfgexpand.h
new file mode 100644
index 00000000000..04517a3e3f9
--- /dev/null
+++ b/gcc/cfgexpand.h
@@ -0,0 +1,26 @@
+/* Header file for lowering trees to RTL.
+ Copyright (C) 2013 Free Software Foundation, Inc.
+
+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/>. */
+
+#ifndef GCC_CFGEXPAND_H
+#define GCC_CFGEXPAND_H
+
+extern tree gimple_assign_rhs_to_tree (gimple);
+extern HOST_WIDE_INT estimated_stack_frame_size (struct cgraph_node *);
+
+#endif /* GCC_CFGEXPAND_H */
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 8ab274b5640..863b81e72c0 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -201,6 +201,7 @@ along with GCC; see the file COPYING3. If not see
#include "regset.h" /* FIXME: For reg_obstack. */
#include "context.h"
#include "pass_manager.h"
+#include "tree-nested.h"
/* Queue of cgraph nodes scheduled to be added into cgraph. This is a
secondary queue used during optimization to accommodate passes that
diff --git a/gcc/expr.c b/gcc/expr.c
index 28b43320798..e8c022c45eb 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -57,6 +57,7 @@ along with GCC; see the file COPYING3. If not see
#include "target-globals.h"
#include "params.h"
#include "tree-ssa-address.h"
+#include "cfgexpand.h"
/* Decide whether a function's arguments should be processed
from first to last or from last to first.
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index e6c6244e745..16e8915c0c5 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,7 @@
+2013-11-17 Andrew MacLeod <amacleod@redhat.com>
+
+ * fortran/trans-intrinsic.c: Include tree-nested.h.
+
2013-11-14 Andrew MacLeod <amacleod@redhat.com>
* trans-expr.c: Include only gimplify.h and gimple.h as needed.
diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c
index 7e2bb36ca6d..042911f8ea1 100644
--- a/gcc/fortran/trans-intrinsic.c
+++ b/gcc/fortran/trans-intrinsic.c
@@ -39,6 +39,7 @@ along with GCC; see the file COPYING3. If not see
#include "trans-array.h"
/* Only for gfc_trans_assign and gfc_trans_pointer_assign. */
#include "trans-stmt.h"
+#include "tree-nested.h"
/* This maps Fortran intrinsic math functions to external library or GCC
builtin functions. */
diff --git a/gcc/gimple-low.c b/gcc/gimple-low.c
index 519e984da28..3f9ac575e64 100644
--- a/gcc/gimple-low.c
+++ b/gcc/gimple-low.c
@@ -33,6 +33,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-pass.h"
#include "langhooks.h"
#include "gimple-low.h"
+#include "tree-nested.h"
/* The differences between High GIMPLE and Low GIMPLE are the
following:
diff --git a/gcc/gimple.c b/gcc/gimple.c
index ff798ff42b2..f42d921fa0f 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -84,11 +84,6 @@ static const char * const gimple_alloc_kind_names[] = {
"everything else"
};
-/* Private API manipulation functions shared only with some
- other files. */
-extern void gimple_set_stored_syms (gimple, bitmap, bitmap_obstack *);
-extern void gimple_set_loaded_syms (gimple, bitmap, bitmap_obstack *);
-
/* Gimple tuple constructors.
Note: Any constructor taking a ``gimple_seq'' as a parameter, can
be passed a NULL to start with an empty sequence. */
@@ -1958,34 +1953,6 @@ const unsigned char gimple_rhs_class_table[] = {
#undef DEFTREECODE
#undef END_OF_BASE_TREE_CODES
-/* Given a memory reference expression T, return its base address.
- The base address of a memory reference expression is the main
- object being referenced. For instance, the base address for
- 'array[i].fld[j]' is 'array'. You can think of this as stripping
- away the offset part from a memory address.
-
- This function calls handled_component_p to strip away all the inner
- parts of the memory reference until it reaches the base object. */
-
-tree
-get_base_address (tree t)
-{
- while (handled_component_p (t))
- t = TREE_OPERAND (t, 0);
-
- if ((TREE_CODE (t) == MEM_REF
- || TREE_CODE (t) == TARGET_MEM_REF)
- && TREE_CODE (TREE_OPERAND (t, 0)) == ADDR_EXPR)
- t = TREE_OPERAND (TREE_OPERAND (t, 0), 0);
-
- /* ??? Either the alias oracle or all callers need to properly deal
- with WITH_SIZE_EXPRs before we can look through those. */
- if (TREE_CODE (t) == WITH_SIZE_EXPR)
- return NULL_TREE;
-
- return t;
-}
-
void
recalculate_side_effects (tree t)
{
diff --git a/gcc/gimple.h b/gcc/gimple.h
index e675b0753b2..022bac93aaf 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -727,32 +727,26 @@ extern enum gimple_statement_structure_enum const gss_for_code_[];
of comminucating the profile info to the builtin expanders. */
extern gimple currently_expanding_gimple_stmt;
+#define gimple_alloc(c, n) gimple_alloc_stat (c, n MEM_STAT_INFO)
+gimple gimple_alloc_stat (enum gimple_code, unsigned MEM_STAT_DECL);
gimple gimple_build_return (tree);
-
-gimple gimple_build_assign_stat (tree, tree MEM_STAT_DECL);
-#define gimple_build_assign(l,r) gimple_build_assign_stat (l, r MEM_STAT_INFO)
-
-gimple
-gimple_build_assign_with_ops (enum tree_code, tree,
- tree, tree CXX_MEM_STAT_INFO);
-gimple
-gimple_build_assign_with_ops (enum tree_code, tree,
- tree, tree, tree CXX_MEM_STAT_INFO);
-
-gimple gimple_build_debug_bind_stat (tree, tree, gimple MEM_STAT_DECL);
-#define gimple_build_debug_bind(var,val,stmt) \
- gimple_build_debug_bind_stat ((var), (val), (stmt) MEM_STAT_INFO)
-gimple gimple_build_debug_source_bind_stat (tree, tree, gimple MEM_STAT_DECL);
-#define gimple_build_debug_source_bind(var,val,stmt) \
- gimple_build_debug_source_bind_stat ((var), (val), (stmt) MEM_STAT_INFO)
-
+void gimple_call_reset_alias_info (gimple);
gimple gimple_build_call_vec (tree, vec<tree> );
gimple gimple_build_call (tree, unsigned, ...);
gimple gimple_build_call_valist (tree, unsigned, va_list);
gimple gimple_build_call_internal (enum internal_fn, unsigned, ...);
gimple gimple_build_call_internal_vec (enum internal_fn, vec<tree> );
gimple gimple_build_call_from_tree (tree);
+extern unsigned gimple_call_get_nobnd_arg_index (const_gimple, unsigned);
+gimple gimple_build_assign_stat (tree, tree MEM_STAT_DECL);
+#define gimple_build_assign(l,r) gimple_build_assign_stat (l, r MEM_STAT_INFO)
+gimple gimple_build_assign_with_ops (enum tree_code, tree,
+ tree, tree, tree CXX_MEM_STAT_INFO);
+gimple gimple_build_assign_with_ops (enum tree_code, tree,
+ tree, tree CXX_MEM_STAT_INFO);
gimple gimple_build_cond (enum tree_code, tree, tree, tree, tree);
+gimple gimple_build_cond_from_tree (tree, tree, tree);
+void gimple_cond_set_condition_from_tree (gimple, tree);
gimple gimple_build_label (tree label);
gimple gimple_build_goto (tree dest);
gimple gimple_build_nop (void);
@@ -767,39 +761,46 @@ gimple gimple_build_eh_else (gimple_seq, gimple_seq);
gimple gimple_build_try (gimple_seq, gimple_seq, enum gimple_try_flags);
gimple gimple_build_wce (gimple_seq);
gimple gimple_build_resx (int);
-gimple gimple_build_eh_dispatch (int);
gimple gimple_build_switch_nlabels (unsigned, tree, tree);
gimple gimple_build_switch (tree, tree, vec<tree> );
+gimple gimple_build_eh_dispatch (int);
+gimple gimple_build_debug_bind_stat (tree, tree, gimple MEM_STAT_DECL);
+#define gimple_build_debug_bind(var,val,stmt) \
+ gimple_build_debug_bind_stat ((var), (val), (stmt) MEM_STAT_INFO)
+gimple gimple_build_debug_source_bind_stat (tree, tree, gimple MEM_STAT_DECL);
+#define gimple_build_debug_source_bind(var,val,stmt) \
+ gimple_build_debug_source_bind_stat ((var), (val), (stmt) MEM_STAT_INFO)
+gimple gimple_build_omp_critical (gimple_seq, tree);
+gimple gimple_build_omp_for (gimple_seq, int, tree, size_t, gimple_seq);
gimple gimple_build_omp_parallel (gimple_seq, tree, tree, tree);
gimple gimple_build_omp_task (gimple_seq, tree, tree, tree, tree, tree, tree);
-gimple gimple_build_omp_for (gimple_seq, int, tree, size_t, gimple_seq);
-gimple gimple_build_omp_critical (gimple_seq, tree);
gimple gimple_build_omp_section (gimple_seq);
-gimple gimple_build_omp_continue (tree, tree);
gimple gimple_build_omp_master (gimple_seq);
gimple gimple_build_omp_taskgroup (gimple_seq);
-gimple gimple_build_omp_return (bool);
+gimple gimple_build_omp_continue (tree, tree);
gimple gimple_build_omp_ordered (gimple_seq);
+gimple gimple_build_omp_return (bool);
gimple gimple_build_omp_sections (gimple_seq, tree);
gimple gimple_build_omp_sections_switch (void);
gimple gimple_build_omp_single (gimple_seq, tree);
gimple gimple_build_omp_target (gimple_seq, int, tree);
gimple gimple_build_omp_teams (gimple_seq, tree);
-gimple gimple_build_cdt (tree, tree);
gimple gimple_build_omp_atomic_load (tree, tree);
gimple gimple_build_omp_atomic_store (tree);
gimple gimple_build_transaction (gimple_seq, tree);
gimple gimple_build_predict (enum br_predictor, enum prediction);
-enum gimple_statement_structure_enum gss_for_assign (enum tree_code);
-gimple_seq gimple_seq_alloc (void);
-void gimple_seq_free (gimple_seq);
+extern void gimple_seq_add_stmt (gimple_seq *, gimple);
+extern void gimple_seq_add_stmt_without_update (gimple_seq *, gimple);
void gimple_seq_add_seq (gimple_seq *, gimple_seq);
+extern void annotate_all_with_location_after (gimple_seq, gimple_stmt_iterator,
+ location_t);
+extern void annotate_all_with_location (gimple_seq, location_t);
+bool empty_body_p (gimple_seq);
gimple_seq gimple_seq_copy (gimple_seq);
bool gimple_call_same_target_p (const_gimple, const_gimple);
int gimple_call_flags (const_gimple);
-int gimple_call_return_flags (const_gimple);
int gimple_call_arg_flags (const_gimple, unsigned);
-void gimple_call_reset_alias_info (gimple);
+int gimple_call_return_flags (const_gimple);
bool gimple_assign_copy_p (gimple);
bool gimple_assign_ssa_name_copy_p (gimple);
bool gimple_assign_unary_nop_p (gimple);
@@ -809,35 +810,31 @@ void gimple_assign_set_rhs_with_ops_1 (gimple_stmt_iterator *, enum tree_code,
tree, tree, tree);
tree gimple_get_lhs (const_gimple);
void gimple_set_lhs (gimple, tree);
-void gimple_replace_lhs (gimple, tree);
gimple gimple_copy (gimple);
-gimple gimple_build_cond_from_tree (tree, tree, tree);
-void gimple_cond_set_condition_from_tree (gimple, tree);
bool gimple_has_side_effects (const_gimple);
-bool gimple_could_trap_p (gimple);
bool gimple_could_trap_p_1 (gimple, bool, bool);
+bool gimple_could_trap_p (gimple);
bool gimple_assign_rhs_could_trap_p (gimple);
-bool empty_body_p (gimple_seq);
-extern void annotate_all_with_location_after (gimple_seq, gimple_stmt_iterator,
- location_t);
-extern void annotate_all_with_location (gimple_seq, location_t);
+extern void dump_gimple_statistics (void);
unsigned get_gimple_rhs_num_ops (enum tree_code);
-#define gimple_alloc(c, n) gimple_alloc_stat (c, n MEM_STAT_INFO)
-gimple gimple_alloc_stat (enum gimple_code, unsigned MEM_STAT_DECL);
-
-/* Return TRUE iff stmt is a call to a built-in function. */
-extern bool is_gimple_builtin_call (gimple stmt);
-
extern void recalculate_side_effects (tree);
+extern tree canonicalize_cond_expr_cond (tree);
+gimple gimple_call_copy_skip_args (gimple, bitmap);
extern bool gimple_compare_field_offset (tree, tree);
extern tree gimple_unsigned_type (tree);
extern tree gimple_signed_type (tree);
extern alias_set_type gimple_get_alias_set (tree);
extern bool gimple_ior_addresses_taken (bitmap, gimple);
+extern bool is_gimple_builtin_call (gimple stmt);
extern bool gimple_call_builtin_p (gimple, enum built_in_class);
extern bool gimple_call_builtin_p (gimple, enum built_in_function);
extern bool gimple_asm_clobbers_memory_p (const_gimple);
-extern unsigned gimple_call_get_nobnd_arg_index (const_gimple, unsigned);
+extern void dump_decl_set (FILE *, bitmap);
+extern bool nonfreeing_call_p (gimple);
+extern bool infer_nonnull_range (gimple, tree);
+extern void sort_case_labels (vec<tree> );
+extern void preprocess_case_label_vec_for_gimple (vec<tree> , tree, tree *);
+extern void gimple_seq_set_location (gimple_seq , location_t);
/* Formal (expression) temporary table handling: multiple occurrences of
the same scalar expression are evaluated into the same temporary. */
@@ -869,27 +866,6 @@ inc_gimple_stmt_max_uid (struct function *fn)
return fn->last_stmt_uid++;
}
-/* Miscellaneous helpers. */
-extern tree canonicalize_cond_expr_cond (tree);
-extern void dump_decl_set (FILE *, bitmap);
-extern bool nonfreeing_call_p (gimple);
-extern bool infer_nonnull_range (gimple, tree);
-
-/* In trans-mem.c. */
-extern void diagnose_tm_safe_errors (tree);
-extern void compute_transaction_bits (void);
-extern bool is_tm_ending (gimple);
-
-/* In tree-nested.c. */
-extern void lower_nested_functions (tree);
-extern void insert_field_into_struct (tree, tree);
-
-/* In cfgexpand.c. */
-extern tree gimple_assign_rhs_to_tree (gimple);
-
-/* In builtins.c */
-extern bool validate_gimple_arglist (const_gimple, ...);
-
/* Return the first node in GIMPLE sequence S. */
static inline gimple_seq_node
@@ -954,9 +930,6 @@ gimple_seq_empty_p (gimple_seq s)
return s == NULL;
}
-extern void gimple_seq_add_stmt (gimple_seq *, gimple);
-extern void gimple_seq_add_stmt_without_update (gimple_seq *, gimple);
-
/* Allocate a new sequence and initialize its first element with STMT. */
static inline gimple_seq
@@ -5123,8 +5096,6 @@ gimple_expr_type (const_gimple stmt)
return void_type_node;
}
-gimple gimple_call_copy_skip_args (gimple, bitmap);
-
/* Enum and arrays used for allocation stats. Keep in sync with
gimple.c:gimple_alloc_kind_names. */
enum gimple_alloc_kind
@@ -5156,8 +5127,6 @@ gimple_alloc_kind (enum gimple_code code)
}
}
-extern void dump_gimple_statistics (void);
-
/* Return true if a location should not be emitted for this statement
by annotate_all_with_location. */
@@ -5188,10 +5157,4 @@ gimple_set_do_not_emit_location (gimple g)
#define LABEL(x) ((x) < 1024*10 ? 'b' : ((x) < 1024*1024*10 ? 'k' : 'M'))
-#define PERCENT(x,y) ((float)(x) * 100.0 / (float)(y))
-
-extern void sort_case_labels (vec<tree> );
-extern void preprocess_case_label_vec_for_gimple (vec<tree> , tree, tree *);
-extern void gimple_seq_set_location (gimple_seq , location_t);
-
#endif /* GCC_GIMPLE_H */
diff --git a/gcc/ipa-inline-analysis.c b/gcc/ipa-inline-analysis.c
index 2231c77ad66..52878b30957 100644
--- a/gcc/ipa-inline-analysis.c
+++ b/gcc/ipa-inline-analysis.c
@@ -97,6 +97,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-scalar-evolution.h"
#include "ipa-utils.h"
#include "cilk.h"
+#include "cfgexpand.h"
/* Estimate runtime of function can easilly run into huge numbers with many
nested loops. Be sure we can compute time * INLINE_SIZE_SCALE * 2 in an
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index e2fc53c4b83..8d5de21bd4b 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -58,6 +58,7 @@ along with GCC; see the file COPYING3. If not see
#include "omp-low.h"
#include "gimple-low.h"
#include "tree-cfgcleanup.h"
+#include "tree-nested.h"
/* Lowering of OpenMP parallel and workshare constructs proceeds in two
diff --git a/gcc/trans-mem.h b/gcc/trans-mem.h
index bf5a4484f75..09f0b4d66e4 100644
--- a/gcc/trans-mem.h
+++ b/gcc/trans-mem.h
@@ -34,3 +34,6 @@
#define PR_EXCEPTIONBLOCK 0x1000
#define PR_HASELSE 0x2000
#define PR_READONLY 0x4000
+
+extern void compute_transaction_bits (void);
+extern bool is_tm_ending (gimple);
diff --git a/gcc/tree-affine.c b/gcc/tree-affine.c
index d6d5686ef15..25fd7f287e0 100644
--- a/gcc/tree-affine.c
+++ b/gcc/tree-affine.c
@@ -28,6 +28,7 @@ along with GCC; see the file COPYING3. If not see
#include "gimplify.h"
#include "flags.h"
#include "dumpfile.h"
+#include "cfgexpand.h"
/* Extends CST as appropriate for the affine combinations COMB. */
diff --git a/gcc/tree-inline.h b/gcc/tree-inline.h
index cd327154560..50ccaab42fc 100644
--- a/gcc/tree-inline.h
+++ b/gcc/tree-inline.h
@@ -202,6 +202,4 @@ extern tree remap_decl (tree decl, copy_body_data *id);
extern tree remap_type (tree type, copy_body_data *id);
extern gimple_seq copy_gimple_seq_and_replace_locals (gimple_seq seq);
-extern HOST_WIDE_INT estimated_stack_frame_size (struct cgraph_node *);
-
#endif /* GCC_TREE_INLINE_H */
diff --git a/gcc/tree-into-ssa.c b/gcc/tree-into-ssa.c
index e7c5d50da0c..ee86f2cfa9d 100644
--- a/gcc/tree-into-ssa.c
+++ b/gcc/tree-into-ssa.c
@@ -48,6 +48,7 @@ along with GCC; see the file COPYING3. If not see
#include "diagnostic-core.h"
#include "tree-into-ssa.h"
+#define PERCENT(x,y) ((float)(x) * 100.0 / (float)(y))
/* This file builds the SSA form for a function as described in:
R. Cytron, J. Ferrante, B. Rosen, M. Wegman, and K. Zadeck. Efficiently
diff --git a/gcc/tree-nested.h b/gcc/tree-nested.h
new file mode 100644
index 00000000000..bfaa65315d7
--- /dev/null
+++ b/gcc/tree-nested.h
@@ -0,0 +1,27 @@
+/* Header file for Nested function decomposition for GIMPLE.
+ Copyright (C) 2013 Free Software Foundation, Inc.
+
+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/>. */
+
+#ifndef GCC_TREE_NESTED_H
+#define GCC_TREE_NESTED_H
+
+extern tree build_addr (tree, tree);
+extern void insert_field_into_struct (tree, tree);
+extern void lower_nested_functions (tree);
+
+#endif /* GCC_TREE_NESTED_H */
diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c
index 867992b6bb9..648331cc767 100644
--- a/gcc/tree-parloops.c
+++ b/gcc/tree-parloops.c
@@ -48,6 +48,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-hasher.h"
#include "tree-parloops.h"
#include "omp-low.h"
+#include "tree-nested.h"
/* This pass tries to distribute iterations of loops into several threads.
The implementation is straightforward -- for each loop we test whether its
diff --git a/gcc/tree-profile.c b/gcc/tree-profile.c
index f3f97b2e0dc..132ce0d4d13 100644
--- a/gcc/tree-profile.c
+++ b/gcc/tree-profile.c
@@ -48,6 +48,7 @@ along with GCC; see the file COPYING3. If not see
#include "profile.h"
#include "target.h"
#include "tree-cfgcleanup.h"
+#include "tree-nested.h"
static GTY(()) tree gcov_type_node;
static GTY(()) tree tree_interval_profiler_fn;
diff --git a/gcc/tree-ssa-loop-im.c b/gcc/tree-ssa-loop-im.c
index ad34d76e840..1c6113e6c63 100644
--- a/gcc/tree-ssa-loop-im.c
+++ b/gcc/tree-ssa-loop-im.c
@@ -46,6 +46,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-affine.h"
#include "pointer-set.h"
#include "tree-ssa-propagate.h"
+#include "trans-mem.h"
/* TODO: Support for predicated code motion. I.e.
diff --git a/gcc/tree-ssa-tail-merge.c b/gcc/tree-ssa-tail-merge.c
index c97da97f6d3..8d81f57daf5 100644
--- a/gcc/tree-ssa-tail-merge.c
+++ b/gcc/tree-ssa-tail-merge.c
@@ -209,6 +209,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-dump.h"
#include "cfgloop.h"
#include "tree-pass.h"
+#include "trans-mem.h"
/* Describes a group of bbs with the same successors. The successor bbs are
cached in succs, and the successor edge flags are cached in succ_flags.
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index f16e77b53f5..d2552361a66 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -47,6 +47,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-pass.h"
#include "diagnostic-core.h"
#include "cfgloop.h"
+#include "cfgexpand.h"
/* Pointer map of variable mappings, keyed by edge. */
static struct pointer_map_t *edge_var_maps;
diff --git a/gcc/tree.c b/gcc/tree.c
index 97c9c8ac37d..34bc8ac73a5 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -12267,4 +12267,32 @@ drop_tree_overflow (tree t)
return t;
}
+/* Given a memory reference expression T, return its base address.
+ The base address of a memory reference expression is the main
+ object being referenced. For instance, the base address for
+ 'array[i].fld[j]' is 'array'. You can think of this as stripping
+ away the offset part from a memory address.
+
+ This function calls handled_component_p to strip away all the inner
+ parts of the memory reference until it reaches the base object. */
+
+tree
+get_base_address (tree t)
+{
+ while (handled_component_p (t))
+ t = TREE_OPERAND (t, 0);
+
+ if ((TREE_CODE (t) == MEM_REF
+ || TREE_CODE (t) == TARGET_MEM_REF)
+ && TREE_CODE (TREE_OPERAND (t, 0)) == ADDR_EXPR)
+ t = TREE_OPERAND (TREE_OPERAND (t, 0), 0);
+
+ /* ??? Either the alias oracle or all callers need to properly deal
+ with WITH_SIZE_EXPRs before we can look through those. */
+ if (TREE_CODE (t) == WITH_SIZE_EXPR)
+ return NULL_TREE;
+
+ return t;
+}
+
#include "gt-tree.h"
diff --git a/gcc/tree.h b/gcc/tree.h
index e58b3a5c0c4..bc6699dca98 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -4597,9 +4597,6 @@ extern bool using_eh_for_cleanups_p (void);
extern const char *get_tree_code_name (enum tree_code);
-/* In tree-nested.c */
-extern tree build_addr (tree, tree);
-
/* In function.c */
extern void expand_function_end (void);
extern void expand_function_start (tree);
diff --git a/gcc/value-prof.c b/gcc/value-prof.c
index 719cf9a59f0..ad70ceaea4a 100644
--- a/gcc/value-prof.c
+++ b/gcc/value-prof.c
@@ -51,6 +51,8 @@ along with GCC; see the file COPYING3. If not see
#include "pointer-set.h"
#include "profile.h"
#include "data-streamer.h"
+#include "builtins.h"
+#include "tree-nested.h"
/* In this file value profile based optimizations are placed. Currently the
following optimizations are implemented (for more detailed descriptions