summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authoramacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-14 19:39:38 +0000
committeramacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-14 19:39:38 +0000
commite795d6e1ee8dd07622360c17bccdf047d632b95b (patch)
treec74c4d1bb5473fdc2c9d6c2a6ad1153f0c1c25de /gcc
parent983454618104a3e8beefa2fc56d7d3413d4b8b59 (diff)
downloadgcc-e795d6e1ee8dd07622360c17bccdf047d632b95b.tar.gz
* gimplify-be.h: New file. Add prototypes.
* gimplify.h: Don't include gimple.h. (struct gimplify_hasher, struct gimplify_ctx, is_gimple_sizepos, gimplify_hasher::hash, gimplify_hasher::equal): Relocate from gimple.h. * gimple.h (struct gimplify_hasher, gimplify_hasher::hash, gimplify_hasher::equal, struct gimplify_ctx, is_gimple_sizepos): Move to gimplify.h. (enum gsi_iterator_update): Move to gimple-iterator.h. * gimple-iterator.h (enum gsi_iterator_update): Relocate from gimple.h. * gimplify-be.c: New File. (force_gimple_operand_1, force_gimple_operand, force_gimple_operand_gsi_1, force_gimple_operand_gsi): Relocate from gimplify.c. * gimplify.c (force_gimple_operand_1, force_gimple_operand, force_gimple_operand_gsi_1, force_gimple_operand_gsi): Move to gimplify-be.c. * Makefile.in (OBJS): Add gimplify-be.o * asan.c: Include only gimplify.h, gimplify-be.h, and/or gimple.h as required. * cfgloopmanip.c: Likewise. * cgraphunit.c: Likewise. * cilk-common.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * gimple-expr.c: Likewise. * gimple-fold.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple.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: Likewise. * 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-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-conversion.c: Likewise. * 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. * tree.c: Likewise. * tsan.c: Likewise. * value-prof.c: Likewise. * config/aarch64/aarch64.c: Likewise. * 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. * c/c-typeck.c: Include only gimplify.h and gimple.h as needed. * c-family/c-common.c: Likewise. * c-family/c-gimplify.c: Likewise. * c-family/cilk.c: Likewise. * cp/class.c: Include only gimplify.h and gimple.h as needed. * 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. * fortran/trans-expr.c: Include only gimplify.h and gimple.h as needed. * fortran/trans-openmp.c: Likewise. * go/go-lang.c: Include only gimplify.h and gimple.h as needed. * java/java-gimplify.c: Include only gimplify.h and gimple.h as needed. * objc/objc-act.c: Include only gimplify.h and gimple.h as needed. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204812 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog103
-rw-r--r--gcc/Makefile.in1
-rw-r--r--gcc/asan.c1
-rw-r--r--gcc/c-family/ChangeLog16
-rw-r--r--gcc/c-family/c-common.c1
-rw-r--r--gcc/c-family/c-gimplify.c1
-rw-r--r--gcc/c-family/cilk.c1
-rw-r--r--gcc/c/ChangeLog6
-rw-r--r--gcc/c/c-typeck.c1
-rw-r--r--gcc/cfgloopmanip.c3
-rw-r--r--gcc/cgraphunit.c2
-rw-r--r--gcc/cilk-common.c1
-rw-r--r--gcc/config/aarch64/aarch64.c1
-rw-r--r--gcc/config/alpha/alpha.c1
-rw-r--r--gcc/config/darwin.c1
-rw-r--r--gcc/config/i386/i386.c1
-rw-r--r--gcc/config/ia64/ia64.c1
-rw-r--r--gcc/config/mep/mep.c1
-rw-r--r--gcc/config/mips/mips.c1
-rw-r--r--gcc/config/rs6000/rs6000.c1
-rw-r--r--gcc/config/s390/s390.c1
-rw-r--r--gcc/config/sh/sh.c1
-rw-r--r--gcc/config/sparc/sparc.c1
-rw-r--r--gcc/config/spu/spu.c1
-rw-r--r--gcc/config/stormy16/stormy16.c1
-rw-r--r--gcc/config/tilegx/tilegx.c1
-rw-r--r--gcc/config/tilepro/tilepro.c1
-rw-r--r--gcc/config/xtensa/xtensa.c1
-rw-r--r--gcc/cp/ChangeLog36
-rw-r--r--gcc/cp/class.c1
-rw-r--r--gcc/cp/cp-gimplify.c1
-rw-r--r--gcc/cp/error.c1
-rw-r--r--gcc/cp/init.c1
-rw-r--r--gcc/cp/optimize.c2
-rw-r--r--gcc/cp/pt.c1
-rw-r--r--gcc/cp/semantics.c1
-rw-r--r--gcc/cp/tree.c1
-rw-r--r--gcc/cp/vtable-class-hierarchy.c1
-rw-r--r--gcc/fold-const.c1
-rw-r--r--gcc/fortran/ChangeLog17
-rw-r--r--gcc/fortran/trans-expr.c1
-rw-r--r--gcc/fortran/trans-openmp.c1
-rw-r--r--gcc/function.c1
-rw-r--r--gcc/gimple-expr.c1
-rw-r--r--gcc/gimple-fold.c1
-rw-r--r--gcc/gimple-iterator.h10
-rw-r--r--gcc/gimple-ssa-strength-reduction.c3
-rw-r--r--gcc/gimple.c1
-rw-r--r--gcc/gimple.h90
-rw-r--r--gcc/gimplify-me.c317
-rw-r--r--gcc/gimplify-me.h37
-rw-r--r--gcc/gimplify.c325
-rw-r--r--gcc/gimplify.h62
-rw-r--r--gcc/go/ChangeLog6
-rw-r--r--gcc/go/go-lang.c1
-rw-r--r--gcc/graphite-clast-to-gimple.c3
-rw-r--r--gcc/graphite-sese-to-poly.c4
-rw-r--r--gcc/ipa-prop.c2
-rw-r--r--gcc/ipa-split.c2
-rw-r--r--gcc/ipa.c1
-rw-r--r--gcc/java/ChangeLog6
-rw-r--r--gcc/java/java-gimplify.c1
-rw-r--r--gcc/langhooks.c1
-rw-r--r--gcc/objc/ChangeLog6
-rw-r--r--gcc/objc/objc-act.c1
-rw-r--r--gcc/omp-low.c2
-rw-r--r--gcc/sese.c2
-rw-r--r--gcc/stor-layout.c1
-rw-r--r--gcc/targhooks.c1
-rw-r--r--gcc/trans-mem.c2
-rw-r--r--gcc/tree-affine.c1
-rw-r--r--gcc/tree-cfg.c3
-rw-r--r--gcc/tree-cfgcleanup.c1
-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-loop-distribution.c3
-rw-r--r--gcc/tree-nested.c1
-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.c4
-rw-r--r--gcc/tree-ssa-ccp.c1
-rw-r--r--gcc/tree-ssa-dce.c1
-rw-r--r--gcc/tree-ssa-forwprop.c2
-rw-r--r--gcc/tree-ssa-ifcombine.c3
-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.c1
-rw-r--r--gcc/tree-ssa-loop-prefetch.c2
-rw-r--r--gcc/tree-ssa-loop-unswitch.c1
-rw-r--r--gcc/tree-ssa-math-opts.c3
-rw-r--r--gcc/tree-ssa-phiopt.c2
-rw-r--r--gcc/tree-ssa-phiprop.c1
-rw-r--r--gcc/tree-ssa-pre.c2
-rw-r--r--gcc/tree-ssa-propagate.c1
-rw-r--r--gcc/tree-ssa-reassoc.c3
-rw-r--r--gcc/tree-ssa-sccvn.c1
-rw-r--r--gcc/tree-ssa-strlen.c2
-rw-r--r--gcc/tree-ssa.c1
-rw-r--r--gcc/tree-switch-conversion.c2
-rw-r--r--gcc/tree-tailcall.c3
-rw-r--r--gcc/tree-vect-data-refs.c2
-rw-r--r--gcc/tree-vect-generic.c3
-rw-r--r--gcc/tree-vect-loop-manip.c2
-rw-r--r--gcc/tree-vect-loop.c2
-rw-r--r--gcc/tree-vect-patterns.c1
-rw-r--r--gcc/tree-vect-stmts.c2
-rw-r--r--gcc/tree.c1
-rw-r--r--gcc/tsan.c1
-rw-r--r--gcc/value-prof.c1
114 files changed, 756 insertions, 435 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e9ae5c939ba..e6f7a6d7713 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,106 @@
+2013-11-14 Andrew MacLeod <amacleod@redhat.com>
+
+ * gimplify-me.h: New file. Add prototypes.
+ * gimplify.h: Don't include gimple.h.
+ (struct gimplify_hasher, struct gimplify_ctx, is_gimple_sizepos):
+ Relocate from gimple.h.
+ * gimple.h (struct gimplify_hasher, struct gimplify_ctx,
+ is_gimple_sizepos): Move to gimplify.h.
+ (gimplify_hasher::hash, gimplify_hasher::equal): Move to gimplify.c.
+ (enum gsi_iterator_update): Move to gimple-iterator.h.
+ * gimple-iterator.h (enum gsi_iterator_update): Relocate from gimple.h.
+ * gimplify-me.c: New File.
+ (force_gimple_operand_1, force_gimple_operand,
+ force_gimple_operand_gsi_1, force_gimple_operand_gsi,
+ gimple_regimplify_operands): Relocate from gimplify.c.
+ * gimplify.c (force_gimple_operand_1, force_gimple_operand,
+ force_gimple_operand_gsi_1, force_gimple_operand_gsi,
+ gimple_regimplify_operands): Move to gimplify-me.c.
+ (gimplify_hasher::hash, gimplify_hasher::equal): Relocate from gimple.h.
+ * Makefile.in (OBJS): Add gimplify-me.o
+ * asan.c: Include only gimplify.h, gimplify-me.h, and/or gimple.h as
+ required.
+ * cfgloopmanip.c: Likewise.
+ * cgraphunit.c: Likewise.
+ * cilk-common.c: Likewise.
+ * fold-const.c: Likewise.
+ * function.c: Likewise.
+ * gimple-expr.c: Likewise.
+ * gimple-fold.c: Likewise.
+ * gimple-ssa-strength-reduction.c: Likewise.
+ * gimple.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: Likewise.
+ * 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-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-conversion.c: Likewise.
+ * 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.
+ * tree.c: Likewise.
+ * tsan.c: Likewise.
+ * value-prof.c: Likewise.
+ * config/aarch64/aarch64.c: Likewise.
+ * 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-14 Joern Rennecke <joern.rennecke@embecosm.com>
* config/arc/arc.md (doloop_begin_i): Remove extra alignment;
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 2987506e298..806b6caa8ce 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -1242,6 +1242,7 @@ OBJS = \
gimple-streamer-out.o \
gimple-walk.o \
gimplify.o \
+ gimplify-me.o \
godump.o \
graph.o \
graphds.o \
diff --git a/gcc/asan.c b/gcc/asan.c
index a3fb51fa8db..2a1dceba958 100644
--- a/gcc/asan.c
+++ b/gcc/asan.c
@@ -23,6 +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-iterator.h"
#include "tree-iterator.h"
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index e4e6163e091..9deab9e7f58 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,9 @@
+2013-11-14 Andrew MacLeod <amacleod@redhat.com>
+
+ * c-common.c: Likewise.
+ * c-gimplify.c: Likewise.
+ * cilk.c: Likewise.
+
2013-11-13 Joseph Myers <joseph@codesourcery.com>
* c-common.h (enum rid): Add RID_AUTO_TYPE.
@@ -6,11 +12,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.
+ * c-common.c: Include gimplify.h.
+ * c-gimplify.c: Likewise.
+ * cilk.c: Likewise.
+ * c-omp.c: Include gimple-expr.h instead of gimple.h.
+ * c-ubsan.c: Don't include gimple.h.
2013-11-12 Joseph Myers <joseph@codesourcery.com>
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index 1f5e4ededa1..7955bb1bb15 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 "gimple.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 a7f29f8b4fc..d3c304e1137 100644
--- a/gcc/c-family/c-gimplify.c
+++ b/gcc/c-family/c-gimplify.c
@@ -29,6 +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"
diff --git a/gcc/c-family/cilk.c b/gcc/c-family/cilk.c
index f6d7dce01ce..165348f124c 100644
--- a/gcc/c-family/cilk.c
+++ b/gcc/c-family/cilk.c
@@ -25,6 +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"
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index b9b9dc9cacc..6d390095fde 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,7 @@
+2013-11-14 Andrew MacLeod <amacleod@redhat.com>
+
+ * c-typeck.c: Include only gimplify.h and gimple.h as needed.
+
2013-11-13 Joseph Myers <joseph@codesourcery.com>
* c-tree.h (c_typespec_keyword): Add cts_auto_type.
@@ -16,7 +20,7 @@
2013-11-12 Andrew MacLeod <amacleod@redhat.com>
- * c/c-typeck.c: Include gimplify.h.
+ * c-typeck.c: Include gimplify.h.
2013-11-12 Joseph Myers <joseph@codesourcery.com>
diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c
index 1cf9b4563bc..a9c9e6eb02a 100644
--- a/gcc/c/c-typeck.c
+++ b/gcc/c/c-typeck.c
@@ -36,6 +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"
diff --git a/gcc/cfgloopmanip.c b/gcc/cfgloopmanip.c
index 6448605823b..0fc6552746b 100644
--- a/gcc/cfgloopmanip.c
+++ b/gcc/cfgloopmanip.c
@@ -25,8 +25,9 @@ along with GCC; see the file COPYING3. If not see
#include "basic-block.h"
#include "cfgloop.h"
#include "tree.h"
-#include "gimplify.h"
+#include "gimple.h"
#include "gimple-iterator.h"
+#include "gimplify-me.h"
#include "tree-ssa-loop-manip.h"
#include "dumpfile.h"
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 51961fc7a79..8ab274b5640 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -164,8 +164,10 @@ 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-iterator.h"
+#include "gimplify-me.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 216c7d43607..8e070a3a32d 100644
--- a/gcc/cilk-common.c
+++ b/gcc/cilk-common.c
@@ -29,6 +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"
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index a8e7b7afca4..cfda95e0491 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -42,6 +42,7 @@
#include "recog.h"
#include "langhooks.h"
#include "diagnostic-core.h"
+#include "gimple.h"
#include "gimplify.h"
#include "optabs.h"
#include "dwarf2.h"
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index 9c8d907cd23..cc455e206f1 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -48,6 +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"
diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c
index 009e851835c..3a5287fe744 100644
--- a/gcc/config/darwin.c
+++ b/gcc/config/darwin.c
@@ -45,6 +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"
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 87165713469..d581b969b0b 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -47,6 +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"
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index a28575c0bf6..e6bd96df881 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -49,6 +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"
diff --git a/gcc/config/mep/mep.c b/gcc/config/mep/mep.c
index f67bf855121..489bef9c2d3 100644
--- a/gcc/config/mep/mep.c
+++ b/gcc/config/mep/mep.c
@@ -47,6 +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 ece4fec5413..b2fd57bb5ff 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -50,6 +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"
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index c6b61717538..539dc56153d 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -51,6 +51,7 @@
#include "reload.h"
#include "cfgloop.h"
#include "sched-int.h"
+#include "gimple.h"
#include "gimplify.h"
#include "gimple-iterator.h"
#include "gimple-walk.h"
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index ca6503540b1..ed8eefa31f7 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -47,6 +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"
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 973d25ae38b..b812b8c584b 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -48,6 +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"
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index f2552bea63c..e72ee3f6b67 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -46,6 +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"
diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c
index 7dedaed4e10..e344b73fce6 100644
--- a/gcc/config/spu/spu.c
+++ b/gcc/config/spu/spu.c
@@ -45,6 +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"
diff --git a/gcc/config/stormy16/stormy16.c b/gcc/config/stormy16/stormy16.c
index 7704fff073a..3a08534be51 100644
--- a/gcc/config/stormy16/stormy16.c
+++ b/gcc/config/stormy16/stormy16.c
@@ -43,6 +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"
diff --git a/gcc/config/tilegx/tilegx.c b/gcc/config/tilegx/tilegx.c
index d20476f1610..bf13d11b820 100644
--- a/gcc/config/tilegx/tilegx.c
+++ b/gcc/config/tilegx/tilegx.c
@@ -40,6 +40,7 @@
#include "dwarf2.h"
#include "timevar.h"
#include "tree.h"
+#include "gimple.h"
#include "gimplify.h"
#include "cfgloop.h"
#include "tilegx-builtins.h"
diff --git a/gcc/config/tilepro/tilepro.c b/gcc/config/tilepro/tilepro.c
index 84b3ef53bb8..d497f64125f 100644
--- a/gcc/config/tilepro/tilepro.c
+++ b/gcc/config/tilepro/tilepro.c
@@ -41,6 +41,7 @@
#include "dwarf2.h"
#include "timevar.h"
#include "tree.h"
+#include "gimple.h"
#include "gimplify.h"
#include "cfgloop.h"
#include "tilepro-builtins.h"
diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
index 757314d58df..6385c5df555 100644
--- a/gcc/config/xtensa/xtensa.c
+++ b/gcc/config/xtensa/xtensa.c
@@ -46,6 +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 7c6b2319e35..54e424f1678 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,17 +1,29 @@
+2013-11-14 Andrew MacLeod <amacleod@redhat.com>
+
+ * class.c: Include only gimplify.h and gimple.h as needed.
+ * cp-gimplify.c: Likewise.
+ * error.c: Likewise.
+ * init.c: Likewise.
+ * optimize.c: Likewise.
+ * pt.c: Likewise.
+ * semantics.c: Likewise.
+ * tree.c: Likewise.
+ * vtable-class-hierarchy.c: Likewise.
+
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.
+ * class.c: Include gimplify.h.
+ * cp-gimplify.c: Likewise.
+ * error.c: Likewise.
+ * init.c: Likewise.
+ * optimize.c: Likewise.
+ * pt.c: Likewise.
+ * semantics.c: Likewise.
+ * tree.c: Likewise.
+ * vtable-class-hierarchy.c: Likewise.
+ * decl2.c: Don't include gimple.h.
+ * except.c: Likewise.
+ * method.c: Include pointer-set.h instead of gimple.h.
2013-11-12 Adam Butcher <adam@jessamine.co.uk>
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index b4cab542e2e..1df16d4ef8c 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 "gimple.h"
#include "gimplify.h"
/* The number of nested classes being processed. If we are not in the
diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c
index e8ccf1aa561..c464719ad42 100644
--- a/gcc/cp/cp-gimplify.c
+++ b/gcc/cp/cp-gimplify.c
@@ -27,6 +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"
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 3d72c1340dc..5f997c3ed29 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -33,7 +33,6 @@ 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/init.c b/gcc/cp/init.c
index 1919603a705..fde2314e326 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 "gimple.h"
#include "gimplify.h"
static bool begin_init_stmts (tree *, tree *);
diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c
index 736dad9bec7..c4ee8484bb9 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 "gimplify.h"
+#include "gimple.h"
#include "tree-iterator.h"
#include "cgraph.h"
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 96a7db58e23..b80591d4736 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 "gimple.h"
#include "gimplify.h"
/* The type of functions taking a tree, and some additional data, and
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 202f1cf6854..81394faa626 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -41,6 +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"
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index eb7bd876817..d7af1d3a551 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -30,6 +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"
#include "gimplify.h"
#include "hash-table.h"
diff --git a/gcc/cp/vtable-class-hierarchy.c b/gcc/cp/vtable-class-hierarchy.c
index 39c75ce5c33..5e78ec9d3a7 100644
--- a/gcc/cp/vtable-class-hierarchy.c
+++ b/gcc/cp/vtable-class-hierarchy.c
@@ -118,6 +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;
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 77f9fb8e581..5ca76912ca1 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -57,6 +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"
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 4f75b03bfb0..e6c6244e745 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,11 +1,16 @@
+2013-11-14 Andrew MacLeod <amacleod@redhat.com>
+
+ * trans-expr.c: Include only gimplify.h and gimple.h as needed.
+ * trans-openmp.c: Likewise.
+
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.
+ * f95-lang.c: Don't include gimple.h.
+ * trans-array.c: Include gimple-expr.h instead of gimple.h.
+ * trans.c: Likewise.
+ * trans-decl.c: Likewise.
+ * trans-expr.c: Include gimplify.h.
+ * trans-openmp.c: Likewise.
2013-11-07 Janus Weil <janus@gcc.gnu.org>
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 8adada6bead..b932fa4d715 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 "gimple.h"
#include "gimplify.h"
diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c
index 9d6d4d4df45..13c87058ddd 100644
--- a/gcc/fortran/trans-openmp.c
+++ b/gcc/fortran/trans-openmp.c
@@ -23,6 +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" /* For create_tmp_var_raw. */
#include "diagnostic-core.h" /* For internal_error. */
#include "gfortran.h"
diff --git a/gcc/function.c b/gcc/function.c
index 9c7a9844b7f..eddffdbb955 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -55,6 +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"
diff --git a/gcc/gimple-expr.c b/gcc/gimple-expr.c
index c82abb7adab..9156f952784 100644
--- a/gcc/gimple-expr.c
+++ b/gcc/gimple-expr.c
@@ -24,6 +24,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 "demangle.h"
#include "gimple-ssa.h"
diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c
index f66d3e79e19..62c55509359 100644
--- a/gcc/gimple-fold.c
+++ b/gcc/gimple-fold.c
@@ -27,6 +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-iterator.h"
#include "gimple-ssa.h"
diff --git a/gcc/gimple-iterator.h b/gcc/gimple-iterator.h
index a9360fd14a7..24045f52487 100644
--- a/gcc/gimple-iterator.h
+++ b/gcc/gimple-iterator.h
@@ -35,6 +35,16 @@ typedef struct gimple_stmt_iterator_d
basic_block bb;
} gimple_stmt_iterator;
+enum gsi_iterator_update
+{
+ GSI_NEW_STMT, /* Only valid when single statement is added, move
+ iterator to it. */
+ GSI_SAME_STMT, /* Leave the iterator at the same statement. */
+ GSI_CONTINUE_LINKING /* Move iterator to whatever position is suitable
+ for linking other statements in the same
+ direction. */
+};
+
extern void gsi_insert_seq_before_without_update (gimple_stmt_iterator *,
gimple_seq,
enum gsi_iterator_update);
diff --git a/gcc/gimple-ssa-strength-reduction.c b/gcc/gimple-ssa-strength-reduction.c
index 35a725054bd..6de20e39615 100644
--- a/gcc/gimple-ssa-strength-reduction.c
+++ b/gcc/gimple-ssa-strength-reduction.c
@@ -37,8 +37,9 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tree.h"
-#include "gimplify.h"
+#include "gimple.h"
#include "gimple-iterator.h"
+#include "gimplify-me.h"
#include "basic-block.h"
#include "tree-pass.h"
#include "cfgloop.h"
diff --git a/gcc/gimple.c b/gcc/gimple.c
index 0e073460110..ff798ff42b2 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -31,6 +31,7 @@ along with GCC; see the file COPYING3. If not see
#include "gimple.h"
#include "gimple-iterator.h"
#include "gimple-walk.h"
+#include "gimple.h"
#include "gimplify.h"
#include "diagnostic.h"
#include "value-prof.h"
diff --git a/gcc/gimple.h b/gcc/gimple.h
index 9ed323899a8..6a0c39b7fce 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -847,85 +847,6 @@ typedef struct gimple_temp_hash_elt
tree temp; /* Value */
} elt_t;
-/* Gimplify hashtable helper. */
-
-struct gimplify_hasher : typed_free_remove <elt_t>
-{
- typedef elt_t value_type;
- typedef elt_t compare_type;
- static inline hashval_t hash (const value_type *);
- static inline bool equal (const value_type *, const compare_type *);
-};
-
-inline hashval_t
-gimplify_hasher::hash (const value_type *p)
-{
- tree t = p->val;
- return iterative_hash_expr (t, 0);
-}
-
-inline bool
-gimplify_hasher::equal (const value_type *p1, const compare_type *p2)
-{
- tree t1 = p1->val;
- tree t2 = p2->val;
- enum tree_code code = TREE_CODE (t1);
-
- if (TREE_CODE (t2) != code
- || TREE_TYPE (t1) != TREE_TYPE (t2))
- return false;
-
- if (!operand_equal_p (t1, t2, 0))
- return false;
-
-#ifdef ENABLE_CHECKING
- /* Only allow them to compare equal if they also hash equal; otherwise
- results are nondeterminate, and we fail bootstrap comparison. */
- gcc_assert (hash (p1) == hash (p2));
-#endif
-
- return true;
-}
-
-struct gimplify_ctx
-{
- struct gimplify_ctx *prev_context;
-
- vec<gimple> bind_expr_stack;
- tree temps;
- gimple_seq conditional_cleanups;
- tree exit_label;
- tree return_temp;
-
- vec<tree> case_labels;
- /* The formal temporary table. Should this be persistent? */
- hash_table <gimplify_hasher> temp_htab;
-
- int conditions;
- bool save_stack;
- bool into_ssa;
- bool allow_rhs_cond_expr;
- bool in_cleanup_point_expr;
-};
-
-/* Return true if gimplify_one_sizepos doesn't need to gimplify
- expr (when in TYPE_SIZE{,_UNIT} and similar type/decl size/bitsize
- fields). */
-static inline bool
-is_gimple_sizepos (tree expr)
-{
- /* gimplify_one_sizepos doesn't need to do anything if the value isn't there,
- is constant, or contains A PLACEHOLDER_EXPR. We also don't want to do
- anything if it's already a VAR_DECL. If it's a VAR_DECL from another
- function, the gimplifier will want to replace it with a new variable,
- but that will cause problems if this type is from outside the function.
- It's OK to have that here. */
- return (expr == NULL_TREE
- || TREE_CONSTANT (expr)
- || TREE_CODE (expr) == VAR_DECL
- || CONTAINS_PLACEHOLDER_P (expr));
-}
-
/* Get the number of the next statement uid to be allocated. */
static inline unsigned int
gimple_stmt_max_uid (struct function *fn)
@@ -948,7 +869,6 @@ inc_gimple_stmt_max_uid (struct function *fn)
}
/* Miscellaneous helpers. */
-struct gimplify_omp_ctx;
extern tree canonicalize_cond_expr_cond (tree);
extern void dump_decl_set (FILE *, bitmap);
extern bool nonfreeing_call_p (gimple);
@@ -5202,16 +5122,6 @@ gimple_expr_type (const_gimple stmt)
return void_type_node;
}
-enum gsi_iterator_update
-{
- GSI_NEW_STMT, /* Only valid when single statement is added, move
- iterator to it. */
- GSI_SAME_STMT, /* Leave the iterator at the same statement. */
- GSI_CONTINUE_LINKING /* Move iterator to whatever position is suitable
- for linking other statements in the same
- direction. */
-};
-
gimple gimple_call_copy_skip_args (gimple, bitmap);
/* Enum and arrays used for allocation stats. Keep in sync with
diff --git a/gcc/gimplify-me.c b/gcc/gimplify-me.c
new file mode 100644
index 00000000000..c4818fab756
--- /dev/null
+++ b/gcc/gimplify-me.c
@@ -0,0 +1,317 @@
+/* Tree lowering to gimple for middle end use only.
+ This converts the GENERIC functions-as-trees tree representation into
+ the GIMPLE form.
+ Copyright (C) 2013 Free Software Foundation, Inc.
+ Major work done by Sebastian Pop <s.pop@laposte.net>,
+ Diego Novillo <dnovillo@redhat.com> and Jason Merrill <jason@redhat.com>.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tree.h"
+#include "gimple.h"
+#include "gimple-iterator.h"
+#include "gimplify.h"
+#include "gimplify-me.h"
+#include "gimple-ssa.h"
+#include "tree-ssanames.h"
+
+
+/* Expand EXPR to list of gimple statements STMTS. GIMPLE_TEST_F specifies
+ the predicate that will hold for the result. If VAR is not NULL, make the
+ base variable of the final destination be VAR if suitable. */
+
+tree
+force_gimple_operand_1 (tree expr, gimple_seq *stmts,
+ gimple_predicate gimple_test_f, tree var)
+{
+ enum gimplify_status ret;
+ struct gimplify_ctx gctx;
+ location_t saved_location;
+
+ *stmts = NULL;
+
+ /* gimple_test_f might be more strict than is_gimple_val, make
+ sure we pass both. Just checking gimple_test_f doesn't work
+ because most gimple predicates do not work recursively. */
+ if (is_gimple_val (expr)
+ && (*gimple_test_f) (expr))
+ return expr;
+
+ push_gimplify_context (&gctx);
+ gimplify_ctxp->into_ssa = gimple_in_ssa_p (cfun);
+ gimplify_ctxp->allow_rhs_cond_expr = true;
+ saved_location = input_location;
+ input_location = UNKNOWN_LOCATION;
+
+ if (var)
+ {
+ if (gimplify_ctxp->into_ssa
+ && is_gimple_reg (var))
+ var = make_ssa_name (var, NULL);
+ expr = build2 (MODIFY_EXPR, TREE_TYPE (var), var, expr);
+ }
+
+ if (TREE_CODE (expr) != MODIFY_EXPR
+ && TREE_TYPE (expr) == void_type_node)
+ {
+ gimplify_and_add (expr, stmts);
+ expr = NULL_TREE;
+ }
+ else
+ {
+ ret = gimplify_expr (&expr, stmts, NULL, gimple_test_f, fb_rvalue);
+ gcc_assert (ret != GS_ERROR);
+ }
+
+ input_location = saved_location;
+ pop_gimplify_context (NULL);
+
+ return expr;
+}
+
+/* Expand EXPR to list of gimple statements STMTS. If SIMPLE is true,
+ force the result to be either ssa_name or an invariant, otherwise
+ just force it to be a rhs expression. If VAR is not NULL, make the
+ base variable of the final destination be VAR if suitable. */
+
+tree
+force_gimple_operand (tree expr, gimple_seq *stmts, bool simple, tree var)
+{
+ return force_gimple_operand_1 (expr, stmts,
+ simple ? is_gimple_val : is_gimple_reg_rhs,
+ var);
+}
+
+/* Invoke force_gimple_operand_1 for EXPR with parameters GIMPLE_TEST_F
+ and VAR. If some statements are produced, emits them at GSI.
+ If BEFORE is true. the statements are appended before GSI, otherwise
+ they are appended after it. M specifies the way GSI moves after
+ insertion (GSI_SAME_STMT or GSI_CONTINUE_LINKING are the usual values). */
+
+tree
+force_gimple_operand_gsi_1 (gimple_stmt_iterator *gsi, tree expr,
+ gimple_predicate gimple_test_f,
+ tree var, bool before,
+ enum gsi_iterator_update m)
+{
+ gimple_seq stmts;
+
+ expr = force_gimple_operand_1 (expr, &stmts, gimple_test_f, var);
+
+ if (!gimple_seq_empty_p (stmts))
+ {
+ if (before)
+ gsi_insert_seq_before (gsi, stmts, m);
+ else
+ gsi_insert_seq_after (gsi, stmts, m);
+ }
+
+ return expr;
+}
+
+/* Invoke force_gimple_operand_1 for EXPR with parameter VAR.
+ If SIMPLE is true, force the result to be either ssa_name or an invariant,
+ otherwise just force it to be a rhs expression. If some statements are
+ produced, emits them at GSI. If BEFORE is true, the statements are
+ appended before GSI, otherwise they are appended after it. M specifies
+ the way GSI moves after insertion (GSI_SAME_STMT or GSI_CONTINUE_LINKING
+ are the usual values). */
+
+tree
+force_gimple_operand_gsi (gimple_stmt_iterator *gsi, tree expr,
+ bool simple_p, tree var, bool before,
+ enum gsi_iterator_update m)
+{
+ return force_gimple_operand_gsi_1 (gsi, expr,
+ simple_p
+ ? is_gimple_val : is_gimple_reg_rhs,
+ var, before, m);
+}
+
+/* Some transformations like inlining may invalidate the GIMPLE form
+ for operands. This function traverses all the operands in STMT and
+ gimplifies anything that is not a valid gimple operand. Any new
+ GIMPLE statements are inserted before *GSI_P. */
+
+void
+gimple_regimplify_operands (gimple stmt, gimple_stmt_iterator *gsi_p)
+{
+ size_t i, num_ops;
+ tree lhs;
+ gimple_seq pre = NULL;
+ gimple post_stmt = NULL;
+ struct gimplify_ctx gctx;
+
+ push_gimplify_context (&gctx);
+ gimplify_ctxp->into_ssa = gimple_in_ssa_p (cfun);
+
+ switch (gimple_code (stmt))
+ {
+ case GIMPLE_COND:
+ gimplify_expr (gimple_cond_lhs_ptr (stmt), &pre, NULL,
+ is_gimple_val, fb_rvalue);
+ gimplify_expr (gimple_cond_rhs_ptr (stmt), &pre, NULL,
+ is_gimple_val, fb_rvalue);
+ break;
+ case GIMPLE_SWITCH:
+ gimplify_expr (gimple_switch_index_ptr (stmt), &pre, NULL,
+ is_gimple_val, fb_rvalue);
+ break;
+ case GIMPLE_OMP_ATOMIC_LOAD:
+ gimplify_expr (gimple_omp_atomic_load_rhs_ptr (stmt), &pre, NULL,
+ is_gimple_val, fb_rvalue);
+ break;
+ case GIMPLE_ASM:
+ {
+ size_t i, noutputs = gimple_asm_noutputs (stmt);
+ const char *constraint, **oconstraints;
+ bool allows_mem, allows_reg, is_inout;
+
+ oconstraints
+ = (const char **) alloca ((noutputs) * sizeof (const char *));
+ for (i = 0; i < noutputs; i++)
+ {
+ tree op = gimple_asm_output_op (stmt, i);
+ constraint = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (op)));
+ oconstraints[i] = constraint;
+ parse_output_constraint (&constraint, i, 0, 0, &allows_mem,
+ &allows_reg, &is_inout);
+ gimplify_expr (&TREE_VALUE (op), &pre, NULL,
+ is_inout ? is_gimple_min_lval : is_gimple_lvalue,
+ fb_lvalue | fb_mayfail);
+ }
+ for (i = 0; i < gimple_asm_ninputs (stmt); i++)
+ {
+ tree op = gimple_asm_input_op (stmt, i);
+ constraint = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (op)));
+ parse_input_constraint (&constraint, 0, 0, noutputs, 0,
+ oconstraints, &allows_mem, &allows_reg);
+ if (TREE_ADDRESSABLE (TREE_TYPE (TREE_VALUE (op))) && allows_mem)
+ allows_reg = 0;
+ if (!allows_reg && allows_mem)
+ gimplify_expr (&TREE_VALUE (op), &pre, NULL,
+ is_gimple_lvalue, fb_lvalue | fb_mayfail);
+ else
+ gimplify_expr (&TREE_VALUE (op), &pre, NULL,
+ is_gimple_asm_val, fb_rvalue);
+ }
+ }
+ break;
+ default:
+ /* NOTE: We start gimplifying operands from last to first to
+ make sure that side-effects on the RHS of calls, assignments
+ and ASMs are executed before the LHS. The ordering is not
+ important for other statements. */
+ num_ops = gimple_num_ops (stmt);
+ for (i = num_ops; i > 0; i--)
+ {
+ tree op = gimple_op (stmt, i - 1);
+ if (op == NULL_TREE)
+ continue;
+ if (i == 1 && (is_gimple_call (stmt) || is_gimple_assign (stmt)))
+ gimplify_expr (&op, &pre, NULL, is_gimple_lvalue, fb_lvalue);
+ else if (i == 2
+ && is_gimple_assign (stmt)
+ && num_ops == 2
+ && get_gimple_rhs_class (gimple_expr_code (stmt))
+ == GIMPLE_SINGLE_RHS)
+ gimplify_expr (&op, &pre, NULL,
+ rhs_predicate_for (gimple_assign_lhs (stmt)),
+ fb_rvalue);
+ else if (i == 2 && is_gimple_call (stmt))
+ {
+ if (TREE_CODE (op) == FUNCTION_DECL)
+ continue;
+ gimplify_expr (&op, &pre, NULL, is_gimple_call_addr, fb_rvalue);
+ }
+ else
+ gimplify_expr (&op, &pre, NULL, is_gimple_val, fb_rvalue);
+ gimple_set_op (stmt, i - 1, op);
+ }
+
+ lhs = gimple_get_lhs (stmt);
+ /* If the LHS changed it in a way that requires a simple RHS,
+ create temporary. */
+ if (lhs && !is_gimple_reg (lhs))
+ {
+ bool need_temp = false;
+
+ if (is_gimple_assign (stmt)
+ && num_ops == 2
+ && get_gimple_rhs_class (gimple_expr_code (stmt))
+ == GIMPLE_SINGLE_RHS)
+ gimplify_expr (gimple_assign_rhs1_ptr (stmt), &pre, NULL,
+ rhs_predicate_for (gimple_assign_lhs (stmt)),
+ fb_rvalue);
+ else if (is_gimple_reg (lhs))
+ {
+ if (is_gimple_reg_type (TREE_TYPE (lhs)))
+ {
+ if (is_gimple_call (stmt))
+ {
+ i = gimple_call_flags (stmt);
+ if ((i & ECF_LOOPING_CONST_OR_PURE)
+ || !(i & (ECF_CONST | ECF_PURE)))
+ need_temp = true;
+ }
+ if (stmt_can_throw_internal (stmt))
+ need_temp = true;
+ }
+ }
+ else
+ {
+ if (is_gimple_reg_type (TREE_TYPE (lhs)))
+ need_temp = true;
+ else if (TYPE_MODE (TREE_TYPE (lhs)) != BLKmode)
+ {
+ if (is_gimple_call (stmt))
+ {
+ tree fndecl = gimple_call_fndecl (stmt);
+
+ if (!aggregate_value_p (TREE_TYPE (lhs), fndecl)
+ && !(fndecl && DECL_RESULT (fndecl)
+ && DECL_BY_REFERENCE (DECL_RESULT (fndecl))))
+ need_temp = true;
+ }
+ else
+ need_temp = true;
+ }
+ }
+ if (need_temp)
+ {
+ tree temp = create_tmp_reg (TREE_TYPE (lhs), NULL);
+ if (gimple_in_ssa_p (cfun))
+ temp = make_ssa_name (temp, NULL);
+ gimple_set_lhs (stmt, temp);
+ post_stmt = gimple_build_assign (lhs, temp);
+ }
+ }
+ break;
+ }
+
+ if (!gimple_seq_empty_p (pre))
+ gsi_insert_seq_before (gsi_p, pre, GSI_SAME_STMT);
+ if (post_stmt)
+ gsi_insert_after (gsi_p, post_stmt, GSI_NEW_STMT);
+
+ pop_gimplify_context (NULL);
+}
+
+
diff --git a/gcc/gimplify-me.h b/gcc/gimplify-me.h
new file mode 100644
index 00000000000..a995af1d30e
--- /dev/null
+++ b/gcc/gimplify-me.h
@@ -0,0 +1,37 @@
+/* Header file for middle end 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_ME_H
+#define GCC_GIMPLIFY_ME_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);
+
+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 void gimple_regimplify_operands (gimple, gimple_stmt_iterator *);
+
+#endif /* GCC_GIMPLIFY_ME_H */
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 3253f861958..4e6f44898ba 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -23,8 +23,8 @@ along with GCC; see the file COPYING3. If not see
#include "config.h"
#include "system.h"
#include "coretypes.h"
-#include "tm.h"
#include "tree.h"
+#include "gimple.h"
#include "gimplify.h"
#include "gimple-iterator.h"
#include "tree-iterator.h"
@@ -37,24 +37,15 @@ along with GCC; see the file COPYING3. If not see
#include "tree-cfg.h"
#include "tree-ssanames.h"
#include "tree-ssa.h"
-#include "timevar.h"
-#include "hashtab.h"
-#include "flags.h"
-#include "function.h"
-#include "ggc.h"
#include "diagnostic-core.h"
#include "target.h"
-#include "pointer-set.h"
#include "splay-tree.h"
-#include "vec.h"
#include "omp-low.h"
#include "gimple-low.h"
#include "cilk.h"
#include "langhooks-def.h" /* FIXME: for lhd_set_decl_assembler_name */
#include "tree-pass.h" /* FIXME: only for PROP_gimple_any */
-#include "expr.h"
-#include "tm_p.h"
enum gimplify_omp_var_data
{
@@ -102,7 +93,7 @@ struct gimplify_omp_ctx
bool combined_loop;
};
-static struct gimplify_ctx *gimplify_ctxp;
+struct gimplify_ctx *gimplify_ctxp;
static struct gimplify_omp_ctx *gimplify_omp_ctxp;
@@ -3393,7 +3384,7 @@ gimplify_init_ctor_eval (tree object, vec<constructor_elt, va_gc> *elts,
/* Return the appropriate RHS predicate for this LHS. */
-static gimple_predicate
+gimple_predicate
rhs_predicate_for (tree lhs)
{
if (is_gimple_reg (lhs))
@@ -8590,287 +8581,6 @@ gimplify_function_tree (tree fndecl)
pop_cfun ();
}
-/* Some transformations like inlining may invalidate the GIMPLE form
- for operands. This function traverses all the operands in STMT and
- gimplifies anything that is not a valid gimple operand. Any new
- GIMPLE statements are inserted before *GSI_P. */
-
-void
-gimple_regimplify_operands (gimple stmt, gimple_stmt_iterator *gsi_p)
-{
- size_t i, num_ops;
- tree lhs;
- gimple_seq pre = NULL;
- gimple post_stmt = NULL;
- struct gimplify_ctx gctx;
-
- push_gimplify_context (&gctx);
- gimplify_ctxp->into_ssa = gimple_in_ssa_p (cfun);
-
- switch (gimple_code (stmt))
- {
- case GIMPLE_COND:
- gimplify_expr (gimple_cond_lhs_ptr (stmt), &pre, NULL,
- is_gimple_val, fb_rvalue);
- gimplify_expr (gimple_cond_rhs_ptr (stmt), &pre, NULL,
- is_gimple_val, fb_rvalue);
- break;
- case GIMPLE_SWITCH:
- gimplify_expr (gimple_switch_index_ptr (stmt), &pre, NULL,
- is_gimple_val, fb_rvalue);
- break;
- case GIMPLE_OMP_ATOMIC_LOAD:
- gimplify_expr (gimple_omp_atomic_load_rhs_ptr (stmt), &pre, NULL,
- is_gimple_val, fb_rvalue);
- break;
- case GIMPLE_ASM:
- {
- size_t i, noutputs = gimple_asm_noutputs (stmt);
- const char *constraint, **oconstraints;
- bool allows_mem, allows_reg, is_inout;
-
- oconstraints
- = (const char **) alloca ((noutputs) * sizeof (const char *));
- for (i = 0; i < noutputs; i++)
- {
- tree op = gimple_asm_output_op (stmt, i);
- constraint = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (op)));
- oconstraints[i] = constraint;
- parse_output_constraint (&constraint, i, 0, 0, &allows_mem,
- &allows_reg, &is_inout);
- gimplify_expr (&TREE_VALUE (op), &pre, NULL,
- is_inout ? is_gimple_min_lval : is_gimple_lvalue,
- fb_lvalue | fb_mayfail);
- }
- for (i = 0; i < gimple_asm_ninputs (stmt); i++)
- {
- tree op = gimple_asm_input_op (stmt, i);
- constraint = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (op)));
- parse_input_constraint (&constraint, 0, 0, noutputs, 0,
- oconstraints, &allows_mem, &allows_reg);
- if (TREE_ADDRESSABLE (TREE_TYPE (TREE_VALUE (op))) && allows_mem)
- allows_reg = 0;
- if (!allows_reg && allows_mem)
- gimplify_expr (&TREE_VALUE (op), &pre, NULL,
- is_gimple_lvalue, fb_lvalue | fb_mayfail);
- else
- gimplify_expr (&TREE_VALUE (op), &pre, NULL,
- is_gimple_asm_val, fb_rvalue);
- }
- }
- break;
- default:
- /* NOTE: We start gimplifying operands from last to first to
- make sure that side-effects on the RHS of calls, assignments
- and ASMs are executed before the LHS. The ordering is not
- important for other statements. */
- num_ops = gimple_num_ops (stmt);
- for (i = num_ops; i > 0; i--)
- {
- tree op = gimple_op (stmt, i - 1);
- if (op == NULL_TREE)
- continue;
- if (i == 1 && (is_gimple_call (stmt) || is_gimple_assign (stmt)))
- gimplify_expr (&op, &pre, NULL, is_gimple_lvalue, fb_lvalue);
- else if (i == 2
- && is_gimple_assign (stmt)
- && num_ops == 2
- && get_gimple_rhs_class (gimple_expr_code (stmt))
- == GIMPLE_SINGLE_RHS)
- gimplify_expr (&op, &pre, NULL,
- rhs_predicate_for (gimple_assign_lhs (stmt)),
- fb_rvalue);
- else if (i == 2 && is_gimple_call (stmt))
- {
- if (TREE_CODE (op) == FUNCTION_DECL)
- continue;
- gimplify_expr (&op, &pre, NULL, is_gimple_call_addr, fb_rvalue);
- }
- else
- gimplify_expr (&op, &pre, NULL, is_gimple_val, fb_rvalue);
- gimple_set_op (stmt, i - 1, op);
- }
-
- lhs = gimple_get_lhs (stmt);
- /* If the LHS changed it in a way that requires a simple RHS,
- create temporary. */
- if (lhs && !is_gimple_reg (lhs))
- {
- bool need_temp = false;
-
- if (is_gimple_assign (stmt)
- && num_ops == 2
- && get_gimple_rhs_class (gimple_expr_code (stmt))
- == GIMPLE_SINGLE_RHS)
- gimplify_expr (gimple_assign_rhs1_ptr (stmt), &pre, NULL,
- rhs_predicate_for (gimple_assign_lhs (stmt)),
- fb_rvalue);
- else if (is_gimple_reg (lhs))
- {
- if (is_gimple_reg_type (TREE_TYPE (lhs)))
- {
- if (is_gimple_call (stmt))
- {
- i = gimple_call_flags (stmt);
- if ((i & ECF_LOOPING_CONST_OR_PURE)
- || !(i & (ECF_CONST | ECF_PURE)))
- need_temp = true;
- }
- if (stmt_can_throw_internal (stmt))
- need_temp = true;
- }
- }
- else
- {
- if (is_gimple_reg_type (TREE_TYPE (lhs)))
- need_temp = true;
- else if (TYPE_MODE (TREE_TYPE (lhs)) != BLKmode)
- {
- if (is_gimple_call (stmt))
- {
- tree fndecl = gimple_call_fndecl (stmt);
-
- if (!aggregate_value_p (TREE_TYPE (lhs), fndecl)
- && !(fndecl && DECL_RESULT (fndecl)
- && DECL_BY_REFERENCE (DECL_RESULT (fndecl))))
- need_temp = true;
- }
- else
- need_temp = true;
- }
- }
- if (need_temp)
- {
- tree temp = create_tmp_reg (TREE_TYPE (lhs), NULL);
- if (gimple_in_ssa_p (cfun))
- temp = make_ssa_name (temp, NULL);
- gimple_set_lhs (stmt, temp);
- post_stmt = gimple_build_assign (lhs, temp);
- }
- }
- break;
- }
-
- if (!gimple_seq_empty_p (pre))
- gsi_insert_seq_before (gsi_p, pre, GSI_SAME_STMT);
- if (post_stmt)
- gsi_insert_after (gsi_p, post_stmt, GSI_NEW_STMT);
-
- pop_gimplify_context (NULL);
-}
-
-/* Expand EXPR to list of gimple statements STMTS. GIMPLE_TEST_F specifies
- the predicate that will hold for the result. If VAR is not NULL, make the
- base variable of the final destination be VAR if suitable. */
-
-tree
-force_gimple_operand_1 (tree expr, gimple_seq *stmts,
- gimple_predicate gimple_test_f, tree var)
-{
- enum gimplify_status ret;
- struct gimplify_ctx gctx;
- location_t saved_location;
-
- *stmts = NULL;
-
- /* gimple_test_f might be more strict than is_gimple_val, make
- sure we pass both. Just checking gimple_test_f doesn't work
- because most gimple predicates do not work recursively. */
- if (is_gimple_val (expr)
- && (*gimple_test_f) (expr))
- return expr;
-
- push_gimplify_context (&gctx);
- gimplify_ctxp->into_ssa = gimple_in_ssa_p (cfun);
- gimplify_ctxp->allow_rhs_cond_expr = true;
- saved_location = input_location;
- input_location = UNKNOWN_LOCATION;
-
- if (var)
- {
- if (gimplify_ctxp->into_ssa
- && is_gimple_reg (var))
- var = make_ssa_name (var, NULL);
- expr = build2 (MODIFY_EXPR, TREE_TYPE (var), var, expr);
- }
-
- if (TREE_CODE (expr) != MODIFY_EXPR
- && TREE_TYPE (expr) == void_type_node)
- {
- gimplify_and_add (expr, stmts);
- expr = NULL_TREE;
- }
- else
- {
- ret = gimplify_expr (&expr, stmts, NULL, gimple_test_f, fb_rvalue);
- gcc_assert (ret != GS_ERROR);
- }
-
- input_location = saved_location;
- pop_gimplify_context (NULL);
-
- return expr;
-}
-
-/* Expand EXPR to list of gimple statements STMTS. If SIMPLE is true,
- force the result to be either ssa_name or an invariant, otherwise
- just force it to be a rhs expression. If VAR is not NULL, make the
- base variable of the final destination be VAR if suitable. */
-
-tree
-force_gimple_operand (tree expr, gimple_seq *stmts, bool simple, tree var)
-{
- return force_gimple_operand_1 (expr, stmts,
- simple ? is_gimple_val : is_gimple_reg_rhs,
- var);
-}
-
-/* Invoke force_gimple_operand_1 for EXPR with parameters GIMPLE_TEST_F
- and VAR. If some statements are produced, emits them at GSI.
- If BEFORE is true. the statements are appended before GSI, otherwise
- they are appended after it. M specifies the way GSI moves after
- insertion (GSI_SAME_STMT or GSI_CONTINUE_LINKING are the usual values). */
-
-tree
-force_gimple_operand_gsi_1 (gimple_stmt_iterator *gsi, tree expr,
- gimple_predicate gimple_test_f,
- tree var, bool before,
- enum gsi_iterator_update m)
-{
- gimple_seq stmts;
-
- expr = force_gimple_operand_1 (expr, &stmts, gimple_test_f, var);
-
- if (!gimple_seq_empty_p (stmts))
- {
- if (before)
- gsi_insert_seq_before (gsi, stmts, m);
- else
- gsi_insert_seq_after (gsi, stmts, m);
- }
-
- return expr;
-}
-
-/* Invoke force_gimple_operand_1 for EXPR with parameter VAR.
- If SIMPLE is true, force the result to be either ssa_name or an invariant,
- otherwise just force it to be a rhs expression. If some statements are
- produced, emits them at GSI. If BEFORE is true, the statements are
- appended before GSI, otherwise they are appended after it. M specifies
- the way GSI moves after insertion (GSI_SAME_STMT or GSI_CONTINUE_LINKING
- are the usual values). */
-
-tree
-force_gimple_operand_gsi (gimple_stmt_iterator *gsi, tree expr,
- bool simple_p, tree var, bool before,
- enum gsi_iterator_update m)
-{
- return force_gimple_operand_gsi_1 (gsi, expr,
- simple_p
- ? is_gimple_val : is_gimple_reg_rhs,
- var, before, m);
-}
-
/* Return a dummy expression of type TYPE in order to keep going after an
error. */
@@ -8991,3 +8701,32 @@ gimplify_assign (tree dst, tree src, gimple_seq *seq_p)
return gimple_seq_last_stmt (*seq_p);
}
+inline hashval_t
+gimplify_hasher::hash (const value_type *p)
+{
+ tree t = p->val;
+ return iterative_hash_expr (t, 0);
+}
+
+inline bool
+gimplify_hasher::equal (const value_type *p1, const compare_type *p2)
+{
+ tree t1 = p1->val;
+ tree t2 = p2->val;
+ enum tree_code code = TREE_CODE (t1);
+
+ if (TREE_CODE (t2) != code
+ || TREE_TYPE (t1) != TREE_TYPE (t2))
+ return false;
+
+ if (!operand_equal_p (t1, t2, 0))
+ return false;
+
+#ifdef ENABLE_CHECKING
+ /* Only allow them to compare equal if they also hash equal; otherwise
+ results are nondeterminate, and we fail bootstrap comparison. */
+ gcc_assert (hash (p1) == hash (p2));
+#endif
+
+ return true;
+}
diff --git a/gcc/gimplify.h b/gcc/gimplify.h
index 5f81cf2fe77..3f7e1b327a9 100644
--- a/gcc/gimplify.h
+++ b/gcc/gimplify.h
@@ -20,8 +20,6 @@ along with GCC; see the file COPYING3. If not see
#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. */
@@ -50,7 +48,38 @@ enum gimplify_status {
GS_OK = 0, /* We did something, maybe more to do. */
GS_ALL_DONE = 1 /* The expression is fully gimplified. */
};
+/* Gimplify hashtable helper. */
+
+struct gimplify_hasher : typed_free_remove <elt_t>
+{
+ typedef elt_t value_type;
+ typedef elt_t compare_type;
+ static inline hashval_t hash (const value_type *);
+ static inline bool equal (const value_type *, const compare_type *);
+};
+
+struct gimplify_ctx
+{
+ struct gimplify_ctx *prev_context;
+
+ vec<gimple> bind_expr_stack;
+ tree temps;
+ gimple_seq conditional_cleanups;
+ tree exit_label;
+ tree return_temp;
+
+ vec<tree> case_labels;
+ /* The formal temporary table. Should this be persistent? */
+ hash_table <gimplify_hasher> temp_htab;
+
+ int conditions;
+ bool save_stack;
+ bool into_ssa;
+ bool allow_rhs_cond_expr;
+ bool in_cleanup_point_expr;
+};
+extern struct gimplify_ctx *gimplify_ctxp;
extern void push_gimplify_context (struct gimplify_ctx *);
extern void pop_gimplify_context (gimple);
extern gimple gimple_current_bind_expr (void);
@@ -67,6 +96,7 @@ 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 gimple_predicate rhs_predicate_for (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 *,
@@ -76,17 +106,27 @@ 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 *);
+/* Return true if gimplify_one_sizepos doesn't need to gimplify
+ expr (when in TYPE_SIZE{,_UNIT} and similar type/decl size/bitsize
+ fields). */
+
+static inline bool
+is_gimple_sizepos (tree expr)
+{
+ /* gimplify_one_sizepos doesn't need to do anything if the value isn't there,
+ is constant, or contains A PLACEHOLDER_EXPR. We also don't want to do
+ anything if it's already a VAR_DECL. If it's a VAR_DECL from another
+ function, the gimplifier will want to replace it with a new variable,
+ but that will cause problems if this type is from outside the function.
+ It's OK to have that here. */
+ return (expr == NULL_TREE
+ || TREE_CONSTANT (expr)
+ || TREE_CODE (expr) == VAR_DECL
+ || CONTAINS_PLACEHOLDER_P (expr));
+}
+
#endif /* GCC_GIMPLIFY_H */
diff --git a/gcc/go/ChangeLog b/gcc/go/ChangeLog
index 49775b9778c..54d9f3bf9b4 100644
--- a/gcc/go/ChangeLog
+++ b/gcc/go/ChangeLog
@@ -1,6 +1,10 @@
+2013-11-14 Andrew MacLeod <amacleod@redhat.com>
+
+ * go-lang.c: Include only gimplify.h and gimple.h as needed.
+
2013-11-12 Andrew MacLeod <amacleod@redhat.com>
- * go/go-lang.c: Include gimplify.h.
+ * go-lang.c: Include gimplify.h.
2013-11-06 Ian Lance Taylor <iant@google.com>
diff --git a/gcc/go/go-lang.c b/gcc/go/go-lang.c
index 90cabb57181..aa1d80b5be2 100644
--- a/gcc/go/go-lang.c
+++ b/gcc/go/go-lang.c
@@ -23,6 +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"
diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c
index 38404f4ee40..44aecfbebf6 100644
--- a/gcc/graphite-clast-to-gimple.c
+++ b/gcc/graphite-clast-to-gimple.c
@@ -36,8 +36,9 @@ along with GCC; see the file COPYING3. If not see
#include "coretypes.h"
#include "diagnostic-core.h"
#include "tree.h"
-#include "gimplify.h"
+#include "gimple.h"
#include "gimple-iterator.h"
+#include "gimplify-me.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 b10bb46e33e..a07e047832e 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -34,8 +34,10 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tree.h"
-#include "gimplify.h"
+#include "gimple.h"
#include "gimple-iterator.h"
+#include "gimplify.h"
+#include "gimplify-me.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 327bca9e597..eb464e4d51e 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -21,8 +21,10 @@ 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-iterator.h"
+#include "gimplify-me.h"
#include "gimple-walk.h"
#include "langhooks.h"
#include "ggc.h"
diff --git a/gcc/ipa-split.c b/gcc/ipa-split.c
index 40b876653a8..e55b3f59dbc 100644
--- a/gcc/ipa-split.c
+++ b/gcc/ipa-split.c
@@ -78,8 +78,10 @@ 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-iterator.h"
+#include "gimplify-me.h"
#include "gimple-walk.h"
#include "target.h"
#include "ipa-prop.h"
diff --git a/gcc/ipa.c b/gcc/ipa.c
index a11b1c75304..f43986214d1 100644
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -24,6 +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"
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 2b2d963631e..a474ccc0d7f 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,6 +1,10 @@
+2013-11-14 Andrew MacLeod <amacleod@redhat.com>
+
+ * java-gimplify.c: Include only gimplify.h and gimple.h as needed.
+
2013-11-12 Andrew MacLeod <amacleod@redhat.com>
- * java/java-gimplify.c: Include gimplify.h.
+ * java-gimplify.c: Include gimplify.h.
2013-11-07 Jeff Law <law@redhat.com>
diff --git a/gcc/java/java-gimplify.c b/gcc/java/java-gimplify.c
index d604cf82e97..f2d0460ae31 100644
--- a/gcc/java/java-gimplify.c
+++ b/gcc/java/java-gimplify.c
@@ -27,6 +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);
diff --git a/gcc/langhooks.c b/gcc/langhooks.c
index a5be398751d..ec0dd4d75ee 100644
--- a/gcc/langhooks.c
+++ b/gcc/langhooks.c
@@ -26,6 +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"
diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog
index 7c44fd7e284..8777efba152 100644
--- a/gcc/objc/ChangeLog
+++ b/gcc/objc/ChangeLog
@@ -1,6 +1,10 @@
+2013-11-14 Andrew MacLeod <amacleod@redhat.com>
+
+ * objc-act.c: Include only gimplify.h and gimple.h as needed.
+
2013-11-12 Andrew MacLeod <amacleod@redhat.com>
- * objc/objc-act.c: Include gimplify.h.
+ * objc-act.c: Include gimplify.h.
2013-11-07 Andrew MacLeod <amacleod@redhat.com>
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
index 34c52828705..9a640a3edd3 100644
--- a/gcc/objc/objc-act.c
+++ b/gcc/objc/objc-act.c
@@ -60,6 +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(). */
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index 86f95a1152d..5be9ff8ec40 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -27,8 +27,10 @@ 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 "gimple-iterator.h"
+#include "gimplify-me.h"
#include "gimple-walk.h"
#include "tree-iterator.h"
#include "tree-inline.h"
diff --git a/gcc/sese.c b/gcc/sese.c
index 169ed9a845d..d05b14afbb8 100644
--- a/gcc/sese.c
+++ b/gcc/sese.c
@@ -25,8 +25,10 @@ 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-iterator.h"
+#include "gimplify-me.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 a4ee040e26c..264c33e3a0b 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -37,6 +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.
diff --git a/gcc/targhooks.c b/gcc/targhooks.c
index 352b3c845d5..55ab7d07b67 100644
--- a/gcc/targhooks.c
+++ b/gcc/targhooks.c
@@ -68,6 +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"
diff --git a/gcc/trans-mem.c b/gcc/trans-mem.c
index 748fd5edf60..b56ff735081 100644
--- a/gcc/trans-mem.c
+++ b/gcc/trans-mem.c
@@ -22,8 +22,10 @@
#include "coretypes.h"
#include "hash-table.h"
#include "tree.h"
+#include "gimple.h"
#include "gimplify.h"
#include "gimple-iterator.h"
+#include "gimplify-me.h"
#include "gimple-walk.h"
#include "gimple-ssa.h"
#include "cgraph.h"
diff --git a/gcc/tree-affine.c b/gcc/tree-affine.c
index 7004a460761..d6d5686ef15 100644
--- a/gcc/tree-affine.c
+++ b/gcc/tree-affine.c
@@ -24,6 +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 9cdb1a5b978..d7f62125e4a 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -30,8 +30,9 @@ along with GCC; see the file COPYING3. If not see
#include "function.h"
#include "ggc.h"
#include "gimple-pretty-print.h"
-#include "gimplify.h"
+#include "gimple.h"
#include "gimple-iterator.h"
+#include "gimplify-me.h"
#include "gimple-walk.h"
#include "gimple-ssa.h"
#include "cgraph.h"
diff --git a/gcc/tree-cfgcleanup.c b/gcc/tree-cfgcleanup.c
index fbda06ab745..e864eed94f8 100644
--- a/gcc/tree-cfgcleanup.c
+++ b/gcc/tree-cfgcleanup.c
@@ -29,6 +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-iterator.h"
#include "gimple-ssa.h"
diff --git a/gcc/tree-complex.c b/gcc/tree-complex.c
index 188bf1a9336..130674e673f 100644
--- a/gcc/tree-complex.c
+++ b/gcc/tree-complex.c
@@ -23,8 +23,10 @@ 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-iterator.h"
+#include "gimplify-me.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 dc630e2d114..81403f25aa0 100644
--- a/gcc/tree-if-conv.c
+++ b/gcc/tree-if-conv.c
@@ -88,8 +88,10 @@ 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-iterator.h"
+#include "gimplify-me.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 fe5c0cb7367..fb9d2c41eb3 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -34,8 +34,10 @@ 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-iterator.h"
+#include "gimplify-me.h"
#include "gimple-walk.h"
#include "gimple-ssa.h"
#include "tree-cfg.h"
diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c
index 75d069bbbf3..331af04b5fe 100644
--- a/gcc/tree-loop-distribution.c
+++ b/gcc/tree-loop-distribution.c
@@ -45,8 +45,9 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tree.h"
-#include "gimplify.h"
+#include "gimple.h"
#include "gimple-iterator.h"
+#include "gimplify-me.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 f6baf00042d..9b4493bade0 100644
--- a/gcc/tree-nested.c
+++ b/gcc/tree-nested.c
@@ -26,6 +26,7 @@
#include "function.h"
#include "tree-dump.h"
#include "tree-inline.h"
+#include "gimple.h"
#include "gimplify.h"
#include "gimple-iterator.h"
#include "gimple-walk.h"
diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c
index 3a478f916b0..867992b6bb9 100644
--- a/gcc/tree-parloops.c
+++ b/gcc/tree-parloops.c
@@ -23,8 +23,10 @@ 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-iterator.h"
+#include "gimplify-me.h"
#include "gimple-walk.h"
#include "gimple-ssa.h"
#include "tree-cfg.h"
diff --git a/gcc/tree-predcom.c b/gcc/tree-predcom.c
index e08e9b6c697..77a15ab5523 100644
--- a/gcc/tree-predcom.c
+++ b/gcc/tree-predcom.c
@@ -191,8 +191,10 @@ 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-iterator.h"
+#include "gimplify-me.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 428ffc7c464..f3f97b2e0dc 100644
--- a/gcc/tree-profile.c
+++ b/gcc/tree-profile.c
@@ -34,8 +34,10 @@ 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-iterator.h"
+#include "gimplify-me.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 ffc6d3d09c4..115683de833 100644
--- a/gcc/tree-scalar-evolution.c
+++ b/gcc/tree-scalar-evolution.c
@@ -259,8 +259,10 @@ 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-iterator.h"
+#include "gimplify-me.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 31fcdfeee3f..d97af132d39 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -78,8 +78,10 @@ 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 "gimple-iterator.h"
+#include "gimplify-me.h"
#include "gimple-walk.h"
#include "bitmap.h"
#include "gimple-ssa.h"
diff --git a/gcc/tree-ssa-address.c b/gcc/tree-ssa-address.c
index 3984e79ce12..cf245675796 100644
--- a/gcc/tree-ssa-address.c
+++ b/gcc/tree-ssa-address.c
@@ -28,7 +28,9 @@ along with GCC; see the file COPYING3. If not see
#include "tm_p.h"
#include "basic-block.h"
#include "tree-pretty-print.h"
-#include "gimplify.h"
+#include "gimple.h"
+#include "gimple-iterator.h"
+#include "gimplify-me.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 c98c742d8b3..50006abdc05 100644
--- a/gcc/tree-ssa-ccp.c
+++ b/gcc/tree-ssa-ccp.c
@@ -119,6 +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-iterator.h"
#include "gimple-ssa.h"
diff --git a/gcc/tree-ssa-dce.c b/gcc/tree-ssa-dce.c
index 5da2106b7e7..d138f92f195 100644
--- a/gcc/tree-ssa-dce.c
+++ b/gcc/tree-ssa-dce.c
@@ -50,6 +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-iterator.h"
#include "gimple-ssa.h"
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index 71c56a050ac..ce9c0114f82 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -25,8 +25,10 @@ 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-iterator.h"
+#include "gimplify-me.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 3fbaba7920b..d3bb5b246cd 100644
--- a/gcc/tree-ssa-ifcombine.c
+++ b/gcc/tree-ssa-ifcombine.c
@@ -29,8 +29,9 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "basic-block.h"
#include "tree-pretty-print.h"
-#include "gimplify.h"
+#include "gimple.h"
#include "gimple-iterator.h"
+#include "gimplify-me.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 48697c7fa24..ad34d76e840 100644
--- a/gcc/tree-ssa-loop-im.c
+++ b/gcc/tree-ssa-loop-im.c
@@ -25,8 +25,10 @@ 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-iterator.h"
+#include "gimplify-me.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 4eb615f1296..6d5eeb5de99 100644
--- a/gcc/tree-ssa-loop-ivopts.c
+++ b/gcc/tree-ssa-loop-ivopts.c
@@ -69,8 +69,10 @@ 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-iterator.h"
+#include "gimplify-me.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 66c51280152..ae51ee66f07 100644
--- a/gcc/tree-ssa-loop-manip.c
+++ b/gcc/tree-ssa-loop-manip.c
@@ -24,8 +24,10 @@ 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-iterator.h"
+#include "gimplify-me.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 79e7eff98b2..547185694fb 100644
--- a/gcc/tree-ssa-loop-niter.c
+++ b/gcc/tree-ssa-loop-niter.c
@@ -26,6 +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-iterator.h"
#include "gimple-ssa.h"
diff --git a/gcc/tree-ssa-loop-prefetch.c b/gcc/tree-ssa-loop-prefetch.c
index edb49dbde88..0939541746e 100644
--- a/gcc/tree-ssa-loop-prefetch.c
+++ b/gcc/tree-ssa-loop-prefetch.c
@@ -25,8 +25,10 @@ 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-iterator.h"
+#include "gimplify-me.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 a345a4c6fe3..236b89b8a12 100644
--- a/gcc/tree-ssa-loop-unswitch.c
+++ b/gcc/tree-ssa-loop-unswitch.c
@@ -24,6 +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"
diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c
index cd654d2502e..ca3596c8a0e 100644
--- a/gcc/tree-ssa-math-opts.c
+++ b/gcc/tree-ssa-math-opts.c
@@ -90,8 +90,9 @@ along with GCC; see the file COPYING3. If not see
#include "tm.h"
#include "flags.h"
#include "tree.h"
-#include "gimplify.h"
+#include "gimple.h"
#include "gimple-iterator.h"
+#include "gimplify-me.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 caa4925cfb5..7f4a3fddb80 100644
--- a/gcc/tree-ssa-phiopt.c
+++ b/gcc/tree-ssa-phiopt.c
@@ -27,8 +27,10 @@ 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-iterator.h"
+#include "gimplify-me.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 904d0a432ce..070b8ed3f0b 100644
--- a/gcc/tree-ssa-phiprop.c
+++ b/gcc/tree-ssa-phiprop.c
@@ -26,6 +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-iterator.h"
#include "gimple-ssa.h"
diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c
index 5b075077d3e..7052d94e49a 100644
--- a/gcc/tree-ssa-pre.c
+++ b/gcc/tree-ssa-pre.c
@@ -27,8 +27,10 @@ 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-iterator.h"
+#include "gimplify-me.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 b10544836ff..078b04afdbc 100644
--- a/gcc/tree-ssa-propagate.c
+++ b/gcc/tree-ssa-propagate.c
@@ -30,6 +30,7 @@
#include "gimple-pretty-print.h"
#include "dumpfile.h"
#include "sbitmap.h"
+#include "gimple.h"
#include "gimplify.h"
#include "gimple-iterator.h"
#include "gimple-ssa.h"
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c
index d55c943324b..4d0e5e4aa47 100644
--- a/gcc/tree-ssa-reassoc.c
+++ b/gcc/tree-ssa-reassoc.c
@@ -29,8 +29,9 @@ along with GCC; see the file COPYING3. If not see
#include "basic-block.h"
#include "gimple-pretty-print.h"
#include "tree-inline.h"
-#include "gimplify.h"
+#include "gimple.h"
#include "gimple-iterator.h"
+#include "gimplify-me.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 36ef0184e77..1be324e8d5d 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -26,6 +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"
diff --git a/gcc/tree-ssa-strlen.c b/gcc/tree-ssa-strlen.c
index 565def76ca1..cfd7b00c6a8 100644
--- a/gcc/tree-ssa-strlen.c
+++ b/gcc/tree-ssa-strlen.c
@@ -24,8 +24,10 @@ 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-iterator.h"
+#include "gimplify-me.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 c774198e9ab..f16e77b53f5 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -31,6 +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-iterator.h"
#include "gimple-walk.h"
diff --git a/gcc/tree-switch-conversion.c b/gcc/tree-switch-conversion.c
index e7ffd434888..9d5734a5453 100644
--- a/gcc/tree-switch-conversion.c
+++ b/gcc/tree-switch-conversion.c
@@ -31,8 +31,10 @@ 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-iterator.h"
+#include "gimplify-me.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 eded4b690ef..185bf165149 100644
--- a/gcc/tree-tailcall.c
+++ b/gcc/tree-tailcall.c
@@ -25,8 +25,9 @@ along with GCC; see the file COPYING3. If not see
#include "tm_p.h"
#include "basic-block.h"
#include "function.h"
-#include "gimplify.h"
+#include "gimple.h"
#include "gimple-iterator.h"
+#include "gimplify-me.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 7164684c506..1e5ee3dd07b 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -30,8 +30,10 @@ 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-iterator.h"
+#include "gimplify-me.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 a82ecb2cd81..0fcc4ea94a2 100644
--- a/gcc/tree-vect-generic.c
+++ b/gcc/tree-vect-generic.c
@@ -23,8 +23,9 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "tm.h"
#include "langhooks.h"
-#include "gimplify.h"
+#include "gimple.h"
#include "gimple-iterator.h"
+#include "gimplify-me.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 01414ecae91..46e9df5da0d 100644
--- a/gcc/tree-vect-loop-manip.c
+++ b/gcc/tree-vect-loop-manip.c
@@ -28,8 +28,10 @@ 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-iterator.h"
+#include "gimplify-me.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 8dd3c430b47..491d8c6a3db 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -28,8 +28,10 @@ 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-iterator.h"
+#include "gimplify-me.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 8cca6c67fc3..11f7beed3a0 100644
--- a/gcc/tree-vect-patterns.c
+++ b/gcc/tree-vect-patterns.c
@@ -27,6 +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-iterator.h"
#include "gimple-ssa.h"
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index 9dfa7bdd88b..54d821af9c0 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -29,8 +29,10 @@ 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-iterator.h"
+#include "gimplify-me.h"
#include "gimple-ssa.h"
#include "tree-cfg.h"
#include "tree-phinodes.h"
diff --git a/gcc/tree.c b/gcc/tree.c
index c4484536e82..97c9c8ac37d 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -50,6 +50,7 @@ along with GCC; see the file COPYING3. If not see
#include "bitmap.h"
#include "gimple.h"
#include "gimple-iterator.h"
+#include "gimplify.h"
#include "gimple-ssa.h"
#include "cgraph.h"
#include "tree-phinodes.h"
diff --git a/gcc/tsan.c b/gcc/tsan.c
index 0de971319ad..544d535f0cf 100644
--- a/gcc/tsan.c
+++ b/gcc/tsan.c
@@ -26,6 +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 "gimple-iterator.h"
#include "function.h"
diff --git a/gcc/value-prof.c b/gcc/value-prof.c
index 6f822f65bd1..719cf9a59f0 100644
--- a/gcc/value-prof.c
+++ b/gcc/value-prof.c
@@ -33,6 +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-iterator.h"
#include "gimple-ssa.h"