@@ -29,13 +29,13 @@ along with GCC; see the file COPYING3. If not see
#include "ggc.h"
#include "basic-block.h"
#include "function.h"
+#include "gimple.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "tree-eh.h"
#include "gimple-expr.h"
#include "is-a.h"
#include "timevar.h"
-#include "gimple.h"
-#include "gimple-iterator.h"
#include "gimple-pretty-print.h"
#include "tree-pretty-print.h"
#include "graphviz.h"
@@ -67,13 +67,13 @@ along with GCC; see the file COPYING3. If not see
#include "asan.h"
#include "internal-fn.h"
#include "case-cfn-macros.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "intl.h"
#include "file-prefix-map.h" /* remap_macro_filename() */
#include "gomp-constants.h"
#include "omp-general.h"
#include "tree-dfa.h"
-#include "gimple-iterator.h"
#include "gimple-ssa.h"
#include "tree-ssa-live.h"
#include "tree-outof-ssa.h"
@@ -36,7 +36,6 @@ along with GCC; see the file COPYING3. If not see
#include "gimplify.h"
#include "langhooks.h"
#include "bitmap.h"
-#include "gimple-fold.h"
/* Complete a #pragma oacc wait construct. LOC is the location of
@@ -55,6 +55,7 @@ along with GCC; see the file COPYING3. If not see
#include "hash-traits.h"
#include "attribs.h"
#include "builtins.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "attr-fnspec.h"
#include "value-query.h"
@@ -26,8 +26,8 @@ along with GCC; see the file COPYING3. If not see
#include "gimple.h"
#include "tree-pass.h"
#include "cgraph.h"
-#include "gimple-fold.h"
#include "gimple-iterator.h"
+#include "gimple-fold.h"
#include "gimple-walk.h"
#include "ipa-utils.h"
#include "except.h"
@@ -179,9 +179,9 @@ along with GCC; see the file COPYING3. If not see
#include "stor-layout.h"
#include "output.h"
#include "cfgcleanup.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "gimplify.h"
-#include "gimple-iterator.h"
#include "gimplify-me.h"
#include "tree-cfg.h"
#include "tree-into-ssa.h"
@@ -45,8 +45,8 @@
#include "expr.h"
#include "langhooks.h"
#include "gimplify.h"
-#include "gimple-fold.h"
#include "gimple-iterator.h"
+#include "gimple-fold.h"
#include "ssa.h"
#include "tree-ssa-propagate.h"
#include "builtins.h"
@@ -55,8 +55,8 @@
#include "common/common-target.h"
#include "langhooks.h"
#include "gimplify.h"
-#include "gimple-fold.h"
#include "gimple-iterator.h"
+#include "gimple-fold.h"
#include "ssa.h"
#include "tree-ssa-propagate.h"
#include "builtins.h"
@@ -58,8 +58,8 @@
#include "reload.h"
#include "sched-int.h"
#include "gimplify.h"
-#include "gimple-fold.h"
#include "gimple-iterator.h"
+#include "gimple-fold.h"
#include "gimple-walk.h"
#include "ssa.h"
#include "tree-vectorizer.h"
@@ -70,6 +70,7 @@ along with GCC; see the file COPYING3. If not see
#include "debug.h"
#include "langhooks.h"
#include "internal-fn.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "tree-eh.h"
#include "gimplify.h"
@@ -31,7 +31,6 @@ along with GCC; see the file COPYING3. If not see
#include "builtins.h"
#include "tree-inline.h"
#include "ubsan.h"
-#include "gimple-fold.h"
#include "timevar.h"
#include "fold-const-call.h"
#include "stor-layout.h"
@@ -60,6 +60,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-ssa-address.h"
#include "builtins.h"
#include "ccmp.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "rtx-vector-builder.h"
#include "tree-pretty-print.h"
@@ -70,6 +70,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-dfa.h"
#include "builtins.h"
#include "generic-match.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "tree-into-ssa.h"
#include "md5.h"
@@ -245,6 +245,11 @@ extern tree fold_build_pointer_plus_hwi_loc (location_t loc, tree ptr, HOST_WIDE
#define fold_build_pointer_plus_hwi(p,o) \
fold_build_pointer_plus_hwi_loc (UNKNOWN_LOCATION, p, o)
+/* In gimple-fold.cc. */
+extern void clear_type_padding_in_mask (tree, unsigned char *);
+extern bool clear_padding_type_may_have_padding_p (tree);
+extern bool arith_overflowed_p (enum tree_code, const_tree, const_tree,
+ const_tree);
/* Class used to compare gimple operands. */
@@ -47,6 +47,8 @@ along with GCC; see the file COPYING3. If not see
#include "basic-block.h"
#include "tree-ssa-alias.h"
#include "internal-fn.h"
+#include "gimple.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "gimple-expr.h"
#include "toplev.h"
@@ -67,7 +69,6 @@ along with GCC; see the file COPYING3. If not see
#include "internal-fn.h"
#include "gimple-expr.h"
#include "is-a.h"
-#include "gimple.h"
#include "tree-pass.h"
#include "context.h"
#include "hash-map.h"
@@ -1703,9 +1703,9 @@ open_base_files (void)
"alias.h", "insn-config.h", "flags.h", "expmed.h", "dojump.h",
"explow.h", "calls.h", "memmodel.h", "emit-rtl.h", "varasm.h",
"stmt.h", "expr.h", "alloc-pool.h", "cselib.h", "insn-addr.h",
- "optabs.h", "libfuncs.h", "debug.h", "internal-fn.h", "gimple-fold.h",
- "value-range.h",
- "tree-eh.h", "gimple-iterator.h", "gimple-ssa.h", "tree-cfg.h",
+ "optabs.h", "libfuncs.h", "debug.h", "internal-fn.h",
+ "gimple-iterator.h", "gimple-fold.h", "value-range.h",
+ "tree-eh.h", "gimple-ssa.h", "tree-cfg.h",
"tree-vrp.h", "tree-phinodes.h", "ssa-iterators.h", "stringpool.h",
"tree-ssanames.h", "tree-ssa-loop.h", "tree-ssa-loop-ivopts.h",
"tree-ssa-loop-manip.h", "tree-ssa-loop-niter.h", "tree-into-ssa.h",
@@ -37,9 +37,9 @@ along with GCC; see the file COPYING3. If not see
#include "expr.h"
#include "stor-layout.h"
#include "dumpfile.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "gimplify.h"
-#include "gimple-iterator.h"
#include "tree-into-ssa.h"
#include "tree-dfa.h"
#include "tree-object-size.h"
@@ -8669,14 +8669,23 @@ gimple_build_valueize (tree op)
/* Build the expression CODE OP0 of type TYPE with location LOC,
simplifying it first if possible. Returns the built
- expression value and appends statements possibly defining it
- to SEQ. */
+ expression value and inserts statements possibly defining it
+ before GSI if BEFORE is true or after GSI if false and advance
+ the iterator accordingly.
+ If gsi refers to a basic block simplifying is allowed to look
+ at all SSA defs while when it does not it is restricted to
+ SSA defs that are not associated with a basic block yet,
+ indicating they belong to the currently building sequence. */
tree
-gimple_build (gimple_seq *seq, location_t loc,
- enum tree_code code, tree type, tree op0)
+gimple_build (gimple_stmt_iterator *gsi,
+ bool before, gsi_iterator_update update,
+ location_t loc, enum tree_code code, tree type, tree op0)
{
- tree res = gimple_simplify (code, type, op0, seq, gimple_build_valueize);
+ gimple_seq seq = NULL;
+ tree res
+ = gimple_simplify (code, type, op0, &seq,
+ gsi->bb ? follow_all_ssa_edges : gimple_build_valueize);
if (!res)
{
res = create_tmp_reg_or_ssa_name (type);
@@ -8688,7 +8697,21 @@ gimple_build (gimple_seq *seq, location_t loc,
else
stmt = gimple_build_assign (res, code, op0);
gimple_set_location (stmt, loc);
- gimple_seq_add_stmt_without_update (seq, stmt);
+ gimple_seq_add_stmt_without_update (&seq, stmt);
+ }
+ if (before)
+ {
+ if (gsi->bb)
+ gsi_insert_seq_before (gsi, seq, update);
+ else
+ gsi_insert_seq_before_without_update (gsi, seq, update);
+ }
+ else
+ {
+ if (gsi->bb)
+ gsi_insert_seq_after (gsi, seq, update);
+ else
+ gsi_insert_seq_after_without_update (gsi, seq, update);
}
return res;
}
@@ -8699,16 +8722,35 @@ gimple_build (gimple_seq *seq, location_t loc,
to SEQ. */
tree
-gimple_build (gimple_seq *seq, location_t loc,
- enum tree_code code, tree type, tree op0, tree op1)
+gimple_build (gimple_stmt_iterator *gsi,
+ bool before, gsi_iterator_update update,
+ location_t loc, enum tree_code code, tree type,
+ tree op0, tree op1)
{
- tree res = gimple_simplify (code, type, op0, op1, seq, gimple_build_valueize);
+ gimple_seq seq = NULL;
+ tree res
+ = gimple_simplify (code, type, op0, op1, &seq,
+ gsi->bb ? follow_all_ssa_edges : gimple_build_valueize);
if (!res)
{
res = create_tmp_reg_or_ssa_name (type);
gimple *stmt = gimple_build_assign (res, code, op0, op1);
gimple_set_location (stmt, loc);
- gimple_seq_add_stmt_without_update (seq, stmt);
+ gimple_seq_add_stmt_without_update (&seq, stmt);
+ }
+ if (before)
+ {
+ if (gsi->bb)
+ gsi_insert_seq_before (gsi, seq, update);
+ else
+ gsi_insert_seq_before_without_update (gsi, seq, update);
+ }
+ else
+ {
+ if (gsi->bb)
+ gsi_insert_seq_after (gsi, seq, update);
+ else
+ gsi_insert_seq_after_without_update (gsi, seq, update);
}
return res;
}
@@ -8719,11 +8761,16 @@ gimple_build (gimple_seq *seq, location_t loc,
to SEQ. */
tree
-gimple_build (gimple_seq *seq, location_t loc,
- enum tree_code code, tree type, tree op0, tree op1, tree op2)
+gimple_build (gimple_stmt_iterator *gsi,
+ bool before, gsi_iterator_update update,
+ location_t loc, enum tree_code code, tree type,
+ tree op0, tree op1, tree op2)
{
- tree res = gimple_simplify (code, type, op0, op1, op2,
- seq, gimple_build_valueize);
+
+ gimple_seq seq = NULL;
+ tree res
+ = gimple_simplify (code, type, op0, op1, op2, &seq,
+ gsi->bb ? follow_all_ssa_edges : gimple_build_valueize);
if (!res)
{
res = create_tmp_reg_or_ssa_name (type);
@@ -8734,7 +8781,21 @@ gimple_build (gimple_seq *seq, location_t loc,
else
stmt = gimple_build_assign (res, code, op0, op1, op2);
gimple_set_location (stmt, loc);
- gimple_seq_add_stmt_without_update (seq, stmt);
+ gimple_seq_add_stmt_without_update (&seq, stmt);
+ }
+ if (before)
+ {
+ if (gsi->bb)
+ gsi_insert_seq_before (gsi, seq, update);
+ else
+ gsi_insert_seq_before_without_update (gsi, seq, update);
+ }
+ else
+ {
+ if (gsi->bb)
+ gsi_insert_seq_after (gsi, seq, update);
+ else
+ gsi_insert_seq_after_without_update (gsi, seq, update);
}
return res;
}
@@ -38,12 +38,8 @@ extern tree maybe_fold_and_comparisons (tree, enum tree_code, tree, tree,
extern tree maybe_fold_or_comparisons (tree, enum tree_code, tree, tree,
enum tree_code, tree, tree,
basic_block = nullptr);
-extern bool clear_padding_type_may_have_padding_p (tree);
-extern void clear_type_padding_in_mask (tree, unsigned char *);
extern bool optimize_atomic_compare_exchange_p (gimple *);
extern void fold_builtin_atomic_compare_exchange (gimple_stmt_iterator *);
-extern bool arith_overflowed_p (enum tree_code, const_tree, const_tree,
- const_tree);
extern tree no_follow_ssa_edges (tree);
extern tree follow_single_use_edges (tree);
extern tree follow_all_ssa_edges (tree);
@@ -71,19 +67,35 @@ extern tree tree_vec_extract (gimple_stmt_iterator *, tree, tree, tree, tree);
/* gimple_build, functionally matching fold_buildN, outputs stmts
int the provided sequence, matching and simplifying them on-the-fly.
Supposed to replace force_gimple_operand (fold_buildN (...), ...). */
-extern tree gimple_build (gimple_seq *, location_t,
- enum tree_code, tree, tree);
-extern tree gimple_build (gimple_seq *, location_t,
- enum tree_code, tree, tree, tree);
-extern tree gimple_build (gimple_seq *, location_t,
- enum tree_code, tree, tree, tree, tree);
+extern tree gimple_build (gimple_stmt_iterator *, bool,
+ enum gsi_iterator_update,
+ location_t, enum tree_code, tree, tree);
+extern tree gimple_build (gimple_stmt_iterator *, bool,
+ enum gsi_iterator_update,
+ location_t, enum tree_code, tree, tree, tree);
+extern tree gimple_build (gimple_stmt_iterator *, bool,
+ enum gsi_iterator_update,
+ location_t, enum tree_code, tree, tree, tree, tree);
+template<class ...Args>
+inline tree
+gimple_build (gimple_seq *seq, location_t loc,
+ enum tree_code code, tree type, Args ...ops)
+{
+ static_assert (sizeof...(ops) > 0 && sizeof...(ops) <= 3,
+ "Number of operands must be from one to three");
+ gimple_stmt_iterator gsi = gsi_last (*seq);
+ return gimple_build (&gsi, false, GSI_CONTINUE_LINKING,
+ loc, code, type, ops...);
+}
template<class ...Args>
inline tree
gimple_build (gimple_seq *seq, enum tree_code code, tree type, Args ...ops)
{
static_assert (sizeof...(ops) > 0 && sizeof...(ops) <= 3,
"Number of operands must be from one to three");
- return gimple_build (seq, UNKNOWN_LOCATION, code, type, ops...);
+ gimple_stmt_iterator gsi = gsi_last (*seq);
+ return gimple_build (&gsi, false, GSI_CONTINUE_LINKING,
+ UNKNOWN_LOCATION, code, type, ops...);
}
extern tree gimple_build (gimple_seq *, location_t, combined_fn, tree);
@@ -31,6 +31,7 @@ along with GCC; see the file COPYING3. If not see
#include "fold-const.h"
#include "fold-const-call.h"
#include "stor-layout.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "calls.h"
#include "tree-dfa.h"
@@ -29,6 +29,7 @@ along with GCC; see the file COPYING3. If not see
#include "ssa.h"
#include "gimple-pretty-print.h"
#include "optabs-tree.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "wide-int.h"
#include "fold-const.h"
@@ -27,9 +27,9 @@ along with GCC; see the file COPYING3. If not see
#include "ssa.h"
#include "gimple-pretty-print.h"
#include "cfganal.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "tree-eh.h"
-#include "gimple-iterator.h"
#include "tree-cfg.h"
#include "tree-ssa-loop-manip.h"
#include "tree-ssa-loop.h"
@@ -27,9 +27,9 @@ along with GCC; see the file COPYING3. If not see
#include "ssa.h"
#include "gimple-pretty-print.h"
#include "cfganal.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "tree-eh.h"
-#include "gimple-iterator.h"
#include "tree-cfg.h"
#include "tree-ssa-loop-manip.h"
#include "tree-ssa-loop.h"
@@ -53,11 +53,11 @@ along with GCC; see the file COPYING3. If not see
#include "gimple.h"
#include "tree-pass.h"
#include "ssa.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "gimple-pretty-print.h"
#include "diagnostic-core.h"
#include "fold-const.h"
-#include "gimple-iterator.h"
#include "tree-ssa.h"
#include "tree-object-size.h"
#include "tree-cfg.h"
@@ -36,8 +36,8 @@
#include "gimple-ssa-warn-restrict.h"
#include "diagnostic-core.h"
#include "fold-const.h"
-#include "gimple-fold.h"
#include "gimple-iterator.h"
+#include "gimple-fold.h"
#include "langhooks.h"
#include "memmodel.h"
#include "target.h"
@@ -42,10 +42,10 @@ along with GCC; see the file COPYING3. If not see
#include "varasm.h"
#include "stmt.h"
#include "expr.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "tree-eh.h"
#include "gimplify.h"
-#include "gimple-iterator.h"
#include "stor-layout.h"
#include "print-tree.h"
#include "tree-iterator.h"
@@ -32,8 +32,8 @@ along with GCC; see the file COPYING3. If not see
#include "gimple.h"
#include "ssa.h"
#include "fold-const.h"
-#include "gimple-fold.h"
#include "gimple-iterator.h"
+#include "gimple-fold.h"
#include "gimplify.h"
#include "gimplify-me.h"
#include "tree-eh.h"
@@ -113,6 +113,7 @@ along with GCC; see the file COPYING3. If not see
#include "cgraph.h"
#include "diagnostic.h"
#include "fold-const.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "symbol-summary.h"
#include "tree-vrp.h"
@@ -120,6 +120,7 @@ along with GCC; see the file COPYING3. If not see
#include "print-tree.h"
#include "calls.h"
#include "ipa-utils.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "symbol-summary.h"
#include "tree-vrp.h"
@@ -31,13 +31,13 @@ along with GCC; see the file COPYING3. If not see
#include "cgraph.h"
#include "diagnostic.h"
#include "fold-const.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "tree-eh.h"
#include "calls.h"
#include "stor-layout.h"
#include "print-tree.h"
#include "gimplify.h"
-#include "gimple-iterator.h"
#include "gimplify-me.h"
#include "gimple-walk.h"
#include "symbol-summary.h"
@@ -37,9 +37,9 @@ along with GCC; see the file COPYING3. If not see
#include "fold-const.h"
#include "stor-layout.h"
#include "internal-fn.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "gimplify.h"
-#include "gimple-iterator.h"
#include "gimplify-me.h"
#include "gimple-walk.h"
#include "tree-iterator.h"
@@ -33,6 +33,7 @@
#include "langhooks.h"
#include "stringpool.h"
#include "attribs.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "gimple-ssa.h"
#include "intl.h"
@@ -38,9 +38,9 @@ along with GCC; see the file COPYING3. If not see
#include "stor-layout.h"
#include "calls.h"
#include "cfganal.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "tree-eh.h"
-#include "gimple-iterator.h"
#include "gimple-walk.h"
#include "tree-cfg.h"
#include "wide-int.h"
@@ -15,12 +15,12 @@
#include "basic-block.h"
#include "tree-ssa-alias.h"
#include "internal-fn.h"
+#include "gimple.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "tree-eh.h"
#include "gimple-expr.h"
#include "is-a.h"
-#include "gimple.h"
-#include "gimple-iterator.h"
#include "tree.h"
#include "tree-pass.h"
#include "intl.h"
@@ -17,12 +17,12 @@
#include "basic-block.h"
#include "tree-ssa-alias.h"
#include "internal-fn.h"
+#include "gimple.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "tree-eh.h"
#include "gimple-expr.h"
#include "is-a.h"
-#include "gimple.h"
-#include "gimple-iterator.h"
#include "tree.h"
#include "tree-pass.h"
#include "intl.h"
@@ -15,12 +15,12 @@
#include "basic-block.h"
#include "tree-ssa-alias.h"
#include "internal-fn.h"
+#include "gimple.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "tree-eh.h"
#include "gimple-expr.h"
#include "is-a.h"
-#include "gimple.h"
-#include "gimple-iterator.h"
#include "tree.h"
#include "tree-pass.h"
#include "intl.h"
@@ -15,12 +15,12 @@
#include "basic-block.h"
#include "tree-ssa-alias.h"
#include "internal-fn.h"
+#include "gimple.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "tree-eh.h"
#include "gimple-expr.h"
#include "is-a.h"
-#include "gimple.h"
-#include "gimple-iterator.h"
#include "tree.h"
#include "tree-pass.h"
#include "intl.h"
@@ -21,12 +21,12 @@
#include "basic-block.h"
#include "tree-ssa-alias.h"
#include "internal-fn.h"
+#include "gimple.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "tree-eh.h"
#include "gimple-expr.h"
#include "is-a.h"
-#include "gimple.h"
-#include "gimple-iterator.h"
#include "tree.h"
#include "tree-pass.h"
#include "intl.h"
@@ -47,12 +47,12 @@
#include "basic-block.h"
#include "tree-ssa-alias.h"
#include "internal-fn.h"
+#include "gimple.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "tree-eh.h"
#include "gimple-expr.h"
#include "is-a.h"
-#include "gimple.h"
-#include "gimple-iterator.h"
#include "tree.h"
#include "tree-pass.h"
#include "intl.h"
@@ -17,12 +17,12 @@
#include "basic-block.h"
#include "tree-ssa-alias.h"
#include "internal-fn.h"
+#include "gimple.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "tree-eh.h"
#include "gimple-expr.h"
#include "is-a.h"
-#include "gimple.h"
-#include "gimple-iterator.h"
#include "tree.h"
#include "tree-pass.h"
#include "intl.h"
@@ -17,12 +17,12 @@
#include "basic-block.h"
#include "tree-ssa-alias.h"
#include "internal-fn.h"
+#include "gimple.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "tree-eh.h"
#include "gimple-expr.h"
#include "is-a.h"
-#include "gimple.h"
-#include "gimple-iterator.h"
#include "tree.h"
#include "tree-pass.h"
#include "intl.h"
@@ -15,7 +15,6 @@
#include "basic-block.h"
#include "tree-ssa-alias.h"
#include "internal-fn.h"
-#include "gimple-fold.h"
#include "tree-eh.h"
#include "gimple-expr.h"
#include "is-a.h"
@@ -14,7 +14,6 @@
#include "ggc.h"
#include "tree-ssa-alias.h"
#include "internal-fn.h"
-#include "gimple-fold.h"
#include "tree-eh.h"
#include "gimple-expr.h"
#include "is-a.h"
@@ -17,7 +17,6 @@
#include "basic-block.h"
#include "tree-ssa-alias.h"
#include "internal-fn.h"
-#include "gimple-fold.h"
#include "tree-eh.h"
#include "gimple-expr.h"
#include "is-a.h"
@@ -12,7 +12,6 @@
#include "basic-block.h"
#include "tree-ssa-alias.h"
#include "internal-fn.h"
-#include "gimple-fold.h"
#include "tree-eh.h"
#include "gimple-expr.h"
#include "is-a.h"
@@ -17,12 +17,12 @@
#include "basic-block.h"
#include "tree-ssa-alias.h"
#include "internal-fn.h"
+#include "gimple.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "tree-eh.h"
#include "gimple-expr.h"
#include "is-a.h"
-#include "gimple.h"
-#include "gimple-iterator.h"
#include "tree.h"
#include "tree-pass.h"
#include "intl.h"
@@ -20,7 +20,6 @@
#include "basic-block.h"
#include "tree-ssa-alias.h"
#include "internal-fn.h"
-#include "gimple-fold.h"
#include "tree-eh.h"
#include "gimple-expr.h"
#include "is-a.h"
@@ -37,9 +37,9 @@ along with GCC; see the file COPYING3. If not see
#include "stor-layout.h"
#include "print-tree.h"
#include "cfganal.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "tree-eh.h"
-#include "gimple-iterator.h"
#include "gimplify-me.h"
#include "gimple-walk.h"
#include "tree-cfg.h"
@@ -96,9 +96,9 @@ along with GCC; see the file COPYING3. If not see
#include "alias.h"
#include "fold-const.h"
#include "stor-layout.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "gimplify.h"
-#include "gimple-iterator.h"
#include "gimplify-me.h"
#include "tree-cfg.h"
#include "tree-into-ssa.h"
@@ -41,10 +41,10 @@ along with GCC; see the file COPYING3. If not see
#include "cfganal.h"
#include "tree-iterator.h"
#include "intl.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "tree-eh.h"
#include "gimplify.h"
-#include "gimple-iterator.h"
#include "gimplify-me.h"
#include "gimple-walk.h"
#include "tree-cfg.h"
@@ -29,8 +29,8 @@ along with GCC; see the file COPYING3. If not see
#include "gimple-pretty-print.h"
#include "fold-const.h"
#include "tree-object-size.h"
-#include "gimple-fold.h"
#include "gimple-iterator.h"
+#include "gimple-fold.h"
#include "tree-cfg.h"
#include "tree-dfa.h"
#include "stringpool.h"
@@ -129,10 +129,10 @@ along with GCC; see the file COPYING3. If not see
#include "ssa.h"
#include "gimple-pretty-print.h"
#include "fold-const.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "tree-eh.h"
#include "gimplify.h"
-#include "gimple-iterator.h"
#include "tree-cfg.h"
#include "tree-ssa-propagate.h"
#include "dbgcnt.h"
@@ -30,10 +30,10 @@ along with GCC; see the file COPYING3. If not see
#include "fold-const.h"
#include "cfganal.h"
#include "cfgloop.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "tree-eh.h"
#include "tree-inline.h"
-#include "gimple-iterator.h"
#include "tree-cfg.h"
#include "tree-into-ssa.h"
#include "domwalk.h"
@@ -32,10 +32,10 @@ along with GCC; see the file COPYING3. If not see
#include "gimple-pretty-print.h"
#include "fold-const.h"
#include "stor-layout.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "tree-eh.h"
#include "gimplify.h"
-#include "gimple-iterator.h"
#include "gimplify-me.h"
#include "tree-cfg.h"
#include "expr.h"
@@ -35,8 +35,8 @@ along with GCC; see the file COPYING3. If not see
BRANCH_COST. */
#include "fold-const.h"
#include "cfganal.h"
-#include "gimple-fold.h"
#include "gimple-iterator.h"
+#include "gimple-fold.h"
#include "gimplify-me.h"
#include "tree-cfg.h"
#include "tree-ssa.h"
@@ -48,9 +48,9 @@ along with GCC; see the file COPYING3. If not see
#include "gimple-pretty-print.h"
#include "fold-const.h"
#include "profile.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "tree-eh.h"
-#include "gimple-iterator.h"
#include "tree-cfg.h"
#include "tree-ssa-loop-manip.h"
#include "tree-ssa-loop-niter.h"
@@ -100,8 +100,8 @@ along with GCC; see the file COPYING3. If not see
#include "gimple-pretty-print.h"
#include "alias.h"
#include "fold-const.h"
-#include "gimple-fold.h"
#include "gimple-iterator.h"
+#include "gimple-fold.h"
#include "gimplify.h"
#include "gimplify-me.h"
#include "stor-layout.h"
@@ -34,10 +34,10 @@ along with GCC; see the file COPYING3. If not see
#include "gimple-pretty-print.h"
#include "fold-const.h"
#include "cfganal.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "tree-eh.h"
#include "gimplify.h"
-#include "gimple-iterator.h"
#include "tree-cfg.h"
#include "tree-into-ssa.h"
#include "tree-dfa.h"
@@ -27,10 +27,10 @@
#include "ssa.h"
#include "gimple-pretty-print.h"
#include "dumpfile.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "tree-eh.h"
#include "gimplify.h"
-#include "gimple-iterator.h"
#include "tree-cfg.h"
#include "tree-ssa.h"
#include "tree-ssa-propagate.h"
@@ -38,9 +38,9 @@ along with GCC; see the file COPYING3. If not see
#include "fold-const.h"
#include "stor-layout.h"
#include "cfganal.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "tree-eh.h"
-#include "gimple-iterator.h"
#include "gimplify-me.h"
#include "tree-cfg.h"
#include "tree-ssa-loop.h"
@@ -39,6 +39,7 @@ along with GCC; see the file COPYING3. If not see
#include "cfganal.h"
#include "tree-inline.h"
#include "internal-fn.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "tree-eh.h"
#include "gimplify.h"
@@ -56,7 +57,6 @@ along with GCC; see the file COPYING3. If not see
#include "tree-ssa-propagate.h"
#include "tree-cfg.h"
#include "domwalk.h"
-#include "gimple-iterator.h"
#include "gimple-match.h"
#include "stringpool.h"
#include "attribs.h"
@@ -34,10 +34,10 @@ along with GCC; see the file COPYING3. If not see
#include "gimple-ssa-warn-restrict.h"
#include "fold-const.h"
#include "stor-layout.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "tree-eh.h"
#include "gimplify.h"
-#include "gimple-iterator.h"
#include "gimplify-me.h"
#include "expr.h"
#include "tree-cfg.h"
@@ -30,9 +30,9 @@ along with GCC; see the file COPYING3. If not see
#include "diagnostic-core.h"
#include "fold-const.h"
#include "stor-layout.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "gimplify.h"
-#include "gimple-iterator.h"
#include "gimple-walk.h"
#include "tree-ssa-loop-manip.h"
#include "tree-into-ssa.h"
@@ -54,10 +54,7 @@ gimplify_build3 (gimple_stmt_iterator *gsi, enum tree_code code,
tree type, tree a, tree b, tree c)
{
location_t loc = gimple_location (gsi_stmt (*gsi));
- gimple_seq stmts = NULL;
- tree ret = gimple_build (&stmts, loc, code, type, a, b, c);
- gsi_insert_seq_before (gsi, stmts, GSI_SAME_STMT);
- return ret;
+ return gimple_build (gsi, true, GSI_SAME_STMT, loc, code, type, a, b, c);
}
/* Build a binary operation and gimplify it. Emit code before GSI.
@@ -68,10 +65,7 @@ gimplify_build2 (gimple_stmt_iterator *gsi, enum tree_code code,
tree type, tree a, tree b)
{
location_t loc = gimple_location (gsi_stmt (*gsi));
- gimple_seq stmts = NULL;
- tree ret = gimple_build (&stmts, loc, code, type, a, b);
- gsi_insert_seq_before (gsi, stmts, GSI_SAME_STMT);
- return ret;
+ return gimple_build (gsi, true, GSI_SAME_STMT, loc, code, type, a, b);
}
/* Build a unary operation and gimplify it. Emit code before GSI.
@@ -82,10 +76,7 @@ gimplify_build1 (gimple_stmt_iterator *gsi, enum tree_code code, tree type,
tree a)
{
location_t loc = gimple_location (gsi_stmt (*gsi));
- gimple_seq stmts = NULL;
- tree ret = gimple_build (&stmts, loc, code, type, a);
- gsi_insert_seq_before (gsi, stmts, GSI_SAME_STMT);
- return ret;
+ return gimple_build (gsi, true, GSI_SAME_STMT, loc, code, type, a);
}
@@ -1184,12 +1184,9 @@ ubsan_expand_ptr_ifn (gimple_stmt_iterator *gsip)
gimple_set_location (g, loc);
gsi_insert_after (&gsi2, g, GSI_NEW_STMT);
- gimple_seq seq = NULL;
- tree t = gimple_build (&seq, loc, NOP_EXPR, ssizetype, off);
- t = gimple_build (&seq, loc, GE_EXPR, boolean_type_node,
- t, ssize_int (0));
- gsi_insert_seq_before (&gsi, seq, GSI_SAME_STMT);
- g = gimple_build_cond (NE_EXPR, t, boolean_false_node,
+ tree t = gimple_build (&gsi, true, GSI_SAME_STMT,
+ loc, NOP_EXPR, ssizetype, off);
+ g = gimple_build_cond (GE_EXPR, t, ssize_int (0),
NULL_TREE, NULL_TREE);
}
gimple_set_location (g, loc);
@@ -28,9 +28,9 @@ along with GCC; see the file COPYING3. If not see
#include "ssa.h"
#include "gimple-pretty-print.h"
#include "cfganal.h"
+#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "tree-eh.h"
-#include "gimple-iterator.h"
#include "tree-cfg.h"
#include "tree-ssa-loop-manip.h"
#include "tree-ssa-loop.h"
@@ -32,8 +32,8 @@ along with GCC; see the file COPYING3. If not see
#include "fold-const.h"
#include "calls.h"
#include "cfganal.h"
-#include "gimple-fold.h"
#include "gimple-iterator.h"
+#include "gimple-fold.h"
#include "tree-cfg.h"
#include "tree-ssa-loop-niter.h"
#include "tree-ssa-loop.h"