summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoramacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-12 20:26:43 +0000
committeramacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-12 20:26:43 +0000
commita8783bee0f1128c01d3768789a03b60b5a6ebd99 (patch)
treeec5ecce5dd0b07212d3416eab7b065b138ed7577
parent2873e7a09ea37c5a6d10e27cf44993e97f9b7b7f (diff)
downloadgcc-a8783bee0f1128c01d3768789a03b60b5a6ebd99.tar.gz
2013-11-12 Andrew MacLeod <amacleod@redhat.com>
* gimple-expr.h (create_tmp_var_name, create_tmp_var_raw, create_tmp_var, create_tmp_reg, mark_addressable, is_gimple_reg_rhs): Relocate prototypes from gimple.h. * gimplify.h: New File. Relocate some prototypes from gimple.h here. (gimple_predicate, enum fallback, enum gimplify_status): Relocate from gimple.h. * gimple.h: Move some prototypes to gimplify.h. (gimple_predicate, enum fallback, enum gimplify_status): Move to gimplify.h. (gimple_do_not_emit_location_p, gimple_set_do_not_emit_location): Relocate from gimpify.c. * gimple-expr.c (remove_suffix, tmp_var_id_num, create_tmp_var_name, create_tmp_var_raw, create_tmp_var, create_tmp_reg, mark_addressable, is_gimple_reg_rhs) Relocate from gimplify.c. * gimplify.c (mark_addressable): Move to gimple-expr.c. (gimple_seq_add_stmt_without_update): Move to gimple.c. (remove_suffix, tmp_var_id_num, create_tmp_var_name, create_tmp_var_raw, create_tmp_var, create_tmp_reg, is_gimple_reg_rhs): Move to gimple-expr.c. (should_carry_location_p): Move to gimple.c. (gimple_do_not_emit_location_p, gimple_set_do_not_emit_location): Move to gimple.h. (annotate_one_with_location, annotate_all_with_location_after, annotate_all_with_location): Move to gimple.c. (compare_case_labels, sort_case_labels, preprocess_case_label_vec_for_gimple): Move to gimple.c. (rhs_predicate_for): Make static. (gimplify_assign): Relocate from gimple.c. * gimple.c (gimplify_assign): Move to gimplify.c. (gimple_seq_add_stmt_without_update, should_carry_location_p, annotate_one_with_location, annotate_all_with_location_after, annotate_all_with_location, compare_case_labels, sort_case_labels, preprocess_case_label_vec_for_gimple): Relocate from gimplify.c. * tree.h (unshare_expr, unshare_expr_without_location, mark_addressable): Move prototypes to gimplify.h. * Makefile.in (GTFILES): gimple-expr.c now has the GTY tag for tmp_var_id_num * asan.c: Include gimplify.h rather than gimple.h. * cfgloopmanip.c: Likewise. * cgraphunit.c: Likewise. * cilk-common.c: Likewise. * dwarf2out.c: Dont include gimple.h. * fold-const.c: Include gimplify.h rather than gimple.h. * function.c: Likewise. * gimple-fold.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-sese-to-poly.c: Likewise. * ipa-prop.c: Likewise. * ipa-split.c: Likewise. * ipa.c: Likewise. * langhooks.c: Dont include gimple.h. * loop-init.c: Include gimplify.h rather than gimple.h. * omp-low.c: Likewise. * sese.c: Likewise. * stor-layout.c: Likewise. * targhooks.c: Likewise. * trans-mem.c: Likewise. * tree-affine.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-complex.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-nested.c: Likewise. * tree-parloops.c: Likewise. * tree-predcom.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa.c: Likewise. * tree-switch-conversio: Likewise.n.c * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-stmts.c: Likewise. * tsan.c: Likewise. * value-prof.c: Likewise. * config/aarch64/aarch64.c: Include gimplify.h instead of gimple.h. * config/alpha/alpha.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/s390/s390.c: Likewise. * config/sh/sh.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/tilegx/tilegx.c: Likewise. * config/tilepro/tilepro.c: Likewise. * config/xtensa/xtensa.c: Likewise. * ada/gcc-interface/trans.c: Include gimplify.h. * c/c-typeck.c: Include gimplify.h. * c-family/c-common.c: Include gimplify.h. * c-family/c-gimplify.c: Likewise. * c-family/cilk.c: Likewise. * c-family/c-omp.c: Include gimple-expr.h instead of gimple.h. * c-family/c-ubsan.c: Don't include gimple.h. * cp/class.c: Include gimplify.h. * cp/cp-gimplify.c: Likewise. * cp/error.c: Likewise. * cp/init.c: Likewise. * cp/optimize.c: Likewise. * cp/pt.c: Likewise. * cp/semantics.c: Likewise. * cp/tree.c: Likewise. * cp/vtable-class-hierarchy.c: Likewise. * cp/decl2.c: Don't include gimple.h. * cp/except.c: Likewise. * cp/method.c: Include pointer-set.h instead of gimple.h. * fortran/f95-lang.c: Don't include gimple.h. * fortran/trans-array.c: Include gimple-expr.h instead of gimple.h. * fortran/trans.c: Likewise. * fortran/trans-decl.c: Likewise. * fortran/trans-expr.c: Include gimplify.h. * fortran/trans-openmp.c: Likewise. * go/go-lang.c: Include gimplify.h. * java/java-gimplify.c: Include gimplify.h. * objc/objc-act.c: Include gimplify.h. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204717 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog121
-rw-r--r--gcc/Makefile.in2
-rw-r--r--gcc/ada/ChangeLog4
-rw-r--r--gcc/ada/gcc-interface/trans.c2
-rw-r--r--gcc/asan.c2
-rw-r--r--gcc/c-family/ChangeLog8
-rw-r--r--gcc/c-family/c-common.c1
-rw-r--r--gcc/c-family/c-gimplify.c2
-rw-r--r--gcc/c-family/c-omp.c2
-rw-r--r--gcc/c-family/c-ubsan.c1
-rw-r--r--gcc/c-family/cilk.c2
-rw-r--r--gcc/c/ChangeLog4
-rw-r--r--gcc/c/c-typeck.c2
-rw-r--r--gcc/cfgloopmanip.c2
-rw-r--r--gcc/cgraphunit.c2
-rw-r--r--gcc/cilk-common.c2
-rw-r--r--gcc/config/aarch64/aarch64.c2
-rw-r--r--gcc/config/alpha/alpha.c2
-rw-r--r--gcc/config/darwin.c2
-rw-r--r--gcc/config/i386/i386.c2
-rw-r--r--gcc/config/ia64/ia64.c2
-rw-r--r--gcc/config/mep/mep.c2
-rw-r--r--gcc/config/mips/mips.c2
-rw-r--r--gcc/config/rs6000/rs6000.c2
-rw-r--r--gcc/config/s390/s390.c2
-rw-r--r--gcc/config/sh/sh.c2
-rw-r--r--gcc/config/sparc/sparc.c2
-rw-r--r--gcc/config/spu/spu.c2
-rw-r--r--gcc/config/stormy16/stormy16.c2
-rw-r--r--gcc/config/tilegx/tilegx.c2
-rw-r--r--gcc/config/tilepro/tilepro.c2
-rw-r--r--gcc/config/xtensa/xtensa.c2
-rw-r--r--gcc/cp/ChangeLog15
-rw-r--r--gcc/cp/class.c1
-rw-r--r--gcc/cp/cp-gimplify.c2
-rw-r--r--gcc/cp/decl2.c1
-rw-r--r--gcc/cp/error.c1
-rw-r--r--gcc/cp/except.c1
-rw-r--r--gcc/cp/init.c1
-rw-r--r--gcc/cp/method.c2
-rw-r--r--gcc/cp/optimize.c2
-rw-r--r--gcc/cp/pt.c1
-rw-r--r--gcc/cp/semantics.c2
-rw-r--r--gcc/cp/tree.c2
-rw-r--r--gcc/cp/vtable-class-hierarchy.c2
-rw-r--r--gcc/dwarf2out.c1
-rw-r--r--gcc/fold-const.c2
-rw-r--r--gcc/fortran/ChangeLog9
-rw-r--r--gcc/fortran/f95-lang.c1
-rw-r--r--gcc/fortran/trans-array.c2
-rw-r--r--gcc/fortran/trans-decl.c2
-rw-r--r--gcc/fortran/trans-expr.c1
-rw-r--r--gcc/fortran/trans-openmp.c2
-rw-r--r--gcc/fortran/trans.c2
-rw-r--r--gcc/function.c2
-rw-r--r--gcc/gimple-expr.c155
-rw-r--r--gcc/gimple-expr.h8
-rw-r--r--gcc/gimple-fold.c2
-rw-r--r--gcc/gimple-ssa-strength-reduction.c2
-rw-r--r--gcc/gimple.c296
-rw-r--r--gcc/gimple.h116
-rw-r--r--gcc/gimplify.c496
-rw-r--r--gcc/gimplify.h92
-rw-r--r--gcc/go/ChangeLog4
-rw-r--r--gcc/go/go-lang.c2
-rw-r--r--gcc/graphite-clast-to-gimple.c2
-rw-r--r--gcc/graphite-sese-to-poly.c2
-rw-r--r--gcc/ipa-prop.c2
-rw-r--r--gcc/ipa-split.c2
-rw-r--r--gcc/ipa.c2
-rw-r--r--gcc/java/ChangeLog4
-rw-r--r--gcc/java/java-gimplify.c2
-rw-r--r--gcc/langhooks.c2
-rw-r--r--gcc/loop-init.c1
-rw-r--r--gcc/objc/ChangeLog4
-rw-r--r--gcc/objc/objc-act.c2
-rw-r--r--gcc/omp-low.c2
-rw-r--r--gcc/sese.c2
-rw-r--r--gcc/stor-layout.c2
-rw-r--r--gcc/targhooks.c2
-rw-r--r--gcc/trans-mem.c2
-rw-r--r--gcc/tree-affine.c2
-rw-r--r--gcc/tree-cfg.c2
-rw-r--r--gcc/tree-cfgcleanup.c2
-rw-r--r--gcc/tree-complex.c2
-rw-r--r--gcc/tree-if-conv.c2
-rw-r--r--gcc/tree-inline.c2
-rw-r--r--gcc/tree-iterator.c1
-rw-r--r--gcc/tree-loop-distribution.c2
-rw-r--r--gcc/tree-nested.c2
-rw-r--r--gcc/tree-parloops.c2
-rw-r--r--gcc/tree-predcom.c2
-rw-r--r--gcc/tree-profile.c2
-rw-r--r--gcc/tree-scalar-evolution.c2
-rw-r--r--gcc/tree-sra.c2
-rw-r--r--gcc/tree-ssa-address.c2
-rw-r--r--gcc/tree-ssa-ccp.c2
-rw-r--r--gcc/tree-ssa-dce.c2
-rw-r--r--gcc/tree-ssa-forwprop.c2
-rw-r--r--gcc/tree-ssa-ifcombine.c2
-rw-r--r--gcc/tree-ssa-loop-im.c2
-rw-r--r--gcc/tree-ssa-loop-ivopts.c2
-rw-r--r--gcc/tree-ssa-loop-manip.c2
-rw-r--r--gcc/tree-ssa-loop-niter.c2
-rw-r--r--gcc/tree-ssa-loop-prefetch.c2
-rw-r--r--gcc/tree-ssa-loop-unswitch.c2
-rw-r--r--gcc/tree-ssa-math-opts.c2
-rw-r--r--gcc/tree-ssa-phiopt.c2
-rw-r--r--gcc/tree-ssa-phiprop.c2
-rw-r--r--gcc/tree-ssa-pre.c2
-rw-r--r--gcc/tree-ssa-propagate.c2
-rw-r--r--gcc/tree-ssa-reassoc.c2
-rw-r--r--gcc/tree-ssa-sccvn.c2
-rw-r--r--gcc/tree-ssa-strlen.c2
-rw-r--r--gcc/tree-ssa.c2
-rw-r--r--gcc/tree-switch-conversion.c2
-rw-r--r--gcc/tree-tailcall.c2
-rw-r--r--gcc/tree-vect-data-refs.c2
-rw-r--r--gcc/tree-vect-generic.c2
-rw-r--r--gcc/tree-vect-loop-manip.c2
-rw-r--r--gcc/tree-vect-loop.c2
-rw-r--r--gcc/tree-vect-patterns.c2
-rw-r--r--gcc/tree-vect-stmts.c2
-rw-r--r--gcc/tree.h5
-rw-r--r--gcc/tsan.c2
-rw-r--r--gcc/value-prof.c2
126 files changed, 870 insertions, 678 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 630a082f7eb..a6b57240832 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,124 @@
+2013-11-12 Andrew MacLeod <amacleod@redhat.com>
+
+ * gimple-expr.h (create_tmp_var_name, create_tmp_var_raw,
+ create_tmp_var, create_tmp_reg, mark_addressable, is_gimple_reg_rhs):
+ Relocate prototypes from gimple.h.
+ * gimplify.h: New File. Relocate some prototypes from gimple.h here.
+ (gimple_predicate, enum fallback, enum gimplify_status): Relocate
+ from gimple.h.
+ * gimple.h: Move some prototypes to gimplify.h.
+ (gimple_predicate, enum fallback, enum gimplify_status): Move to
+ gimplify.h.
+ (gimple_do_not_emit_location_p, gimple_set_do_not_emit_location):
+ Relocate from gimpify.c.
+ * gimple-expr.c (remove_suffix, tmp_var_id_num, create_tmp_var_name,
+ create_tmp_var_raw, create_tmp_var, create_tmp_reg, mark_addressable,
+ is_gimple_reg_rhs) Relocate from gimplify.c.
+ * gimplify.c (mark_addressable): Move to gimple-expr.c.
+ (gimple_seq_add_stmt_without_update): Move to gimple.c.
+ (remove_suffix, tmp_var_id_num, create_tmp_var_name, create_tmp_var_raw,
+ create_tmp_var, create_tmp_reg, is_gimple_reg_rhs): Move to
+ gimple-expr.c.
+ (should_carry_location_p): Move to gimple.c.
+ (gimple_do_not_emit_location_p, gimple_set_do_not_emit_location): Move
+ to gimple.h.
+ (annotate_one_with_location, annotate_all_with_location_after,
+ annotate_all_with_location): Move to gimple.c.
+ (compare_case_labels, sort_case_labels,
+ preprocess_case_label_vec_for_gimple): Move to gimple.c.
+ (rhs_predicate_for): Make static.
+ (gimplify_assign): Relocate from gimple.c.
+ * gimple.c (gimplify_assign): Move to gimplify.c.
+ (gimple_seq_add_stmt_without_update, should_carry_location_p,
+ annotate_one_with_location, annotate_all_with_location_after,
+ annotate_all_with_location, compare_case_labels, sort_case_labels,
+ preprocess_case_label_vec_for_gimple): Relocate from gimplify.c.
+ * tree.h (unshare_expr, unshare_expr_without_location,
+ mark_addressable): Move prototypes to gimplify.h.
+ * Makefile.in (GTFILES): gimple-expr.c now has the GTY tag for
+ tmp_var_id_num
+ * asan.c: Include gimplify.h rather than gimple.h.
+ * cfgloopmanip.c: Likewise.
+ * cgraphunit.c: Likewise.
+ * cilk-common.c: Likewise.
+ * dwarf2out.c: Dont include gimple.h.
+ * fold-const.c: Include gimplify.h rather than gimple.h.
+ * function.c: Likewise.
+ * gimple-fold.c: Likewise.
+ * gimple-ssa-strength-reduction.c: Likewise.
+ * graphite-clast-to-gimple.c: Likewise.
+ * graphite-sese-to-poly.c: Likewise.
+ * ipa-prop.c: Likewise.
+ * ipa-split.c: Likewise.
+ * ipa.c: Likewise.
+ * langhooks.c: Dont include gimple.h.
+ * loop-init.c: Include gimplify.h rather than gimple.h.
+ * omp-low.c: Likewise.
+ * sese.c: Likewise.
+ * stor-layout.c: Likewise.
+ * targhooks.c: Likewise.
+ * trans-mem.c: Likewise.
+ * tree-affine.c: Likewise.
+ * tree-cfg.c: Likewise.
+ * tree-cfgcleanup.c: Likewise.
+ * tree-complex.c: Likewise.
+ * tree-if-conv.c: Likewise.
+ * tree-inline.c: Likewise.
+ * tree-iterator.c: Likewise.
+ * tree-loop-distribution.c: Likewise.
+ * tree-nested.c: Likewise.
+ * tree-parloops.c: Likewise.
+ * tree-predcom.c: Likewise.
+ * tree-profile.c: Likewise.
+ * tree-scalar-evolution.c: Likewise.
+ * tree-sra.c: Likewise.
+ * tree-ssa-address.c: Likewise.
+ * tree-ssa-ccp.c: Likewise.
+ * tree-ssa-dce.c: Likewise.
+ * tree-ssa-forwprop.c: Likewise.
+ * tree-ssa-ifcombine.c: Likewise.
+ * tree-ssa-loop-im.c: Likewise.
+ * tree-ssa-loop-ivopts.c: Likewise.
+ * tree-ssa-loop-manip.c: Likewise.
+ * tree-ssa-loop-niter.c: Likewise.
+ * tree-ssa-loop-prefetch.c: Likewise.
+ * tree-ssa-loop-unswitch.c: Likewise.
+ * tree-ssa-math-opts.c: Likewise.
+ * tree-ssa-phiopt.c: Likewise.
+ * tree-ssa-phiprop.c: Likewise.
+ * tree-ssa-pre.c: Likewise.
+ * tree-ssa-propagate.c: Likewise.
+ * tree-ssa-reassoc.c: Likewise.
+ * tree-ssa-sccvn.c: Likewise.
+ * tree-ssa-strlen.c: Likewise.
+ * tree-ssa.c: Likewise.
+ * tree-switch-conversio: Likewise.n.c
+ * tree-tailcall.c: Likewise.
+ * tree-vect-data-refs.c: Likewise.
+ * tree-vect-generic.c: Likewise.
+ * tree-vect-loop-manip.c: Likewise.
+ * tree-vect-loop.c: Likewise.
+ * tree-vect-patterns.c: Likewise.
+ * tree-vect-stmts.c: Likewise.
+ * tsan.c: Likewise.
+ * value-prof.c: Likewise.
+ * config/aarch64/aarch64.c: Include gimplify.h instead of gimple.h.
+ * config/alpha/alpha.c: Likewise.
+ * config/darwin.c: Likewise.
+ * config/i386/i386.c: Likewise.
+ * config/ia64/ia64.c: Likewise.
+ * config/mep/mep.c: Likewise.
+ * config/mips/mips.c: Likewise.
+ * config/rs6000/rs6000.c: Likewise.
+ * config/s390/s390.c: Likewise.
+ * config/sh/sh.c: Likewise.
+ * config/sparc/sparc.c: Likewise.
+ * config/spu/spu.c: Likewise.
+ * config/stormy16/stormy16.c: Likewise.
+ * config/tilegx/tilegx.c: Likewise.
+ * config/tilepro/tilepro.c: Likewise.
+ * config/xtensa/xtensa.c: Likewise.
+
2013-11-12 Adam Butcher <adam@jessamine.co.uk>
* tree.c (grow_tree_vec_stat): New function ...
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 49285e5f732..031446be5ea 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -2255,7 +2255,7 @@ GTFILES = $(CPP_ID_DATA_H) $(srcdir)/input.h $(srcdir)/coretypes.h \
$(srcdir)/tree-ssanames.c $(srcdir)/tree-eh.c $(srcdir)/tree-ssa-address.c \
$(srcdir)/tree-cfg.c \
$(srcdir)/tree-dfa.c \
- $(srcdir)/tree-iterator.c $(srcdir)/gimplify.c \
+ $(srcdir)/tree-iterator.c $(srcdir)/gimple-expr.c \
$(srcdir)/tree-chrec.h \
$(srcdir)/tree-scalar-evolution.c \
$(srcdir)/tree-ssa-operands.h \
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index a5c9456e4c5..39b0f97c2a4 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,7 @@
+2013-11-12 Andrew MacLeod <amacleod@redhat.com>
+
+ * ada/gcc-interface/trans.c: Include gimplify.h.
+
2013-11-11 Tristan Gingold <gingold@adacore.com>
Eric Botcazou <ebotcazou@adacore.com>
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index 1d76e6aa468..9336a69abce 100644
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -33,7 +33,7 @@
#include "output.h"
#include "libfuncs.h" /* For set_stack_check_libfunc. */
#include "tree-iterator.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "bitmap.h"
#include "cgraph.h"
#include "diagnostic.h"
diff --git a/gcc/asan.c b/gcc/asan.c
index 950d332c0d5..59e26397cb1 100644
--- a/gcc/asan.c
+++ b/gcc/asan.c
@@ -23,7 +23,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tree.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "tree-iterator.h"
#include "cgraph.h"
#include "tree-ssanames.h"
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index 1a38bd4d301..57063bc5f76 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,11 @@
+2013-11-12 Andrew MacLeod <amacleod@redhat.com>
+
+ * c-family/c-common.c: Include gimplify.h.
+ * c-family/c-gimplify.c: Likewise.
+ * c-family/cilk.c: Likewise.
+ * c-family/c-omp.c: Include gimple-expr.h instead of gimple.h.
+ * c-family/c-ubsan.c: Don't include gimple.h.
+
2013-11-12 Joseph Myers <joseph@codesourcery.com>
* c-common.c (c_common_reswords): Add _Thread_local.
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index 1c317439b0b..835d22c6cf9 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -42,6 +42,7 @@ along with GCC; see the file COPYING3. If not see
#include "opts.h"
#include "cgraph.h"
#include "target-def.h"
+#include "gimplify.h"
cpp_reader *parse_in; /* Declared in c-pragma.h. */
diff --git a/gcc/c-family/c-gimplify.c b/gcc/c-family/c-gimplify.c
index 2a4f633ad4f..a7f29f8b4fc 100644
--- a/gcc/c-family/c-gimplify.c
+++ b/gcc/c-family/c-gimplify.c
@@ -29,7 +29,7 @@ along with GCC; see the file COPYING3. If not see
#include "tm.h"
#include "tree.h"
#include "c-common.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "tree-inline.h"
#include "diagnostic-core.h"
#include "langhooks.h"
diff --git a/gcc/c-family/c-omp.c b/gcc/c-family/c-omp.c
index f001a75cd22..b342bd216cb 100644
--- a/gcc/c-family/c-omp.c
+++ b/gcc/c-family/c-omp.c
@@ -27,7 +27,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "c-common.h"
#include "c-pragma.h"
-#include "gimple.h" /* For create_tmp_var_raw. */
+#include "gimple-expr.h"
#include "langhooks.h"
diff --git a/gcc/c-family/c-ubsan.c b/gcc/c-family/c-ubsan.c
index c9896381db2..dbac348bc0e 100644
--- a/gcc/c-family/c-ubsan.c
+++ b/gcc/c-family/c-ubsan.c
@@ -24,7 +24,6 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "alloc-pool.h"
#include "cgraph.h"
-#include "gimple.h"
#include "output.h"
#include "toplev.h"
#include "ubsan.h"
diff --git a/gcc/c-family/cilk.c b/gcc/c-family/cilk.c
index f719d551869..f6d7dce01ce 100644
--- a/gcc/c-family/cilk.c
+++ b/gcc/c-family/cilk.c
@@ -25,7 +25,7 @@ along with GCC; see the file COPYING3. If not see
#include "coretypes.h"
#include "tree.h"
#include "langhooks.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "tree-iterator.h"
#include "tree-inline.h"
#include "c-family/c-common.h"
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index 1cf5883c848..e95c54dd2be 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,7 @@
+2013-11-12 Andrew MacLeod <amacleod@redhat.com>
+
+ * c/c-typeck.c: Include gimplify.h.
+
2013-11-12 Joseph Myers <joseph@codesourcery.com>
* c-tree.h (struct c_declspecs): Add thread_gnu_p field.
diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c
index 5ef1f9303f1..1cf9b4563bc 100644
--- a/gcc/c/c-typeck.c
+++ b/gcc/c/c-typeck.c
@@ -36,7 +36,7 @@ along with GCC; see the file COPYING3. If not see
#include "target.h"
#include "tree-iterator.h"
#include "bitmap.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "tree-inline.h"
#include "omp-low.h"
#include "c-family/c-objc.h"
diff --git a/gcc/cfgloopmanip.c b/gcc/cfgloopmanip.c
index be876db354f..131c2a043dc 100644
--- a/gcc/cfgloopmanip.c
+++ b/gcc/cfgloopmanip.c
@@ -25,7 +25,7 @@ along with GCC; see the file COPYING3. If not see
#include "basic-block.h"
#include "cfgloop.h"
#include "tree.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "tree-ssa-loop-manip.h"
#include "dumpfile.h"
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index c3a8967e843..4765e6abb44 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -164,7 +164,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "output.h"
#include "rtl.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "tree-cfg.h"
#include "tree-into-ssa.h"
diff --git a/gcc/cilk-common.c b/gcc/cilk-common.c
index ca178c00cd3..216c7d43607 100644
--- a/gcc/cilk-common.c
+++ b/gcc/cilk-common.c
@@ -29,7 +29,7 @@ along with GCC; see the file COPYING3. If not see
#include "optabs.h"
#include "recog.h"
#include "tree-iterator.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "cilk.h"
/* This structure holds all the important fields of the internal structures,
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 8458cac34f2..a51bb210850 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -42,7 +42,7 @@
#include "recog.h"
#include "langhooks.h"
#include "diagnostic-core.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "optabs.h"
#include "dwarf2.h"
#include "cfgloop.h"
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index e39fc7731e6..9c8d907cd23 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -48,7 +48,7 @@ along with GCC; see the file COPYING3. If not see
#include "debug.h"
#include "langhooks.h"
#include "splay-tree.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "tree-ssanames.h"
#include "tree-stdarg.h"
diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c
index fc7a9a8f99e..009e851835c 100644
--- a/gcc/config/darwin.c
+++ b/gcc/config/darwin.c
@@ -45,7 +45,7 @@ along with GCC; see the file COPYING3. If not see
#include "df.h"
#include "debug.h"
#include "obstack.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "lto-streamer.h"
/* Darwin supports a feature called fix-and-continue, which is used
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 924cb669e46..5287b49bfc9 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -47,7 +47,7 @@ along with GCC; see the file COPYING3. If not see
#include "langhooks.h"
#include "reload.h"
#include "cgraph.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "dwarf2.h"
#include "df.h"
#include "tm-constrs.h"
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index 1bf3e2fe928..2b331873e24 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -49,7 +49,7 @@ along with GCC; see the file COPYING3. If not see
#include "tm_p.h"
#include "hash-table.h"
#include "langhooks.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "intl.h"
#include "df.h"
#include "debug.h"
diff --git a/gcc/config/mep/mep.c b/gcc/config/mep/mep.c
index e67540a5611..f67bf855121 100644
--- a/gcc/config/mep/mep.c
+++ b/gcc/config/mep/mep.c
@@ -47,7 +47,7 @@ along with GCC; see the file COPYING3. If not see
#include "target-def.h"
#include "langhooks.h"
#include "df.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "opts.h"
#include "dumpfile.h"
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index c1d8f3a0ade..ece4fec5413 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -50,7 +50,7 @@ along with GCC; see the file COPYING3. If not see
#include "common/common-target.h"
#include "langhooks.h"
#include "sched-int.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "bitmap.h"
#include "diagnostic.h"
#include "target-globals.h"
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 8c8ee9fae0e..33547c41dd6 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -51,7 +51,7 @@
#include "reload.h"
#include "cfgloop.h"
#include "sched-int.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "intl.h"
#include "params.h"
#include "tm-constrs.h"
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index f0d6a59e978..ca6503540b1 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -47,7 +47,7 @@ along with GCC; see the file COPYING3. If not see
#include "debug.h"
#include "langhooks.h"
#include "optabs.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "df.h"
#include "params.h"
#include "cfgloop.h"
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 167b615e37b..6afeca9d93b 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -48,7 +48,7 @@ along with GCC; see the file COPYING3. If not see
#include "sched-int.h"
#include "params.h"
#include "ggc.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "cfgloop.h"
#include "alloc-pool.h"
#include "tm-constrs.h"
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index 0eabd5b2b72..f2552bea63c 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -46,7 +46,7 @@ along with GCC; see the file COPYING3. If not see
#include "target.h"
#include "target-def.h"
#include "common/common-target.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "langhooks.h"
#include "reload.h"
#include "params.h"
diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c
index 38c441d9a03..7dedaed4e10 100644
--- a/gcc/config/spu/spu.c
+++ b/gcc/config/spu/spu.c
@@ -45,7 +45,7 @@
#include "sched-int.h"
#include "params.h"
#include "machmode.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "tm-constrs.h"
#include "ddg.h"
#include "sbitmap.h"
diff --git a/gcc/config/stormy16/stormy16.c b/gcc/config/stormy16/stormy16.c
index 30d6d781576..7704fff073a 100644
--- a/gcc/config/stormy16/stormy16.c
+++ b/gcc/config/stormy16/stormy16.c
@@ -43,7 +43,7 @@
#include "target-def.h"
#include "tm_p.h"
#include "langhooks.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "df.h"
#include "reload.h"
#include "ggc.h"
diff --git a/gcc/config/tilegx/tilegx.c b/gcc/config/tilegx/tilegx.c
index dafa44c0674..d20476f1610 100644
--- a/gcc/config/tilegx/tilegx.c
+++ b/gcc/config/tilegx/tilegx.c
@@ -40,7 +40,7 @@
#include "dwarf2.h"
#include "timevar.h"
#include "tree.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "cfgloop.h"
#include "tilegx-builtins.h"
#include "tilegx-multiply.h"
diff --git a/gcc/config/tilepro/tilepro.c b/gcc/config/tilepro/tilepro.c
index 5e3be831fb1..84b3ef53bb8 100644
--- a/gcc/config/tilepro/tilepro.c
+++ b/gcc/config/tilepro/tilepro.c
@@ -41,7 +41,7 @@
#include "dwarf2.h"
#include "timevar.h"
#include "tree.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "cfgloop.h"
#include "tilepro-builtins.h"
#include "tilepro-multiply.h"
diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
index 7faf7de9968..757314d58df 100644
--- a/gcc/config/xtensa/xtensa.c
+++ b/gcc/config/xtensa/xtensa.c
@@ -46,7 +46,7 @@ along with GCC; see the file COPYING3. If not see
#include "target.h"
#include "target-def.h"
#include "langhooks.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "df.h"
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index c85345eb270..7c6b2319e35 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,18 @@
+2013-11-12 Andrew MacLeod <amacleod@redhat.com>
+
+ * cp/class.c: Include gimplify.h.
+ * cp/cp-gimplify.c: Likewise.
+ * cp/error.c: Likewise.
+ * cp/init.c: Likewise.
+ * cp/optimize.c: Likewise.
+ * cp/pt.c: Likewise.
+ * cp/semantics.c: Likewise.
+ * cp/tree.c: Likewise.
+ * cp/vtable-class-hierarchy.c: Likewise.
+ * cp/decl2.c: Don't include gimple.h.
+ * cp/except.c: Likewise.
+ * cp/method.c: Include pointer-set.h instead of gimple.h.
+
2013-11-12 Adam Butcher <adam@jessamine.co.uk>
* pt.c (convert_generic_types_to_packs): New function to transform
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 64681ba44df..b4cab542e2e 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -36,6 +36,7 @@ along with GCC; see the file COPYING3. If not see
#include "splay-tree.h"
#include "pointer-set.h"
#include "hash-table.h"
+#include "gimplify.h"
/* The number of nested classes being processed. If we are not in the
scope of any class, this is zero. */
diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c
index 53b0ca8f928..e8ccf1aa561 100644
--- a/gcc/cp/cp-gimplify.c
+++ b/gcc/cp/cp-gimplify.c
@@ -27,7 +27,7 @@ along with GCC; see the file COPYING3. If not see
#include "cp-tree.h"
#include "c-family/c-common.h"
#include "tree-iterator.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "hashtab.h"
#include "pointer-set.h"
#include "flags.h"
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index a094ff3b546..18456848492 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -45,7 +45,6 @@ along with GCC; see the file COPYING3. If not see
#include "c-family/c-pragma.h"
#include "dumpfile.h"
#include "intl.h"
-#include "gimple.h"
#include "pointer-set.h"
#include "splay-tree.h"
#include "langhooks.h"
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 5f997c3ed29..3d72c1340dc 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -33,6 +33,7 @@ along with GCC; see the file COPYING3. If not see
#include "pointer-set.h"
#include "c-family/c-objc.h"
#include "ubsan.h"
+#include "gimplify.h"
#include <new> // For placement-new.
diff --git a/gcc/cp/except.c b/gcc/cp/except.c
index daac0fde7e6..ac2128d13b0 100644
--- a/gcc/cp/except.c
+++ b/gcc/cp/except.c
@@ -31,7 +31,6 @@ along with GCC; see the file COPYING3. If not see
#include "tree-inline.h"
#include "tree-iterator.h"
#include "target.h"
-#include "gimple.h"
static void push_eh_cleanup (tree);
static tree prepare_eh_type (tree);
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index a4d8280dfd8..1919603a705 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -28,6 +28,7 @@ along with GCC; see the file COPYING3. If not see
#include "cp-tree.h"
#include "flags.h"
#include "target.h"
+#include "gimplify.h"
static bool begin_init_stmts (tree *, tree *);
static tree finish_init_stmts (bool, tree, tree);
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index 353e99a6410..272ef42217f 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -34,7 +34,7 @@ along with GCC; see the file COPYING3. If not see
#include "common/common-target.h"
#include "diagnostic.h"
#include "cgraph.h"
-#include "gimple.h"
+#include "pointer-set.h"
/* Various flags to control the mangling process. */
diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c
index c4ee8484bb9..736dad9bec7 100644
--- a/gcc/cp/optimize.c
+++ b/gcc/cp/optimize.c
@@ -34,7 +34,7 @@ along with GCC; see the file COPYING3. If not see
#include "langhooks.h"
#include "diagnostic-core.h"
#include "dumpfile.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "tree-iterator.h"
#include "cgraph.h"
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 57a9769aecc..96a7db58e23 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -42,6 +42,7 @@ along with GCC; see the file COPYING3. If not see
#include "timevar.h"
#include "tree-iterator.h"
#include "type-utils.h"
+#include "gimplify.h"
/* The type of functions taking a tree, and some additional data, and
returning an int. */
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 366756fd437..202f1cf6854 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -41,7 +41,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-iterator.h"
#include "vec.h"
#include "target.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "bitmap.h"
#include "hash-table.h"
#include "omp-low.h"
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 3ac03480620..eb7bd876817 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -30,7 +30,7 @@ along with GCC; see the file COPYING3. If not see
#include "convert.h"
#include "cgraph.h"
#include "splay-tree.h"
-#include "gimple.h" /* gimple_has_body_p */
+#include "gimplify.h"
#include "hash-table.h"
static tree bot_manip (tree *, int *, void *);
diff --git a/gcc/cp/vtable-class-hierarchy.c b/gcc/cp/vtable-class-hierarchy.c
index 78611a83264..39c75ce5c33 100644
--- a/gcc/cp/vtable-class-hierarchy.c
+++ b/gcc/cp/vtable-class-hierarchy.c
@@ -118,7 +118,7 @@ along with GCC; see the file COPYING3. If not see
#include "cgraph.h"
#include "tree-iterator.h"
#include "vtable-verify.h"
-#include "gimple.h"
+#include "gimplify.h"
static int num_calls_to_regset = 0;
static int num_calls_to_regpair = 0;
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 5ef7bd2034d..d661bd7076c 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -87,7 +87,6 @@ along with GCC; see the file COPYING3. If not see
#include "hash-table.h"
#include "cgraph.h"
#include "input.h"
-#include "gimple.h"
#include "ira.h"
#include "lra.h"
#include "dumpfile.h"
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 3e6f15887db..77f9fb8e581 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -57,7 +57,7 @@ along with GCC; see the file COPYING3. If not see
#include "hash-table.h"
#include "langhooks.h"
#include "md5.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "tree-dfa.h"
/* Nonzero if we are folding constants inside an initializer; zero
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 8e2e10c8539..4f75b03bfb0 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,12 @@
+2013-11-12 Andrew MacLeod <amacleod@redhat.com>
+
+ * fortran/f95-lang.c: Don't include gimple.h.
+ * fortran/trans-array.c: Include gimple-expr.h instead of gimple.h.
+ * fortran/trans.c: Likewise.
+ * fortran/trans-decl.c: Likewise.
+ * fortran/trans-expr.c: Include gimplify.h.
+ * fortran/trans-openmp.c: Likewise.
+
2013-11-07 Janus Weil <janus@gcc.gnu.org>
PR fortran/58471
diff --git a/gcc/fortran/f95-lang.c b/gcc/fortran/f95-lang.c
index a70d60d6882..4da5e6913d2 100644
--- a/gcc/fortran/f95-lang.c
+++ b/gcc/fortran/f95-lang.c
@@ -28,7 +28,6 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tree.h"
-#include "gimple.h"
#include "flags.h"
#include "langhooks.h"
#include "langhooks-def.h"
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index 5a3cf80f9f6..c2bbd0e216d 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -79,7 +79,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tree.h"
-#include "gimple.h" /* For create_tmp_var_name. */
+#include "gimple-expr.h"
#include "diagnostic-core.h" /* For internal_error/fatal_error. */
#include "flags.h"
#include "gfortran.h"
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index c2c736e1c66..1df3bb44e7a 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -26,7 +26,7 @@ along with GCC; see the file COPYING3. If not see
#include "tm.h"
#include "tree.h"
#include "tree-dump.h"
-#include "gimple.h" /* For create_tmp_var_raw. */
+#include "gimple-expr.h" /* For create_tmp_var_raw. */
#include "ggc.h"
#include "diagnostic-core.h" /* For internal_error. */
#include "toplev.h" /* For announce_function. */
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 9586ca388e2..8adada6bead 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -38,6 +38,7 @@ along with GCC; see the file COPYING3. If not see
/* Only for gfc_trans_assign and gfc_trans_pointer_assign. */
#include "trans-stmt.h"
#include "dependency.h"
+#include "gimplify.h"
/* Convert a scalar to an array descriptor. To be used for assumed-rank
diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c
index bf282498eab..9d6d4d4df45 100644
--- a/gcc/fortran/trans-openmp.c
+++ b/gcc/fortran/trans-openmp.c
@@ -23,7 +23,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tree.h"
-#include "gimple.h" /* For create_tmp_var_raw. */
+#include "gimplify.h" /* For create_tmp_var_raw. */
#include "diagnostic-core.h" /* For internal_error. */
#include "gfortran.h"
#include "trans.h"
diff --git a/gcc/fortran/trans.c b/gcc/fortran/trans.c
index b7863b2d511..ef20a20f018 100644
--- a/gcc/fortran/trans.c
+++ b/gcc/fortran/trans.c
@@ -22,7 +22,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tree.h"
-#include "gimple.h" /* For create_tmp_var_raw. */
+#include "gimple-expr.h" /* For create_tmp_var_raw. */
#include "tree-iterator.h"
#include "diagnostic-core.h" /* For internal_error. */
#include "flags.h"
diff --git a/gcc/function.c b/gcc/function.c
index a36f152b79a..620554d55f3 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -55,7 +55,7 @@ along with GCC; see the file COPYING3. If not see
#include "langhooks.h"
#include "target.h"
#include "common/common-target.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "tree-pass.h"
#include "predict.h"
#include "df.h"
diff --git a/gcc/gimple-expr.c b/gcc/gimple-expr.c
index c74d9295d1d..c82abb7adab 100644
--- a/gcc/gimple-expr.c
+++ b/gcc/gimple-expr.c
@@ -24,8 +24,9 @@ along with GCC; see the file COPYING3. If not see
#include "coretypes.h"
#include "tm.h"
#include "tree.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "demangle.h"
+#include "gimple-ssa.h"
/* ----- Type related ----- */
@@ -406,6 +407,116 @@ gimple_can_coalesce_p (tree name1, tree name2)
return false;
}
+/* Strip off a legitimate source ending from the input string NAME of
+ length LEN. Rather than having to know the names used by all of
+ our front ends, we strip off an ending of a period followed by
+ up to five characters. (Java uses ".class".) */
+
+static inline void
+remove_suffix (char *name, int len)
+{
+ int i;
+
+ for (i = 2; i < 8 && len > i; i++)
+ {
+ if (name[len - i] == '.')
+ {
+ name[len - i] = '\0';
+ break;
+ }
+ }
+}
+
+/* Create a new temporary name with PREFIX. Return an identifier. */
+
+static GTY(()) unsigned int tmp_var_id_num;
+
+tree
+create_tmp_var_name (const char *prefix)
+{
+ char *tmp_name;
+
+ if (prefix)
+ {
+ char *preftmp = ASTRDUP (prefix);
+
+ remove_suffix (preftmp, strlen (preftmp));
+ clean_symbol_name (preftmp);
+
+ prefix = preftmp;
+ }
+
+ ASM_FORMAT_PRIVATE_NAME (tmp_name, prefix ? prefix : "T", tmp_var_id_num++);
+ return get_identifier (tmp_name);
+}
+
+/* Create a new temporary variable declaration of type TYPE.
+ Do NOT push it into the current binding. */
+
+tree
+create_tmp_var_raw (tree type, const char *prefix)
+{
+ tree tmp_var;
+
+ tmp_var = build_decl (input_location,
+ VAR_DECL, prefix ? create_tmp_var_name (prefix) : NULL,
+ type);
+
+ /* The variable was declared by the compiler. */
+ DECL_ARTIFICIAL (tmp_var) = 1;
+ /* And we don't want debug info for it. */
+ DECL_IGNORED_P (tmp_var) = 1;
+
+ /* Make the variable writable. */
+ TREE_READONLY (tmp_var) = 0;
+
+ DECL_EXTERNAL (tmp_var) = 0;
+ TREE_STATIC (tmp_var) = 0;
+ TREE_USED (tmp_var) = 1;
+
+ return tmp_var;
+}
+
+/* Create a new temporary variable declaration of type TYPE. DO push the
+ variable into the current binding. Further, assume that this is called
+ only from gimplification or optimization, at which point the creation of
+ certain types are bugs. */
+
+tree
+create_tmp_var (tree type, const char *prefix)
+{
+ tree tmp_var;
+
+ /* We don't allow types that are addressable (meaning we can't make copies),
+ or incomplete. We also used to reject every variable size objects here,
+ but now support those for which a constant upper bound can be obtained.
+ The processing for variable sizes is performed in gimple_add_tmp_var,
+ point at which it really matters and possibly reached via paths not going
+ through this function, e.g. after direct calls to create_tmp_var_raw. */
+ gcc_assert (!TREE_ADDRESSABLE (type) && COMPLETE_TYPE_P (type));
+
+ tmp_var = create_tmp_var_raw (type, prefix);
+ gimple_add_tmp_var (tmp_var);
+ return tmp_var;
+}
+
+/* Create a new temporary variable declaration of type TYPE by calling
+ create_tmp_var and if TYPE is a vector or a complex number, mark the new
+ temporary as gimple register. */
+
+tree
+create_tmp_reg (tree type, const char *prefix)
+{
+ tree tmp;
+
+ tmp = create_tmp_var (type, prefix);
+ if (TREE_CODE (type) == COMPLEX_TYPE
+ || TREE_CODE (type) == VECTOR_TYPE)
+ DECL_GIMPLE_REG_P (tmp) = 1;
+
+ return tmp;
+}
+
/* ----- Expression related ----- */
@@ -719,3 +830,45 @@ is_gimple_mem_ref_addr (tree t)
&& (CONSTANT_CLASS_P (TREE_OPERAND (t, 0))
|| decl_address_invariant_p (TREE_OPERAND (t, 0)))));
}
+
+/* Mark X addressable. Unlike the langhook we expect X to be in gimple
+ form and we don't do any syntax checking. */
+
+void
+mark_addressable (tree x)
+{
+ while (handled_component_p (x))
+ x = TREE_OPERAND (x, 0);
+ if (TREE_CODE (x) == MEM_REF
+ && TREE_CODE (TREE_OPERAND (x, 0)) == ADDR_EXPR)
+ x = TREE_OPERAND (TREE_OPERAND (x, 0), 0);
+ if (TREE_CODE (x) != VAR_DECL
+ && TREE_CODE (x) != PARM_DECL
+ && TREE_CODE (x) != RESULT_DECL)
+ return;
+ TREE_ADDRESSABLE (x) = 1;
+
+ /* Also mark the artificial SSA_NAME that points to the partition of X. */
+ if (TREE_CODE (x) == VAR_DECL
+ && !DECL_EXTERNAL (x)
+ && !TREE_STATIC (x)
+ && cfun->gimple_df != NULL
+ && cfun->gimple_df->decls_to_pointers != NULL)
+ {
+ void *namep
+ = pointer_map_contains (cfun->gimple_df->decls_to_pointers, x);
+ if (namep)
+ TREE_ADDRESSABLE (*(tree *)namep) = 1;
+ }
+}
+
+/* Returns true iff T is a valid RHS for an assignment to a renamed
+ user -- or front-end generated artificial -- variable. */
+
+bool
+is_gimple_reg_rhs (tree t)
+{
+ return get_gimple_rhs_class (TREE_CODE (t)) != GIMPLE_INVALID_RHS;
+}
+
+#include "gt-gimple-expr.h"
diff --git a/gcc/gimple-expr.h b/gcc/gimple-expr.h
index aad558cebb7..e74be2249df 100644
--- a/gcc/gimple-expr.h
+++ b/gcc/gimple-expr.h
@@ -22,12 +22,18 @@ along with GCC; see the file COPYING3. If not see
extern bool useless_type_conversion_p (tree, tree);
+
extern void gimple_set_body (tree, gimple_seq);
extern gimple_seq gimple_body (tree);
extern bool gimple_has_body_p (tree);
extern const char *gimple_decl_printable_name (tree, int);
extern tree copy_var_decl (tree, tree, tree);
extern bool gimple_can_coalesce_p (tree, tree);
+extern tree create_tmp_var_name (const char *);
+extern tree create_tmp_var_raw (tree, const char *);
+extern tree create_tmp_var (tree, const char *);
+extern tree create_tmp_reg (tree, const char *);
+
extern void extract_ops_from_tree_1 (tree, enum tree_code *, tree *, tree *,
tree *);
@@ -46,6 +52,8 @@ extern bool is_gimple_asm_val (tree);
extern bool is_gimple_min_lval (tree);
extern bool is_gimple_call_addr (tree);
extern bool is_gimple_mem_ref_addr (tree);
+extern void mark_addressable (tree);
+extern bool is_gimple_reg_rhs (tree);
/* Return true if a conversion from either type of TYPE1 and TYPE2
to the other is not required. Otherwise return false. */
diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c
index 89d1ac993f6..122d1932b94 100644
--- a/gcc/gimple-fold.c
+++ b/gcc/gimple-fold.c
@@ -27,7 +27,7 @@ along with GCC; see the file COPYING3. If not see
#include "function.h"
#include "dumpfile.h"
#include "bitmap.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "tree-ssanames.h"
#include "tree-into-ssa.h"
diff --git a/gcc/gimple-ssa-strength-reduction.c b/gcc/gimple-ssa-strength-reduction.c
index 88afc91200f..41f24cc03e5 100644
--- a/gcc/gimple-ssa-strength-reduction.c
+++ b/gcc/gimple-ssa-strength-reduction.c
@@ -37,7 +37,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tree.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "basic-block.h"
#include "tree-pass.h"
#include "cfgloop.h"
diff --git a/gcc/gimple.c b/gcc/gimple.c
index 55dd09106bb..cba3bcedf54 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -29,6 +29,7 @@ along with GCC; see the file COPYING3. If not see
#include "hard-reg-set.h"
#include "basic-block.h"
#include "gimple.h"
+#include "gimplify.h"
#include "diagnostic.h"
#include "value-prof.h"
#include "flags.h"
@@ -446,24 +447,6 @@ gimple_build_assign_with_ops (enum tree_code subcode, tree lhs, tree op1,
}
-/* Build a new GIMPLE_ASSIGN tuple and append it to the end of *SEQ_P.
-
- DST/SRC are the destination and source respectively. You can pass
- ungimplified trees in DST or SRC, in which case they will be
- converted to a gimple operand if necessary.
-
- This function returns the newly created GIMPLE_ASSIGN tuple. */
-
-gimple
-gimplify_assign (tree dst, tree src, gimple_seq *seq_p)
-{
- tree t = build2 (MODIFY_EXPR, TREE_TYPE (dst), dst, src);
- gimplify_and_add (t, seq_p);
- ggc_free (t);
- return gimple_seq_last_stmt (*seq_p);
-}
-
-
/* Build a GIMPLE_COND statement.
PRED is the condition used to compare LHS and the RHS.
@@ -1172,6 +1155,23 @@ gimple_seq_add_stmt (gimple_seq *seq_p, gimple gs)
gsi_insert_after (&si, gs, GSI_NEW_STMT);
}
+/* Link gimple statement GS to the end of the sequence *SEQ_P. If
+ *SEQ_P is NULL, a new sequence is allocated. This function is
+ similar to gimple_seq_add_stmt, but does not scan the operands.
+ During gimplification, we need to manipulate statement sequences
+ before the def/use vectors have been constructed. */
+
+void
+gimple_seq_add_stmt_without_update (gimple_seq *seq_p, gimple gs)
+{
+ gimple_stmt_iterator si;
+
+ if (gs == NULL)
+ return;
+
+ si = gsi_last (*seq_p);
+ gsi_insert_after_without_update (&si, gs, GSI_NEW_STMT);
+}
/* Append sequence SRC to the end of sequence *DST_P. If *DST_P is
NULL, a new sequence is allocated. */
@@ -1187,6 +1187,64 @@ gimple_seq_add_seq (gimple_seq *dst_p, gimple_seq src)
gsi_insert_seq_after (&si, src, GSI_NEW_STMT);
}
+/* Determine whether to assign a location to the statement GS. */
+
+static bool
+should_carry_location_p (gimple gs)
+{
+ /* Don't emit a line note for a label. We particularly don't want to
+ emit one for the break label, since it doesn't actually correspond
+ to the beginning of the loop/switch. */
+ if (gimple_code (gs) == GIMPLE_LABEL)
+ return false;
+
+ return true;
+}
+
+/* Set the location for gimple statement GS to LOCATION. */
+
+static void
+annotate_one_with_location (gimple gs, location_t location)
+{
+ if (!gimple_has_location (gs)
+ && !gimple_do_not_emit_location_p (gs)
+ && should_carry_location_p (gs))
+ gimple_set_location (gs, location);
+}
+
+/* Set LOCATION for all the statements after iterator GSI in sequence
+ SEQ. If GSI is pointing to the end of the sequence, start with the
+ first statement in SEQ. */
+
+void
+annotate_all_with_location_after (gimple_seq seq, gimple_stmt_iterator gsi,
+ location_t location)
+{
+ if (gsi_end_p (gsi))
+ gsi = gsi_start (seq);
+ else
+ gsi_next (&gsi);
+
+ for (; !gsi_end_p (gsi); gsi_next (&gsi))
+ annotate_one_with_location (gsi_stmt (gsi), location);
+}
+
+/* Set the location for all the statements in a sequence STMT_P to LOCATION. */
+
+void
+annotate_all_with_location (gimple_seq stmt_p, location_t location)
+{
+ gimple_stmt_iterator i;
+
+ if (gimple_seq_empty_p (stmt_p))
+ return;
+
+ for (i = gsi_start (stmt_p); !gsi_end_p (i); gsi_next (&i))
+ {
+ gimple gs = gsi_stmt (i);
+ annotate_one_with_location (gs, location);
+ }
+}
/* Helper function of empty_body_p. Return true if STMT is an empty
statement. */
@@ -3428,3 +3486,205 @@ infer_nonnull_range (gimple stmt, tree op)
return false;
}
+
+/* Compare two case labels. Because the front end should already have
+ made sure that case ranges do not overlap, it is enough to only compare
+ the CASE_LOW values of each case label. */
+
+static int
+compare_case_labels (const void *p1, const void *p2)
+{
+ const_tree const case1 = *(const_tree const*)p1;
+ const_tree const case2 = *(const_tree const*)p2;
+
+ /* The 'default' case label always goes first. */
+ if (!CASE_LOW (case1))
+ return -1;
+ else if (!CASE_LOW (case2))
+ return 1;
+ else
+ return tree_int_cst_compare (CASE_LOW (case1), CASE_LOW (case2));
+}
+
+/* Sort the case labels in LABEL_VEC in place in ascending order. */
+
+void
+sort_case_labels (vec<tree> label_vec)
+{
+ label_vec.qsort (compare_case_labels);
+}
+
+/* Prepare a vector of case labels to be used in a GIMPLE_SWITCH statement.
+
+ LABELS is a vector that contains all case labels to look at.
+
+ INDEX_TYPE is the type of the switch index expression. Case labels
+ in LABELS are discarded if their values are not in the value range
+ covered by INDEX_TYPE. The remaining case label values are folded
+ to INDEX_TYPE.
+
+ If a default case exists in LABELS, it is removed from LABELS and
+ returned in DEFAULT_CASEP. If no default case exists, but the
+ case labels already cover the whole range of INDEX_TYPE, a default
+ case is returned pointing to one of the existing case labels.
+ Otherwise DEFAULT_CASEP is set to NULL_TREE.
+
+ DEFAULT_CASEP may be NULL, in which case the above comment doesn't
+ apply and no action is taken regardless of whether a default case is
+ found or not. */
+
+void
+preprocess_case_label_vec_for_gimple (vec<tree> labels,
+ tree index_type,
+ tree *default_casep)
+{
+ tree min_value, max_value;
+ tree default_case = NULL_TREE;
+ size_t i, len;
+
+ i = 0;
+ min_value = TYPE_MIN_VALUE (index_type);
+ max_value = TYPE_MAX_VALUE (index_type);
+ while (i < labels.length ())
+ {
+ tree elt = labels[i];
+ tree low = CASE_LOW (elt);
+ tree high = CASE_HIGH (elt);
+ bool remove_element = FALSE;
+
+ if (low)
+ {
+ gcc_checking_assert (TREE_CODE (low) == INTEGER_CST);
+ gcc_checking_assert (!high || TREE_CODE (high) == INTEGER_CST);
+
+ /* This is a non-default case label, i.e. it has a value.
+
+ See if the case label is reachable within the range of
+ the index type. Remove out-of-range case values. Turn
+ case ranges into a canonical form (high > low strictly)
+ and convert the case label values to the index type.
+
+ NB: The type of gimple_switch_index() may be the promoted
+ type, but the case labels retain the original type. */
+
+ if (high)
+ {
+ /* This is a case range. Discard empty ranges.
+ If the bounds or the range are equal, turn this
+ into a simple (one-value) case. */
+ int cmp = tree_int_cst_compare (high, low);
+ if (cmp < 0)
+ remove_element = TRUE;
+ else if (cmp == 0)
+ high = NULL_TREE;
+ }
+
+ if (! high)
+ {
+ /* If the simple case value is unreachable, ignore it. */
+ if ((TREE_CODE (min_value) == INTEGER_CST
+ && tree_int_cst_compare (low, min_value) < 0)
+ || (TREE_CODE (max_value) == INTEGER_CST
+ && tree_int_cst_compare (low, max_value) > 0))
+ remove_element = TRUE;
+ else
+ low = fold_convert (index_type, low);
+ }
+ else
+ {
+ /* If the entire case range is unreachable, ignore it. */
+ if ((TREE_CODE (min_value) == INTEGER_CST
+ && tree_int_cst_compare (high, min_value) < 0)
+ || (TREE_CODE (max_value) == INTEGER_CST
+ && tree_int_cst_compare (low, max_value) > 0))
+ remove_element = TRUE;
+ else
+ {
+ /* If the lower bound is less than the index type's
+ minimum value, truncate the range bounds. */
+ if (TREE_CODE (min_value) == INTEGER_CST
+ && tree_int_cst_compare (low, min_value) < 0)
+ low = min_value;
+ low = fold_convert (index_type, low);
+
+ /* If the upper bound is greater than the index type's
+ maximum value, truncate the range bounds. */
+ if (TREE_CODE (max_value) == INTEGER_CST
+ && tree_int_cst_compare (high, max_value) > 0)
+ high = max_value;
+ high = fold_convert (index_type, high);
+
+ /* We may have folded a case range to a one-value case. */
+ if (tree_int_cst_equal (low, high))
+ high = NULL_TREE;
+ }
+ }
+
+ CASE_LOW (elt) = low;
+ CASE_HIGH (elt) = high;
+ }
+ else
+ {
+ gcc_assert (!default_case);
+ default_case = elt;
+ /* The default case must be passed separately to the
+ gimple_build_switch routine. But if DEFAULT_CASEP
+ is NULL, we do not remove the default case (it would
+ be completely lost). */
+ if (default_casep)
+ remove_element = TRUE;
+ }
+
+ if (remove_element)
+ labels.ordered_remove (i);
+ else
+ i++;
+ }
+ len = i;
+
+ if (!labels.is_empty ())
+ sort_case_labels (labels);
+
+ if (default_casep && !default_case)
+ {
+ /* If the switch has no default label, add one, so that we jump
+ around the switch body. If the labels already cover the whole
+ range of the switch index_type, add the default label pointing
+ to one of the existing labels. */
+ if (len
+ && TYPE_MIN_VALUE (index_type)
+ && TYPE_MAX_VALUE (index_type)
+ && tree_int_cst_equal (CASE_LOW (labels[0]),
+ TYPE_MIN_VALUE (index_type)))
+ {
+ tree low, high = CASE_HIGH (labels[len - 1]);
+ if (!high)
+ high = CASE_LOW (labels[len - 1]);
+ if (tree_int_cst_equal (high, TYPE_MAX_VALUE (index_type)))
+ {
+ for (i = 1; i < len; i++)
+ {
+ high = CASE_LOW (labels[i]);
+ low = CASE_HIGH (labels[i - 1]);
+ if (!low)
+ low = CASE_LOW (labels[i - 1]);
+ if ((TREE_INT_CST_LOW (low) + 1
+ != TREE_INT_CST_LOW (high))
+ || (TREE_INT_CST_HIGH (low)
+ + (TREE_INT_CST_LOW (high) == 0)
+ != TREE_INT_CST_HIGH (high)))
+ break;
+ }
+ if (i == len)
+ {
+ tree label = CASE_LABEL (labels[0]);
+ default_case = build_case_label (NULL_TREE, NULL_TREE,
+ label);
+ }
+ }
+ }
+ }
+
+ if (default_casep)
+ *default_casep = default_case;
+}
diff --git a/gcc/gimple.h b/gcc/gimple.h
index 33e790c18da..4f34a9eea92 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -766,7 +766,6 @@ 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);
-gimple gimplify_assign (tree, tree, gimple_seq *);
gimple gimple_build_cond (enum tree_code, tree, tree, tree, tree);
gimple gimple_build_label (tree label);
gimple gimple_build_goto (tree dest);
@@ -806,8 +805,6 @@ 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);
-void sort_case_labels (vec<tree> );
-void preprocess_case_label_vec_for_gimple (vec<tree> , tree, tree *);
gimple_seq gimple_seq_alloc (void);
void gimple_seq_free (gimple_seq);
void gimple_seq_add_seq (gimple_seq *, gimple_seq);
@@ -834,8 +831,10 @@ bool gimple_has_side_effects (const_gimple);
bool gimple_could_trap_p (gimple);
bool gimple_could_trap_p_1 (gimple, bool, bool);
bool gimple_assign_rhs_could_trap_p (gimple);
-void gimple_regimplify_operands (gimple, gimple_stmt_iterator *);
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);
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);
@@ -859,48 +858,8 @@ extern bool gimple_ior_addresses_taken (bitmap, gimple);
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);
-
-/* In gimplify.c */
-extern tree create_tmp_var_raw (tree, const char *);
-extern tree create_tmp_var_name (const char *);
-extern tree create_tmp_var (tree, const char *);
-extern tree create_tmp_reg (tree, const char *);
-extern tree get_initialized_tmp_var (tree, gimple_seq *, gimple_seq *);
-extern tree get_formal_tmp_var (tree, gimple_seq *);
-extern void declare_vars (tree, gimple, bool);
-extern void annotate_all_with_location (gimple_seq, location_t);
extern unsigned gimple_call_get_nobnd_arg_index (const_gimple, unsigned);
-/* Validation of GIMPLE expressions. Note that these predicates only check
- the basic form of the expression, they don't recurse to make sure that
- underlying nodes are also of the right form. */
-typedef bool (*gimple_predicate)(tree);
-
-
-/* FIXME we should deduce this from the predicate. */
-enum fallback {
- fb_none = 0, /* Do not generate a temporary. */
-
- fb_rvalue = 1, /* Generate an rvalue to hold the result of a
- gimplified expression. */
-
- fb_lvalue = 2, /* Generate an lvalue to hold the result of a
- gimplified expression. */
-
- fb_mayfail = 4, /* Gimplification may fail. Error issued
- afterwards. */
- fb_either= fb_rvalue | fb_lvalue
-};
-
-typedef int fallback_t;
-
-enum gimplify_status {
- GS_ERROR = -2, /* Something Bad Seen. */
- GS_UNHANDLED = -1, /* A langhook result for "I dunno". */
- GS_OK = 0, /* We did something, maybe more to do. */
- GS_ALL_DONE = 1 /* The expression is fully gimplified. */
-};
-
/* Formal (expression) temporary table handling: multiple occurrences of
the same scalar expression are evaluated into the same temporary. */
@@ -1010,31 +969,8 @@ inc_gimple_stmt_max_uid (struct function *fn)
return fn->last_stmt_uid++;
}
-extern enum gimplify_status gimplify_expr (tree *, gimple_seq *, gimple_seq *,
- bool (*) (tree), fallback_t);
-extern void gimplify_type_sizes (tree, gimple_seq *);
-extern void gimplify_one_sizepos (tree *, gimple_seq *);
-enum gimplify_status gimplify_self_mod_expr (tree *, gimple_seq *, gimple_seq *,
- bool, tree);
-extern bool gimplify_stmt (tree *, gimple_seq *);
-extern gimple gimplify_body (tree, bool);
-extern void push_gimplify_context (struct gimplify_ctx *);
-extern void pop_gimplify_context (gimple);
-extern void gimplify_and_add (tree, gimple_seq *);
-
/* Miscellaneous helpers. */
-extern void gimple_add_tmp_var (tree);
-extern gimple gimple_current_bind_expr (void);
-extern vec<gimple> gimple_bind_expr_stack (void);
-extern tree voidify_wrapper_expr (tree, tree);
-extern tree build_and_jump (tree *);
-extern tree force_labels_r (tree *, int *, void *);
-extern enum gimplify_status gimplify_va_arg_expr (tree *, gimple_seq *,
- gimple_seq *);
struct gimplify_omp_ctx;
-extern void omp_firstprivatize_variable (struct gimplify_omp_ctx *, tree);
-extern tree gimple_boolify (tree);
-extern gimple_predicate rhs_predicate_for (tree);
extern tree canonicalize_cond_expr_cond (tree);
extern void dump_decl_set (FILE *, bitmap);
extern bool nonfreeing_call_p (gimple);
@@ -1048,9 +984,6 @@ extern void compute_transaction_bits (void);
extern void lower_nested_functions (tree);
extern void insert_field_into_struct (tree, tree);
-/* In gimplify.c. */
-extern void gimplify_function_tree (tree);
-
/* In cfgexpand.c. */
extern tree gimple_assign_rhs_to_tree (gimple);
@@ -1121,14 +1054,8 @@ gimple_seq_empty_p (gimple_seq s)
return s == NULL;
}
-void gimple_seq_add_stmt (gimple_seq *, gimple);
-
-/* Link gimple statement GS to the end of the sequence *SEQ_P. If
- *SEQ_P is NULL, a new sequence is allocated. This function is
- similar to gimple_seq_add_stmt, but does not scan the operands.
- During gimplification, we need to manipulate statement sequences
- before the def/use vectors have been constructed. */
-void gimple_seq_add_stmt_without_update (gimple_seq *, gimple);
+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. */
@@ -5563,15 +5490,6 @@ void gsi_commit_one_edge_insert (edge, basic_block *);
void gsi_commit_edge_inserts (void);
gimple gimple_call_copy_skip_args (gimple, bitmap);
-/* In gimplify.c. */
-tree force_gimple_operand_1 (tree, gimple_seq *, gimple_predicate, tree);
-tree force_gimple_operand (tree, gimple_seq *, bool, tree);
-tree force_gimple_operand_gsi_1 (gimple_stmt_iterator *, tree,
- gimple_predicate, tree,
- bool, enum gsi_iterator_update);
-tree force_gimple_operand_gsi (gimple_stmt_iterator *, tree, bool, tree,
- bool, enum gsi_iterator_update);
-
/* Convenience routines to walk all statements of a gimple function.
Note that this is useful exclusively before the code is converted
into SSA form. Once the program is in SSA form, the standard
@@ -5684,6 +5602,27 @@ gimple_seq_set_location (gimple_seq seq, location_t loc)
gimple_set_location (gsi_stmt (i), loc);
}
+/* Return true if a location should not be emitted for this statement
+ by annotate_all_with_location. */
+
+static inline bool
+gimple_do_not_emit_location_p (gimple g)
+{
+ return gimple_plf (g, GF_PLF_1);
+}
+
+/* Mark statement G so a location will not be emitted by
+ annotate_one_with_location. */
+
+static inline void
+gimple_set_do_not_emit_location (gimple g)
+{
+ /* The PLF flags are initialized to 0 when a new tuple is created,
+ so no need to initialize it anywhere. */
+ gimple_set_plf (g, GF_PLF_1, true);
+}
+
+
/* Macros for showing usage statistics. */
#define SCALE(x) ((unsigned long) ((x) < 1024*10 \
? (x) \
@@ -5695,4 +5634,7 @@ gimple_seq_set_location (gimple_seq seq, location_t loc)
#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 *);
+
#endif /* GCC_GIMPLE_H */
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 914766ad3b0..356fc2b91a8 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -25,7 +25,7 @@ along with GCC; see the file COPYING3. If not see
#include "coretypes.h"
#include "tm.h"
#include "tree.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "tree-iterator.h"
#include "tree-inline.h"
#include "tree-pretty-print.h"
@@ -108,55 +108,6 @@ static struct gimplify_omp_ctx *gimplify_omp_ctxp;
/* Forward declaration. */
static enum gimplify_status gimplify_compound_expr (tree *, gimple_seq *, bool);
-/* Mark X addressable. Unlike the langhook we expect X to be in gimple
- form and we don't do any syntax checking. */
-
-void
-mark_addressable (tree x)
-{
- while (handled_component_p (x))
- x = TREE_OPERAND (x, 0);
- if (TREE_CODE (x) == MEM_REF
- && TREE_CODE (TREE_OPERAND (x, 0)) == ADDR_EXPR)
- x = TREE_OPERAND (TREE_OPERAND (x, 0), 0);
- if (TREE_CODE (x) != VAR_DECL
- && TREE_CODE (x) != PARM_DECL
- && TREE_CODE (x) != RESULT_DECL)
- return;
- TREE_ADDRESSABLE (x) = 1;
-
- /* Also mark the artificial SSA_NAME that points to the partition of X. */
- if (TREE_CODE (x) == VAR_DECL
- && !DECL_EXTERNAL (x)
- && !TREE_STATIC (x)
- && cfun->gimple_df != NULL
- && cfun->gimple_df->decls_to_pointers != NULL)
- {
- void *namep
- = pointer_map_contains (cfun->gimple_df->decls_to_pointers, x);
- if (namep)
- TREE_ADDRESSABLE (*(tree *)namep) = 1;
- }
-}
-
-/* Link gimple statement GS to the end of the sequence *SEQ_P. If
- *SEQ_P is NULL, a new sequence is allocated. This function is
- similar to gimple_seq_add_stmt, but does not scan the operands.
- During gimplification, we need to manipulate statement sequences
- before the def/use vectors have been constructed. */
-
-void
-gimple_seq_add_stmt_without_update (gimple_seq *seq_p, gimple gs)
-{
- gimple_stmt_iterator si;
-
- if (gs == NULL)
- return;
-
- si = gsi_last (*seq_p);
- gsi_insert_after_without_update (&si, gs, GSI_NEW_STMT);
-}
-
/* Shorter alias name for the above function for use in gimplify.c
only. */
@@ -365,125 +316,6 @@ gimplify_and_return_first (tree t, gimple_seq *seq_p)
return gimple_seq_first_stmt (*seq_p);
}
-/* Strip off a legitimate source ending from the input string NAME of
- length LEN. Rather than having to know the names used by all of
- our front ends, we strip off an ending of a period followed by
- up to five characters. (Java uses ".class".) */
-
-static inline void
-remove_suffix (char *name, int len)
-{
- int i;
-
- for (i = 2; i < 8 && len > i; i++)
- {
- if (name[len - i] == '.')
- {
- name[len - i] = '\0';
- break;
- }
- }
-}
-
-/* Create a new temporary name with PREFIX. Return an identifier. */
-
-static GTY(()) unsigned int tmp_var_id_num;
-
-tree
-create_tmp_var_name (const char *prefix)
-{
- char *tmp_name;
-
- if (prefix)
- {
- char *preftmp = ASTRDUP (prefix);
-
- remove_suffix (preftmp, strlen (preftmp));
- clean_symbol_name (preftmp);
-
- prefix = preftmp;
- }
-
- ASM_FORMAT_PRIVATE_NAME (tmp_name, prefix ? prefix : "T", tmp_var_id_num++);
- return get_identifier (tmp_name);
-}
-
-/* Create a new temporary variable declaration of type TYPE.
- Do NOT push it into the current binding. */
-
-tree
-create_tmp_var_raw (tree type, const char *prefix)
-{
- tree tmp_var;
-
- tmp_var = build_decl (input_location,
- VAR_DECL, prefix ? create_tmp_var_name (prefix) : NULL,
- type);
-
- /* The variable was declared by the compiler. */
- DECL_ARTIFICIAL (tmp_var) = 1;
- /* And we don't want debug info for it. */
- DECL_IGNORED_P (tmp_var) = 1;
-
- /* Make the variable writable. */
- TREE_READONLY (tmp_var) = 0;
-
- DECL_EXTERNAL (tmp_var) = 0;
- TREE_STATIC (tmp_var) = 0;
- TREE_USED (tmp_var) = 1;
-
- return tmp_var;
-}
-
-/* Create a new temporary variable declaration of type TYPE. DO push the
- variable into the current binding. Further, assume that this is called
- only from gimplification or optimization, at which point the creation of
- certain types are bugs. */
-
-tree
-create_tmp_var (tree type, const char *prefix)
-{
- tree tmp_var;
-
- /* We don't allow types that are addressable (meaning we can't make copies),
- or incomplete. We also used to reject every variable size objects here,
- but now support those for which a constant upper bound can be obtained.
- The processing for variable sizes is performed in gimple_add_tmp_var,
- point at which it really matters and possibly reached via paths not going
- through this function, e.g. after direct calls to create_tmp_var_raw. */
- gcc_assert (!TREE_ADDRESSABLE (type) && COMPLETE_TYPE_P (type));
-
- tmp_var = create_tmp_var_raw (type, prefix);
- gimple_add_tmp_var (tmp_var);
- return tmp_var;
-}
-
-/* Create a new temporary variable declaration of type TYPE by calling
- create_tmp_var and if TYPE is a vector or a complex number, mark the new
- temporary as gimple register. */
-
-tree
-create_tmp_reg (tree type, const char *prefix)
-{
- tree tmp;
-
- tmp = create_tmp_var (type, prefix);
- if (TREE_CODE (type) == COMPLEX_TYPE
- || TREE_CODE (type) == VECTOR_TYPE)
- DECL_GIMPLE_REG_P (tmp) = 1;
-
- return tmp;
-}
-
-/* Returns true iff T is a valid RHS for an assignment to a renamed
- user -- or front-end generated artificial -- variable. */
-
-static bool
-is_gimple_reg_rhs (tree t)
-{
- return get_gimple_rhs_class (TREE_CODE (t)) != GIMPLE_INVALID_RHS;
-}
-
/* Returns true iff T is a valid RHS for an assignment to an un-renamed
LHS, or for a call argument. */
@@ -750,84 +582,7 @@ gimple_add_tmp_var (tree tmp)
}
}
-/* Determine whether to assign a location to the statement GS. */
-
-static bool
-should_carry_location_p (gimple gs)
-{
- /* Don't emit a line note for a label. We particularly don't want to
- emit one for the break label, since it doesn't actually correspond
- to the beginning of the loop/switch. */
- if (gimple_code (gs) == GIMPLE_LABEL)
- return false;
-
- return true;
-}
-
-/* Return true if a location should not be emitted for this statement
- by annotate_one_with_location. */
-
-static inline bool
-gimple_do_not_emit_location_p (gimple g)
-{
- return gimple_plf (g, GF_PLF_1);
-}
-
-/* Mark statement G so a location will not be emitted by
- annotate_one_with_location. */
-
-static inline void
-gimple_set_do_not_emit_location (gimple g)
-{
- /* The PLF flags are initialized to 0 when a new tuple is created,
- so no need to initialize it anywhere. */
- gimple_set_plf (g, GF_PLF_1, true);
-}
-
-/* Set the location for gimple statement GS to LOCATION. */
-
-static void
-annotate_one_with_location (gimple gs, location_t location)
-{
- if (!gimple_has_location (gs)
- && !gimple_do_not_emit_location_p (gs)
- && should_carry_location_p (gs))
- gimple_set_location (gs, location);
-}
-
-/* Set LOCATION for all the statements after iterator GSI in sequence
- SEQ. If GSI is pointing to the end of the sequence, start with the
- first statement in SEQ. */
-static void
-annotate_all_with_location_after (gimple_seq seq, gimple_stmt_iterator gsi,
- location_t location)
-{
- if (gsi_end_p (gsi))
- gsi = gsi_start (seq);
- else
- gsi_next (&gsi);
-
- for (; !gsi_end_p (gsi); gsi_next (&gsi))
- annotate_one_with_location (gsi_stmt (gsi), location);
-}
-
-/* Set the location for all the statements in a sequence STMT_P to LOCATION. */
-
-void
-annotate_all_with_location (gimple_seq stmt_p, location_t location)
-{
- gimple_stmt_iterator i;
-
- if (gimple_seq_empty_p (stmt_p))
- return;
-
- for (i = gsi_start (stmt_p); !gsi_end_p (i); gsi_next (&i))
- {
- gimple gs = gsi_stmt (i);
- annotate_one_with_location (gs, location);
- }
-}
/* This page contains routines to unshare tree nodes, i.e. to duplicate tree
nodes that are referenced more than once in GENERIC functions. This is
@@ -1441,6 +1196,20 @@ gimplify_vla_decl (tree decl, gimple_seq *seq_p)
gimplify_ctxp->save_stack = true;
}
+/* A helper function to be called via walk_tree. Mark all labels under *TP
+ as being forced. To be called for DECL_INITIAL of static variables. */
+
+static tree
+force_labels_r (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
+{
+ if (TYPE_P (*tp))
+ *walk_subtrees = 0;
+ if (TREE_CODE (*tp) == LABEL_DECL)
+ FORCED_LABEL (*tp) = 1;
+
+ return NULL_TREE;
+}
+
/* Gimplify a DECL_EXPR node *STMT_P by making any necessary allocation
and initialization explicit. */
@@ -1557,208 +1326,7 @@ gimplify_statement_list (tree *expr_p, gimple_seq *pre_p)
return GS_ALL_DONE;
}
-
-/* Compare two case labels. Because the front end should already have
- made sure that case ranges do not overlap, it is enough to only compare
- the CASE_LOW values of each case label. */
-
-static int
-compare_case_labels (const void *p1, const void *p2)
-{
- const_tree const case1 = *(const_tree const*)p1;
- const_tree const case2 = *(const_tree const*)p2;
-
- /* The 'default' case label always goes first. */
- if (!CASE_LOW (case1))
- return -1;
- else if (!CASE_LOW (case2))
- return 1;
- else
- return tree_int_cst_compare (CASE_LOW (case1), CASE_LOW (case2));
-}
-
-/* Sort the case labels in LABEL_VEC in place in ascending order. */
-void
-sort_case_labels (vec<tree> label_vec)
-{
- label_vec.qsort (compare_case_labels);
-}
-
-/* Prepare a vector of case labels to be used in a GIMPLE_SWITCH statement.
-
- LABELS is a vector that contains all case labels to look at.
-
- INDEX_TYPE is the type of the switch index expression. Case labels
- in LABELS are discarded if their values are not in the value range
- covered by INDEX_TYPE. The remaining case label values are folded
- to INDEX_TYPE.
-
- If a default case exists in LABELS, it is removed from LABELS and
- returned in DEFAULT_CASEP. If no default case exists, but the
- case labels already cover the whole range of INDEX_TYPE, a default
- case is returned pointing to one of the existing case labels.
- Otherwise DEFAULT_CASEP is set to NULL_TREE.
-
- DEFAULT_CASEP may be NULL, in which case the above comment doesn't
- apply and no action is taken regardless of whether a default case is
- found or not. */
-
-void
-preprocess_case_label_vec_for_gimple (vec<tree> labels,
- tree index_type,
- tree *default_casep)
-{
- tree min_value, max_value;
- tree default_case = NULL_TREE;
- size_t i, len;
-
- i = 0;
- min_value = TYPE_MIN_VALUE (index_type);
- max_value = TYPE_MAX_VALUE (index_type);
- while (i < labels.length ())
- {
- tree elt = labels[i];
- tree low = CASE_LOW (elt);
- tree high = CASE_HIGH (elt);
- bool remove_element = FALSE;
-
- if (low)
- {
- gcc_checking_assert (TREE_CODE (low) == INTEGER_CST);
- gcc_checking_assert (!high || TREE_CODE (high) == INTEGER_CST);
-
- /* This is a non-default case label, i.e. it has a value.
-
- See if the case label is reachable within the range of
- the index type. Remove out-of-range case values. Turn
- case ranges into a canonical form (high > low strictly)
- and convert the case label values to the index type.
-
- NB: The type of gimple_switch_index() may be the promoted
- type, but the case labels retain the original type. */
-
- if (high)
- {
- /* This is a case range. Discard empty ranges.
- If the bounds or the range are equal, turn this
- into a simple (one-value) case. */
- int cmp = tree_int_cst_compare (high, low);
- if (cmp < 0)
- remove_element = TRUE;
- else if (cmp == 0)
- high = NULL_TREE;
- }
-
- if (! high)
- {
- /* If the simple case value is unreachable, ignore it. */
- if ((TREE_CODE (min_value) == INTEGER_CST
- && tree_int_cst_compare (low, min_value) < 0)
- || (TREE_CODE (max_value) == INTEGER_CST
- && tree_int_cst_compare (low, max_value) > 0))
- remove_element = TRUE;
- else
- low = fold_convert (index_type, low);
- }
- else
- {
- /* If the entire case range is unreachable, ignore it. */
- if ((TREE_CODE (min_value) == INTEGER_CST
- && tree_int_cst_compare (high, min_value) < 0)
- || (TREE_CODE (max_value) == INTEGER_CST
- && tree_int_cst_compare (low, max_value) > 0))
- remove_element = TRUE;
- else
- {
- /* If the lower bound is less than the index type's
- minimum value, truncate the range bounds. */
- if (TREE_CODE (min_value) == INTEGER_CST
- && tree_int_cst_compare (low, min_value) < 0)
- low = min_value;
- low = fold_convert (index_type, low);
-
- /* If the upper bound is greater than the index type's
- maximum value, truncate the range bounds. */
- if (TREE_CODE (max_value) == INTEGER_CST
- && tree_int_cst_compare (high, max_value) > 0)
- high = max_value;
- high = fold_convert (index_type, high);
-
- /* We may have folded a case range to a one-value case. */
- if (tree_int_cst_equal (low, high))
- high = NULL_TREE;
- }
- }
-
- CASE_LOW (elt) = low;
- CASE_HIGH (elt) = high;
- }
- else
- {
- gcc_assert (!default_case);
- default_case = elt;
- /* The default case must be passed separately to the
- gimple_build_switch routine. But if DEFAULT_CASEP
- is NULL, we do not remove the default case (it would
- be completely lost). */
- if (default_casep)
- remove_element = TRUE;
- }
-
- if (remove_element)
- labels.ordered_remove (i);
- else
- i++;
- }
- len = i;
-
- if (!labels.is_empty ())
- sort_case_labels (labels);
-
- if (default_casep && !default_case)
- {
- /* If the switch has no default label, add one, so that we jump
- around the switch body. If the labels already cover the whole
- range of the switch index_type, add the default label pointing
- to one of the existing labels. */
- if (len
- && TYPE_MIN_VALUE (index_type)
- && TYPE_MAX_VALUE (index_type)
- && tree_int_cst_equal (CASE_LOW (labels[0]),
- TYPE_MIN_VALUE (index_type)))
- {
- tree low, high = CASE_HIGH (labels[len - 1]);
- if (!high)
- high = CASE_LOW (labels[len - 1]);
- if (tree_int_cst_equal (high, TYPE_MAX_VALUE (index_type)))
- {
- for (i = 1; i < len; i++)
- {
- high = CASE_LOW (labels[i]);
- low = CASE_HIGH (labels[i - 1]);
- if (!low)
- low = CASE_LOW (labels[i - 1]);
- if ((TREE_INT_CST_LOW (low) + 1
- != TREE_INT_CST_LOW (high))
- || (TREE_INT_CST_HIGH (low)
- + (TREE_INT_CST_LOW (high) == 0)
- != TREE_INT_CST_HIGH (high)))
- break;
- }
- if (i == len)
- {
- tree label = CASE_LABEL (labels[0]);
- default_case = build_case_label (NULL_TREE, NULL_TREE,
- label);
- }
- }
- }
- }
-
- if (default_casep)
- *default_casep = default_case;
-}
/* Gimplify a SWITCH_EXPR, and collect the vector of labels it can
branch to. */
@@ -1882,20 +1450,6 @@ gimplify_exit_expr (tree *expr_p)
return GS_OK;
}
-/* A helper function to be called via walk_tree. Mark all labels under *TP
- as being forced. To be called for DECL_INITIAL of static variables. */
-
-tree
-force_labels_r (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
-{
- if (TYPE_P (*tp))
- *walk_subtrees = 0;
- if (TREE_CODE (*tp) == LABEL_DECL)
- FORCED_LABEL (*tp) = 1;
-
- return NULL_TREE;
-}
-
/* *EXPR_P is a COMPONENT_REF being used as an rvalue. If its type is
different from its canonical type, wrap the whole thing inside a
NOP_EXPR and force the type of the COMPONENT_REF to be the canonical
@@ -3838,7 +3392,7 @@ gimplify_init_ctor_eval (tree object, vec<constructor_elt, va_gc> *elts,
/* Return the appropriate RHS predicate for this LHS. */
-gimple_predicate
+static gimple_predicate
rhs_predicate_for (tree lhs)
{
if (is_gimple_reg (lhs))
@@ -9419,4 +8973,20 @@ gimplify_va_arg_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
}
}
-#include "gt-gimplify.h"
+/* Build a new GIMPLE_ASSIGN tuple and append it to the end of *SEQ_P.
+
+ DST/SRC are the destination and source respectively. You can pass
+ ungimplified trees in DST or SRC, in which case they will be
+ converted to a gimple operand if necessary.
+
+ This function returns the newly created GIMPLE_ASSIGN tuple. */
+
+gimple
+gimplify_assign (tree dst, tree src, gimple_seq *seq_p)
+{
+ tree t = build2 (MODIFY_EXPR, TREE_TYPE (dst), dst, src);
+ gimplify_and_add (t, seq_p);
+ ggc_free (t);
+ return gimple_seq_last_stmt (*seq_p);
+}
+
diff --git a/gcc/gimplify.h b/gcc/gimplify.h
new file mode 100644
index 00000000000..5f81cf2fe77
--- /dev/null
+++ b/gcc/gimplify.h
@@ -0,0 +1,92 @@
+/* Header file for gimplification.
+ 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_GIMPLIFY_H
+#define GCC_GIMPLIFY_H
+
+#include "gimple.h"
+
+/* Validation of GIMPLE expressions. Note that these predicates only check
+ the basic form of the expression, they don't recurse to make sure that
+ underlying nodes are also of the right form. */
+typedef bool (*gimple_predicate)(tree);
+
+/* FIXME we should deduce this from the predicate. */
+enum fallback {
+ fb_none = 0, /* Do not generate a temporary. */
+
+ fb_rvalue = 1, /* Generate an rvalue to hold the result of a
+ gimplified expression. */
+
+ fb_lvalue = 2, /* Generate an lvalue to hold the result of a
+ gimplified expression. */
+
+ fb_mayfail = 4, /* Gimplification may fail. Error issued
+ afterwards. */
+ fb_either= fb_rvalue | fb_lvalue
+};
+
+typedef int fallback_t;
+
+enum gimplify_status {
+ GS_ERROR = -2, /* Something Bad Seen. */
+ GS_UNHANDLED = -1, /* A langhook result for "I dunno". */
+ GS_OK = 0, /* We did something, maybe more to do. */
+ GS_ALL_DONE = 1 /* The expression is fully gimplified. */
+};
+
+extern void push_gimplify_context (struct gimplify_ctx *);
+extern void pop_gimplify_context (gimple);
+extern gimple gimple_current_bind_expr (void);
+extern vec<gimple> gimple_bind_expr_stack (void);
+extern void gimplify_and_add (tree, gimple_seq *);
+extern tree get_formal_tmp_var (tree, gimple_seq *);
+extern tree get_initialized_tmp_var (tree, gimple_seq *, gimple_seq *);
+extern void declare_vars (tree, gimple, bool);
+extern void gimple_add_tmp_var (tree);
+extern tree unshare_expr (tree);
+extern tree unshare_expr_without_location (tree);
+extern tree voidify_wrapper_expr (tree, tree);
+extern tree build_and_jump (tree *);
+extern enum gimplify_status gimplify_self_mod_expr (tree *, gimple_seq *,
+ gimple_seq *, bool, tree);
+extern tree gimple_boolify (tree);
+extern bool gimplify_stmt (tree *, gimple_seq *);
+extern void omp_firstprivatize_variable (struct gimplify_omp_ctx *, tree);
+extern enum gimplify_status gimplify_expr (tree *, gimple_seq *, gimple_seq *,
+ bool (*) (tree), fallback_t);
+
+extern void gimplify_type_sizes (tree, gimple_seq *);
+extern void gimplify_one_sizepos (tree *, gimple_seq *);
+extern gimple gimplify_body (tree, bool);
+extern void gimplify_function_tree (tree);
+extern void gimple_regimplify_operands (gimple, gimple_stmt_iterator *);
+extern tree force_gimple_operand_1 (tree, gimple_seq *, gimple_predicate, tree);
+extern tree force_gimple_operand (tree, gimple_seq *, bool, tree);
+extern tree force_gimple_operand_gsi_1 (gimple_stmt_iterator *, tree,
+ gimple_predicate, tree,
+ bool, enum gsi_iterator_update);
+extern tree force_gimple_operand_gsi (gimple_stmt_iterator *, tree, bool, tree,
+ bool, enum gsi_iterator_update);
+
+extern enum gimplify_status gimplify_va_arg_expr (tree *, gimple_seq *,
+ gimple_seq *);
+gimple gimplify_assign (tree, tree, gimple_seq *);
+
+#endif /* GCC_GIMPLIFY_H */
diff --git a/gcc/go/ChangeLog b/gcc/go/ChangeLog
index 33ccc1cdce8..49775b9778c 100644
--- a/gcc/go/ChangeLog
+++ b/gcc/go/ChangeLog
@@ -1,3 +1,7 @@
+2013-11-12 Andrew MacLeod <amacleod@redhat.com>
+
+ * go/go-lang.c: Include gimplify.h.
+
2013-11-06 Ian Lance Taylor <iant@google.com>
* go-lang.c (go_langhook_post_options): If
diff --git a/gcc/go/go-lang.c b/gcc/go/go-lang.c
index 14080f098c8..90cabb57181 100644
--- a/gcc/go/go-lang.c
+++ b/gcc/go/go-lang.c
@@ -23,7 +23,7 @@ along with GCC; see the file COPYING3. If not see
#include "coretypes.h"
#include "opts.h"
#include "tree.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "ggc.h"
#include "toplev.h"
#include "debug.h"
diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c
index ec4c1d1f461..207de4f1fe8 100644
--- a/gcc/graphite-clast-to-gimple.c
+++ b/gcc/graphite-clast-to-gimple.c
@@ -36,7 +36,7 @@ along with GCC; see the file COPYING3. If not see
#include "coretypes.h"
#include "diagnostic-core.h"
#include "tree.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "tree-ssa-loop-manip.h"
#include "tree-ssa-loop.h"
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 514be1d3847..9ee75b87d07 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -34,7 +34,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tree.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "tree-cfg.h"
#include "tree-phinodes.h"
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index 07af67724f5..9b38e4b3862 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -21,7 +21,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tree.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "langhooks.h"
#include "ggc.h"
#include "target.h"
diff --git a/gcc/ipa-split.c b/gcc/ipa-split.c
index 849868ca68c..df0a44e7d5f 100644
--- a/gcc/ipa-split.c
+++ b/gcc/ipa-split.c
@@ -78,7 +78,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tree.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "target.h"
#include "ipa-prop.h"
#include "gimple-ssa.h"
diff --git a/gcc/ipa.c b/gcc/ipa.c
index aef437a46f5..5e81fccbe0a 100644
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -24,7 +24,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "cgraph.h"
#include "tree-pass.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "ggc.h"
#include "flags.h"
#include "pointer-set.h"
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 4cb9e461a40..04b362973e6 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,7 @@
+2013-11-12 Andrew MacLeod <amacleod@redhat.com>
+
+ * java/java-gimplify.c: Include gimplify.h.
+
2013-11-07 Jeff Law <law@redhat.com>
* builtins.c (initialize_builtins): Provide __builtin_trap.
diff --git a/gcc/java/java-gimplify.c b/gcc/java/java-gimplify.c
index 6f159f8d829..d604cf82e97 100644
--- a/gcc/java/java-gimplify.c
+++ b/gcc/java/java-gimplify.c
@@ -27,7 +27,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "tree.h"
#include "java-tree.h"
#include "dumpfile.h"
-#include "gimple.h"
+#include "gimplify.h"
static tree java_gimplify_block (tree);
static enum gimplify_status java_gimplify_modify_expr (tree *);
diff --git a/gcc/langhooks.c b/gcc/langhooks.c
index 5d1457b1b22..a5be398751d 100644
--- a/gcc/langhooks.c
+++ b/gcc/langhooks.c
@@ -26,7 +26,7 @@ along with GCC; see the file COPYING3. If not see
#include "toplev.h"
#include "tree.h"
#include "tree-inline.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "rtl.h"
#include "insn-config.h"
#include "flags.h"
diff --git a/gcc/loop-init.c b/gcc/loop-init.c
index 0318ba9e5f6..8cc96af10fd 100644
--- a/gcc/loop-init.c
+++ b/gcc/loop-init.c
@@ -31,7 +31,6 @@ along with GCC; see the file COPYING3. If not see
#include "flags.h"
#include "df.h"
#include "ggc.h"
-#include "gimple.h"
#include "tree-ssa-loop-niter.h"
diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog
index e3be5f8d212..7c44fd7e284 100644
--- a/gcc/objc/ChangeLog
+++ b/gcc/objc/ChangeLog
@@ -1,3 +1,7 @@
+2013-11-12 Andrew MacLeod <amacleod@redhat.com>
+
+ * objc/objc-act.c: Include gimplify.h.
+
2013-11-07 Andrew MacLeod <amacleod@redhat.com>
* objc-act.c (objc_push_parm): Handle atomic qualifier.
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
index 3125398c276..34c52828705 100644
--- a/gcc/objc/objc-act.c
+++ b/gcc/objc/objc-act.c
@@ -60,7 +60,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-pretty-print.h"
/* For enum gimplify_status */
-#include "gimple.h"
+#include "gimplify.h"
/* For encode_method_prototype(). */
#include "objc-encoding.h"
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index 7874ff13dd6..e383f9a97f9 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -27,7 +27,7 @@ along with GCC; see the file COPYING3. If not see
#include "tm.h"
#include "tree.h"
#include "rtl.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "tree-iterator.h"
#include "tree-inline.h"
#include "langhooks.h"
diff --git a/gcc/sese.c b/gcc/sese.c
index 1daf4576258..cddd9510e36 100644
--- a/gcc/sese.c
+++ b/gcc/sese.c
@@ -25,7 +25,7 @@ along with GCC; see the file COPYING3. If not see
#include "hash-table.h"
#include "tree.h"
#include "tree-pretty-print.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "tree-cfg.h"
#include "tree-phinodes.h"
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index f390eea7910..a4ee040e26c 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -37,7 +37,7 @@ along with GCC; see the file COPYING3. If not see
#include "cgraph.h"
#include "tree-inline.h"
#include "tree-dump.h"
-#include "gimple.h"
+#include "gimplify.h"
/* Data type for the expressions representing sizes of data types.
It is the first integer type laid out. */
diff --git a/gcc/targhooks.c b/gcc/targhooks.c
index a671486453a..352b3c845d5 100644
--- a/gcc/targhooks.c
+++ b/gcc/targhooks.c
@@ -68,7 +68,7 @@ along with GCC; see the file COPYING3. If not see
#include "recog.h"
#include "intl.h"
#include "opts.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "tree-ssanames.h"
#include "tree-ssa-alias.h"
#include "insn-codes.h"
diff --git a/gcc/trans-mem.c b/gcc/trans-mem.c
index 784ff247e9d..e821c99c975 100644
--- a/gcc/trans-mem.c
+++ b/gcc/trans-mem.c
@@ -22,7 +22,7 @@
#include "coretypes.h"
#include "hash-table.h"
#include "tree.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "cgraph.h"
#include "tree-cfg.h"
diff --git a/gcc/tree-affine.c b/gcc/tree-affine.c
index b492ff0a211..7004a460761 100644
--- a/gcc/tree-affine.c
+++ b/gcc/tree-affine.c
@@ -24,7 +24,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-pretty-print.h"
#include "pointer-set.h"
#include "tree-affine.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "flags.h"
#include "dumpfile.h"
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index d6466939032..601efd65aa8 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -30,7 +30,7 @@ along with GCC; see the file COPYING3. If not see
#include "function.h"
#include "ggc.h"
#include "gimple-pretty-print.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "cgraph.h"
#include "tree-cfg.h"
diff --git a/gcc/tree-cfgcleanup.c b/gcc/tree-cfgcleanup.c
index c627d2cac57..3ca84c575bc 100644
--- a/gcc/tree-cfgcleanup.c
+++ b/gcc/tree-cfgcleanup.c
@@ -29,7 +29,7 @@ along with GCC; see the file COPYING3. If not see
#include "function.h"
#include "ggc.h"
#include "langhooks.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "tree-cfg.h"
#include "tree-phinodes.h"
diff --git a/gcc/tree-complex.c b/gcc/tree-complex.c
index 6439402ba75..b75c732e4f8 100644
--- a/gcc/tree-complex.c
+++ b/gcc/tree-complex.c
@@ -23,7 +23,7 @@ along with GCC; see the file COPYING3. If not see
#include "tm.h"
#include "tree.h"
#include "flags.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "tree-cfg.h"
#include "tree-phinodes.h"
diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c
index bb8de6d6ad7..98cb6ab606f 100644
--- a/gcc/tree-if-conv.c
+++ b/gcc/tree-if-conv.c
@@ -88,7 +88,7 @@ along with GCC; see the file COPYING3. If not see
#include "flags.h"
#include "basic-block.h"
#include "gimple-pretty-print.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "tree-cfg.h"
#include "tree-phinodes.h"
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 0d1f1c7621b..5d30caa6f6b 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -34,7 +34,7 @@ along with GCC; see the file COPYING3. If not see
#include "basic-block.h"
#include "tree-iterator.h"
#include "intl.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "tree-cfg.h"
#include "tree-phinodes.h"
diff --git a/gcc/tree-iterator.c b/gcc/tree-iterator.c
index 53347b54dc6..71329089657 100644
--- a/gcc/tree-iterator.c
+++ b/gcc/tree-iterator.c
@@ -22,7 +22,6 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tree.h"
-#include "gimple.h"
#include "tree-iterator.h"
#include "ggc.h"
diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c
index 45efad3f110..6adea4d7b34 100644
--- a/gcc/tree-loop-distribution.c
+++ b/gcc/tree-loop-distribution.c
@@ -45,7 +45,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tree.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "tree-cfg.h"
#include "tree-phinodes.h"
diff --git a/gcc/tree-nested.c b/gcc/tree-nested.c
index dc63ef6902e..97e4787e3c7 100644
--- a/gcc/tree-nested.c
+++ b/gcc/tree-nested.c
@@ -26,7 +26,7 @@
#include "function.h"
#include "tree-dump.h"
#include "tree-inline.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "tree-iterator.h"
#include "bitmap.h"
#include "cgraph.h"
diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c
index c357f1fe14c..a17085c8692 100644
--- a/gcc/tree-parloops.c
+++ b/gcc/tree-parloops.c
@@ -23,7 +23,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tree.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "tree-cfg.h"
#include "tree-phinodes.h"
diff --git a/gcc/tree-predcom.c b/gcc/tree-predcom.c
index 6084cf62ef6..15aadb03eca 100644
--- a/gcc/tree-predcom.c
+++ b/gcc/tree-predcom.c
@@ -191,7 +191,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "tm_p.h"
#include "cfgloop.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "tree-phinodes.h"
#include "ssa-iterators.h"
diff --git a/gcc/tree-profile.c b/gcc/tree-profile.c
index 9f9dba854fd..92530590108 100644
--- a/gcc/tree-profile.c
+++ b/gcc/tree-profile.c
@@ -34,7 +34,7 @@ along with GCC; see the file COPYING3. If not see
#include "diagnostic-core.h"
#include "coverage.h"
#include "tree.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "cgraph.h"
#include "tree-cfg.h"
diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c
index cafc70cb54b..3702922d001 100644
--- a/gcc/tree-scalar-evolution.c
+++ b/gcc/tree-scalar-evolution.c
@@ -259,7 +259,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "hash-table.h"
#include "gimple-pretty-print.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "tree-cfg.h"
#include "tree-phinodes.h"
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index 38da57700e2..a4f627f23c1 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -78,7 +78,7 @@ along with GCC; see the file COPYING3. If not see
#include "alloc-pool.h"
#include "tm.h"
#include "tree.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "bitmap.h"
#include "gimple-ssa.h"
#include "tree-cfg.h"
diff --git a/gcc/tree-ssa-address.c b/gcc/tree-ssa-address.c
index 146f909c7b1..3984e79ce12 100644
--- a/gcc/tree-ssa-address.c
+++ b/gcc/tree-ssa-address.c
@@ -28,7 +28,7 @@ along with GCC; see the file COPYING3. If not see
#include "tm_p.h"
#include "basic-block.h"
#include "tree-pretty-print.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "tree-ssanames.h"
#include "tree-ssa-loop-ivopts.h"
#include "tree-dfa.h"
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
index b4dfd4928cd..70b22053be7 100644
--- a/gcc/tree-ssa-ccp.c
+++ b/gcc/tree-ssa-ccp.c
@@ -119,7 +119,7 @@ along with GCC; see the file COPYING3. If not see
#include "basic-block.h"
#include "function.h"
#include "gimple-pretty-print.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "tree-cfg.h"
#include "tree-phinodes.h"
diff --git a/gcc/tree-ssa-dce.c b/gcc/tree-ssa-dce.c
index 72e2fb8fa65..7a016f6240d 100644
--- a/gcc/tree-ssa-dce.c
+++ b/gcc/tree-ssa-dce.c
@@ -50,7 +50,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "gimple-pretty-print.h"
#include "basic-block.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "tree-cfg.h"
#include "tree-phinodes.h"
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index 93b89704a2f..a6afb47a4db 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -25,7 +25,7 @@ along with GCC; see the file COPYING3. If not see
#include "tm_p.h"
#include "basic-block.h"
#include "gimple-pretty-print.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "tree-cfg.h"
#include "tree-phinodes.h"
diff --git a/gcc/tree-ssa-ifcombine.c b/gcc/tree-ssa-ifcombine.c
index 73ebfe8b24e..1786f9c29d3 100644
--- a/gcc/tree-ssa-ifcombine.c
+++ b/gcc/tree-ssa-ifcombine.c
@@ -29,7 +29,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "basic-block.h"
#include "tree-pretty-print.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "tree-cfg.h"
#include "tree-phinodes.h"
diff --git a/gcc/tree-ssa-loop-im.c b/gcc/tree-ssa-loop-im.c
index 2283b5b4dd7..34a37633a48 100644
--- a/gcc/tree-ssa-loop-im.c
+++ b/gcc/tree-ssa-loop-im.c
@@ -25,7 +25,7 @@ along with GCC; see the file COPYING3. If not see
#include "tm_p.h"
#include "basic-block.h"
#include "gimple-pretty-print.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "tree-cfg.h"
#include "tree-phinodes.h"
diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c
index d024bb4c395..894ff2db521 100644
--- a/gcc/tree-ssa-loop-ivopts.c
+++ b/gcc/tree-ssa-loop-ivopts.c
@@ -69,7 +69,7 @@ along with GCC; see the file COPYING3. If not see
#include "tm_p.h"
#include "basic-block.h"
#include "gimple-pretty-print.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "cgraph.h"
#include "tree-cfg.h"
diff --git a/gcc/tree-ssa-loop-manip.c b/gcc/tree-ssa-loop-manip.c
index 2bb225360dd..123a6e19c98 100644
--- a/gcc/tree-ssa-loop-manip.c
+++ b/gcc/tree-ssa-loop-manip.c
@@ -24,7 +24,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "tm_p.h"
#include "basic-block.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "tree-cfg.h"
#include "tree-phinodes.h"
diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c
index 3014faae796..a6adfc2f1a4 100644
--- a/gcc/tree-ssa-loop-niter.c
+++ b/gcc/tree-ssa-loop-niter.c
@@ -26,7 +26,7 @@ along with GCC; see the file COPYING3. If not see
#include "basic-block.h"
#include "gimple-pretty-print.h"
#include "intl.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "tree-cfg.h"
#include "tree-phinodes.h"
diff --git a/gcc/tree-ssa-loop-prefetch.c b/gcc/tree-ssa-loop-prefetch.c
index 5b7c0c2260c..85a0b0a6f44 100644
--- a/gcc/tree-ssa-loop-prefetch.c
+++ b/gcc/tree-ssa-loop-prefetch.c
@@ -25,7 +25,7 @@ along with GCC; see the file COPYING3. If not see
#include "tm_p.h"
#include "basic-block.h"
#include "tree-pretty-print.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "tree-ssa-loop-ivopts.h"
#include "tree-ssa-loop-manip.h"
diff --git a/gcc/tree-ssa-loop-unswitch.c b/gcc/tree-ssa-loop-unswitch.c
index e2b1c0735ad..a345a4c6fe3 100644
--- a/gcc/tree-ssa-loop-unswitch.c
+++ b/gcc/tree-ssa-loop-unswitch.c
@@ -24,7 +24,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "tm_p.h"
#include "basic-block.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "tree-cfg.h"
#include "tree-phinodes.h"
diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c
index 9a294111945..646f8cf1e64 100644
--- a/gcc/tree-ssa-math-opts.c
+++ b/gcc/tree-ssa-math-opts.c
@@ -90,7 +90,7 @@ along with GCC; see the file COPYING3. If not see
#include "tm.h"
#include "flags.h"
#include "tree.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "tree-cfg.h"
#include "tree-phinodes.h"
diff --git a/gcc/tree-ssa-phiopt.c b/gcc/tree-ssa-phiopt.c
index ef114a01a6d..d79e9575516 100644
--- a/gcc/tree-ssa-phiopt.c
+++ b/gcc/tree-ssa-phiopt.c
@@ -27,7 +27,7 @@ along with GCC; see the file COPYING3. If not see
#include "flags.h"
#include "tm_p.h"
#include "basic-block.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "tree-cfg.h"
#include "tree-phinodes.h"
diff --git a/gcc/tree-ssa-phiprop.c b/gcc/tree-ssa-phiprop.c
index e0e682e5dc2..61e38d5e385 100644
--- a/gcc/tree-ssa-phiprop.c
+++ b/gcc/tree-ssa-phiprop.c
@@ -26,7 +26,7 @@ along with GCC; see the file COPYING3. If not see
#include "tm_p.h"
#include "basic-block.h"
#include "gimple-pretty-print.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "tree-phinodes.h"
#include "ssa-iterators.h"
diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c
index 1f5ff23cb3f..7e83967b072 100644
--- a/gcc/tree-ssa-pre.c
+++ b/gcc/tree-ssa-pre.c
@@ -27,7 +27,7 @@ along with GCC; see the file COPYING3. If not see
#include "basic-block.h"
#include "gimple-pretty-print.h"
#include "tree-inline.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "tree-cfg.h"
#include "tree-phinodes.h"
diff --git a/gcc/tree-ssa-propagate.c b/gcc/tree-ssa-propagate.c
index 3456edbf5a0..00780b9a745 100644
--- a/gcc/tree-ssa-propagate.c
+++ b/gcc/tree-ssa-propagate.c
@@ -30,7 +30,7 @@
#include "gimple-pretty-print.h"
#include "dumpfile.h"
#include "sbitmap.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "tree-cfg.h"
#include "tree-phinodes.h"
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c
index 538a8ef0e4a..6e9188457f9 100644
--- a/gcc/tree-ssa-reassoc.c
+++ b/gcc/tree-ssa-reassoc.c
@@ -29,7 +29,7 @@ along with GCC; see the file COPYING3. If not see
#include "basic-block.h"
#include "gimple-pretty-print.h"
#include "tree-inline.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "tree-cfg.h"
#include "tree-phinodes.h"
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index ed4e1db718c..36ef0184e77 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -26,7 +26,7 @@ along with GCC; see the file COPYING3. If not see
#include "basic-block.h"
#include "gimple-pretty-print.h"
#include "tree-inline.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "tree-phinodes.h"
#include "ssa-iterators.h"
diff --git a/gcc/tree-ssa-strlen.c b/gcc/tree-ssa-strlen.c
index ea73179eea8..0a1c4d40919 100644
--- a/gcc/tree-ssa-strlen.c
+++ b/gcc/tree-ssa-strlen.c
@@ -24,7 +24,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "hash-table.h"
#include "bitmap.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "tree-phinodes.h"
#include "ssa-iterators.h"
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index ba8045d4702..ae8939e2ba9 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -31,7 +31,7 @@ along with GCC; see the file COPYING3. If not see
#include "function.h"
#include "gimple-pretty-print.h"
#include "pointer-set.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "tree-phinodes.h"
#include "ssa-iterators.h"
diff --git a/gcc/tree-switch-conversion.c b/gcc/tree-switch-conversion.c
index 46b9efe3aa7..7096b3da3de 100644
--- a/gcc/tree-switch-conversion.c
+++ b/gcc/tree-switch-conversion.c
@@ -31,7 +31,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
#include "flags.h"
#include "tree.h"
#include "basic-block.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "cgraph.h"
#include "tree-cfg.h"
diff --git a/gcc/tree-tailcall.c b/gcc/tree-tailcall.c
index 70d167a58e9..38acf7bb342 100644
--- a/gcc/tree-tailcall.c
+++ b/gcc/tree-tailcall.c
@@ -25,7 +25,7 @@ along with GCC; see the file COPYING3. If not see
#include "tm_p.h"
#include "basic-block.h"
#include "function.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "tree-cfg.h"
#include "tree-phinodes.h"
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index b7eb926494d..c4797755fde 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -30,7 +30,7 @@ along with GCC; see the file COPYING3. If not see
#include "target.h"
#include "basic-block.h"
#include "gimple-pretty-print.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "tree-phinodes.h"
#include "ssa-iterators.h"
diff --git a/gcc/tree-vect-generic.c b/gcc/tree-vect-generic.c
index 1521b2ba2c5..8fca8c14add 100644
--- a/gcc/tree-vect-generic.c
+++ b/gcc/tree-vect-generic.c
@@ -23,7 +23,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "tm.h"
#include "langhooks.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "tree-cfg.h"
#include "tree-ssanames.h"
diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c
index fb34664960e..15227856033 100644
--- a/gcc/tree-vect-loop-manip.c
+++ b/gcc/tree-vect-loop-manip.c
@@ -28,7 +28,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "basic-block.h"
#include "gimple-pretty-print.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "tree-cfg.h"
#include "tree-phinodes.h"
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index 6e71eea2436..292e7710402 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -28,7 +28,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "basic-block.h"
#include "gimple-pretty-print.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "tree-phinodes.h"
#include "ssa-iterators.h"
diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c
index 099880488bc..51b96e15408 100644
--- a/gcc/tree-vect-patterns.c
+++ b/gcc/tree-vect-patterns.c
@@ -27,7 +27,7 @@ along with GCC; see the file COPYING3. If not see
#include "target.h"
#include "basic-block.h"
#include "gimple-pretty-print.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "tree-phinodes.h"
#include "ssa-iterators.h"
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index 5a2bbb51608..b0e0fa99b20 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -29,7 +29,7 @@ along with GCC; see the file COPYING3. If not see
#include "target.h"
#include "basic-block.h"
#include "gimple-pretty-print.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "tree-cfg.h"
#include "tree-phinodes.h"
diff --git a/gcc/tree.h b/gcc/tree.h
index 9c2f2d010f7..e58b3a5c0c4 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -4294,10 +4294,6 @@ extern void cache_integer_cst (tree);
/* In cgraph.c */
extern void change_decl_assembler_name (tree, tree);
-/* In gimplify.c */
-extern tree unshare_expr (tree);
-extern tree unshare_expr_without_location (tree);
-
/* In stmt.c */
extern void expand_label (tree);
@@ -4775,7 +4771,6 @@ extern void set_decl_incoming_rtl (tree, rtx, bool);
/* In gimple.c. */
extern tree get_base_address (tree t);
-extern void mark_addressable (tree);
/* In tree.c. */
extern tree drop_tree_overflow (tree);
diff --git a/gcc/tsan.c b/gcc/tsan.c
index bceb5979de1..1d318ea8527 100644
--- a/gcc/tsan.c
+++ b/gcc/tsan.c
@@ -26,7 +26,7 @@ along with GCC; see the file COPYING3. If not see
#include "intl.h"
#include "tm.h"
#include "basic-block.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "function.h"
#include "gimple-ssa.h"
#include "cgraph.h"
diff --git a/gcc/value-prof.c b/gcc/value-prof.c
index 40e72ab8c89..dda302dde53 100644
--- a/gcc/value-prof.c
+++ b/gcc/value-prof.c
@@ -33,7 +33,7 @@ along with GCC; see the file COPYING3. If not see
#include "optabs.h"
#include "regs.h"
#include "ggc.h"
-#include "gimple.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "tree-cfg.h"
#include "tree-phinodes.h"