From 225ca0e9a4c37f4b0d259de2325a474c905bffd9 Mon Sep 17 00:00:00 2001
From: David Malcolm <dmalcolm@redhat.com>
Date: Thu, 13 Nov 2014 15:46:41 -0500
Subject: [PATCH] Add gimple-compat.h and port remaining gimple_assign
accessors
gcc/ChangeLog.gimple-classes:
* gimple-compat.h: New file.
* gimple.h (is_a_helper <const gassign *>::test): New.
(gimple_assign_rhs_could_trap_p): Strengthen param "s" from gimple
to gassign *s.
(gimple_assign_set_lhs): Likewise for param "gs".
(gimple_assign_set_rhs1): Likewise.
(gimple_assign_set_rhs2): Likewise.
(gimple_assign_set_rhs3): Likewise.
(gimple_assign_set_nontemporal_move): Likewise.
(gimple_assign_set_rhs_code): Likewise for param "s".
(gimple_assign_lhs): Strengthen param "gs" from const_gimple to
const gassign *.
(gimple_assign_lhs_ptr): Likewise.
(gimple_assign_rhs1): Likewise.
(gimple_assign_rhs1_ptr): Likewise.
(gimple_assign_rhs2): Likewise.
(gimple_assign_rhs2_ptr): Likewise.
(gimple_assign_rhs3): Likewise.
(gimple_assign_rhs3_ptr): Likewise.
(gimple_assign_rhs_code): Likewise.
(gimple_assign_rhs_class): Likewise.
(gimple_assign_single_p): Make typesafe.
(gimple_assign_load_p): Likewise.
(gimple_assign_cast_p): Likewise.
(gimple_clobber_p): Likewise.
(gimple_expr_type): Likewise, by introducing a const gassign *
"assign" within the GIMPLE_ASSIGN "else" clause. Replace a
gimple_get_lhs call with a gimple_assign_lhs.
* asan.c: Include gimple-compat.h.
(build_shadow_mem_access): Strengthen local "g" from gimple to
gassign *.
(maybe_create_ssa_name): Likewise.
(maybe_cast_to_ptrmode): Likewise.
(instrument_strlen_call): Likewise.
(maybe_instrument_assignment): Likewise for local "s".
* auto-profile.c: Include gimple-compat.h.
* cfgexpand.c: Likewise.
* expr.c: Likewise.
* gimple-builder.c: Likewise.
* gimple-fold.c: Likewise.
* gimple-match-head.c: Likewise.
* gimple-ssa-isolate-paths.c: Likewise.
* gimple-ssa-strength-reduction.c: Likewise.
* gimple-walk.c: Likewise. Remove redundant second include of
gimple-walk.h.
* gimple.c: Include gimple-compat.h.
(gimple_assign_rhs_could_trap_p): Strengthen param "s" from gimple
to gassign *s.
* gimplify-me.c: Include gimple-compat.h.
* graphite-sese-to-poly.c: Likewise.
* ipa-icf-gimple.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* ipa-polymorphic-call.c: Likewise.
* ipa-prop.c: Likewise.
* ipa-split.c: Likewise.
* omp-low.c: Likewise.
* predict.c: Likewise.
* sese.c: Likewise.
* trans-mem.c: Likewise.
(tm_log_emit_saves): Strengthen local "stmt" from gimple to
gassign *.
* tree-affine.c: Include gimple-compat.h.
* tree-call-cdce.c: Likewise.
* tree-complex.c: Likewise.
* tree-data-ref.c: Likewise.
* tree-eh.c: Likewise.
* tree-emutls.c (lower_emutls_1): Strengthen local "x" from gimple
to gassign *.
* tree-if-conv.c: Include gimple-compat.h.
* tree-inline.c: Likewise.
* tree-into-ssa.c: Likewise.
* tree-loop-distribution.c: Likewise.
* tree-nested.c: Likewise.
* tree-nrv.c: Likewise.
* tree-object-size.c: Likewise.
* tree-outof-ssa.c: Likewise.
* tree-parloops.c: Likewise.
* tree-predcom.c: Likewise.
* tree-scalar-evolution.c: Likewise.
(follow_ssa_edge_in_rhs): Strengthen param "stmt" from gimple to
gassign *.
(follow_ssa_edge): Add a checked cast to gassign * within
case GIMPLE_ASSIGN.
* tree-sra.c: Include gimple-compat.h.
* tree-ssa-alias.c: Likewise.
* tree-ssa-ccp.c: Likewise.
* tree-ssa-coalesce.c: Likewise.
* tree-ssa-copy.c: Likewise.
* tree-ssa-copyrename.c: Likewise.
* tree-ssa-dce.c: Likewise.
* tree-ssa-dom.c: Likewise.
* tree-ssa-dse.c: Likewise.
* tree-ssa-forwprop.c: Likewise.
* tree-ssa-ifcombine.c: Likewise.
* tree-ssa-live.c: Likewise.
* tree-ssa-loop-ch.c: Likewise.
* tree-ssa-loop-im.c: Likewise.
* tree-ssa-loop-ivcanon.c: Likewise.
* tree-ssa-loop-ivopts.c: Likewise.
* tree-ssa-loop-niter.c: Likewise.
* tree-ssa-loop-prefetch.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-sink.c: Likewise.
* tree-ssa-strlen.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* tree-ssa-tail-merge.c: Likewise.
* tree-ssa-ter.c: Likewise.
* tree-ssa-threadedge.c: Likewise.
* tree-ssa-uninit.c: Likewise.
* tree-ssa.c: Likewise.
* tree-stdarg.c: Likewise.
* tree-switch-conversion.c (struct switch_conv_info): Strengthen
fields "arr_ref_first" and "arr_ref_last" from gimple to
gassign *.
(build_one_array): Likewise for local "load".
(build_arrays): Likewise for local "stmt".
* tree-vect-data-refs.c: Include gimple-compat.h.
* tree-vect-generic.c: Likewise.
* tree-vect-loop.c: Likewise.
* tree-vect-patterns.c: Likewise.
* tree-vect-slp.c: Likewise.
* tree-vect-stmts.c: Likewise.
(vect_init_vector): Strengthen local "init_stmt" from gimple to
gassign *.
* tree-vrp.c: Include gimple-compat.h.
* tsan.c: Likewise.
* ubsan.c: Likewise.
* value-prof.c: Likewise.
* vtable-verify.c: Likewise.
---
gcc/ChangeLog.gimple-classes | 139 ++++++++++++++++++++++++++++++++++++
gcc/asan.c | 11 +--
gcc/auto-profile.c | 1 +
gcc/cfgexpand.c | 1 +
gcc/expr.c | 1 +
gcc/gimple-builder.c | 1 +
gcc/gimple-compat.h | 123 +++++++++++++++++++++++++++++++
gcc/gimple-fold.c | 1 +
gcc/gimple-match-head.c | 1 +
gcc/gimple-ssa-isolate-paths.c | 1 +
gcc/gimple-ssa-strength-reduction.c | 1 +
gcc/gimple-walk.c | 2 +-
gcc/gimple.c | 4 +-
gcc/gimple.h | 98 ++++++++++++-------------
gcc/gimplify-me.c | 1 +
gcc/graphite-sese-to-poly.c | 1 +
gcc/ipa-icf-gimple.c | 1 +
gcc/ipa-inline-analysis.c | 1 +
gcc/ipa-polymorphic-call.c | 1 +
gcc/ipa-prop.c | 1 +
gcc/ipa-split.c | 1 +
gcc/omp-low.c | 1 +
gcc/predict.c | 1 +
gcc/sese.c | 1 +
gcc/trans-mem.c | 3 +-
gcc/tree-affine.c | 1 +
gcc/tree-call-cdce.c | 2 +
gcc/tree-complex.c | 1 +
gcc/tree-data-ref.c | 1 +
gcc/tree-eh.c | 1 +
gcc/tree-emutls.c | 2 +-
gcc/tree-if-conv.c | 1 +
gcc/tree-inline.c | 1 +
gcc/tree-into-ssa.c | 1 +
gcc/tree-loop-distribution.c | 1 +
gcc/tree-nested.c | 1 +
gcc/tree-nrv.c | 1 +
gcc/tree-object-size.c | 1 +
gcc/tree-outof-ssa.c | 1 +
gcc/tree-parloops.c | 1 +
gcc/tree-predcom.c | 1 +
gcc/tree-scalar-evolution.c | 5 +-
gcc/tree-sra.c | 1 +
gcc/tree-ssa-alias.c | 1 +
gcc/tree-ssa-ccp.c | 1 +
gcc/tree-ssa-coalesce.c | 1 +
gcc/tree-ssa-copy.c | 1 +
gcc/tree-ssa-copyrename.c | 1 +
gcc/tree-ssa-dce.c | 1 +
gcc/tree-ssa-dom.c | 1 +
gcc/tree-ssa-dse.c | 1 +
gcc/tree-ssa-forwprop.c | 1 +
gcc/tree-ssa-ifcombine.c | 1 +
gcc/tree-ssa-live.c | 1 +
gcc/tree-ssa-loop-ch.c | 1 +
gcc/tree-ssa-loop-im.c | 1 +
gcc/tree-ssa-loop-ivcanon.c | 1 +
gcc/tree-ssa-loop-ivopts.c | 1 +
gcc/tree-ssa-loop-niter.c | 1 +
gcc/tree-ssa-loop-prefetch.c | 1 +
gcc/tree-ssa-math-opts.c | 1 +
gcc/tree-ssa-phiopt.c | 1 +
gcc/tree-ssa-phiprop.c | 1 +
gcc/tree-ssa-pre.c | 1 +
gcc/tree-ssa-propagate.c | 1 +
gcc/tree-ssa-reassoc.c | 1 +
gcc/tree-ssa-sccvn.c | 1 +
gcc/tree-ssa-sink.c | 1 +
gcc/tree-ssa-strlen.c | 1 +
gcc/tree-ssa-structalias.c | 1 +
gcc/tree-ssa-tail-merge.c | 1 +
gcc/tree-ssa-ter.c | 1 +
gcc/tree-ssa-threadedge.c | 1 +
gcc/tree-ssa-uninit.c | 1 +
gcc/tree-ssa.c | 1 +
gcc/tree-stdarg.c | 1 +
gcc/tree-switch-conversion.c | 8 +--
gcc/tree-vect-data-refs.c | 1 +
gcc/tree-vect-generic.c | 1 +
gcc/tree-vect-loop.c | 1 +
gcc/tree-vect-patterns.c | 1 +
gcc/tree-vect-slp.c | 1 +
gcc/tree-vect-stmts.c | 3 +-
gcc/tree-vrp.c | 1 +
gcc/tsan.c | 1 +
gcc/ubsan.c | 1 +
gcc/value-prof.c | 1 +
gcc/vtable-verify.c | 1 +
88 files changed, 406 insertions(+), 70 deletions(-)
create mode 100644 gcc/gimple-compat.h
@@ -1,3 +1,142 @@
+2014-11-13 David Malcolm <dmalcolm@redhat.com>
+
+ * gimple-compat.h: New file.
+ * gimple.h (is_a_helper <const gassign *>::test): New.
+ (gimple_assign_rhs_could_trap_p): Strengthen param "s" from gimple
+ to gassign *s.
+ (gimple_assign_set_lhs): Likewise for param "gs".
+ (gimple_assign_set_rhs1): Likewise.
+ (gimple_assign_set_rhs2): Likewise.
+ (gimple_assign_set_rhs3): Likewise.
+ (gimple_assign_set_nontemporal_move): Likewise.
+ (gimple_assign_set_rhs_code): Likewise for param "s".
+ (gimple_assign_lhs): Strengthen param "gs" from const_gimple to
+ const gassign *.
+ (gimple_assign_lhs_ptr): Likewise.
+ (gimple_assign_rhs1): Likewise.
+ (gimple_assign_rhs1_ptr): Likewise.
+ (gimple_assign_rhs2): Likewise.
+ (gimple_assign_rhs2_ptr): Likewise.
+ (gimple_assign_rhs3): Likewise.
+ (gimple_assign_rhs3_ptr): Likewise.
+ (gimple_assign_rhs_code): Likewise.
+ (gimple_assign_rhs_class): Likewise.
+ (gimple_assign_single_p): Make typesafe.
+ (gimple_assign_load_p): Likewise.
+ (gimple_assign_cast_p): Likewise.
+ (gimple_clobber_p): Likewise.
+ (gimple_expr_type): Likewise, by introducing a const gassign *
+ "assign" within the GIMPLE_ASSIGN "else" clause. Replace a
+ gimple_get_lhs call with a gimple_assign_lhs.
+
+ * asan.c: Include gimple-compat.h.
+ (build_shadow_mem_access): Strengthen local "g" from gimple to
+ gassign *.
+ (maybe_create_ssa_name): Likewise.
+ (maybe_cast_to_ptrmode): Likewise.
+ (instrument_strlen_call): Likewise.
+ (maybe_instrument_assignment): Likewise for local "s".
+ * auto-profile.c: Include gimple-compat.h.
+ * cfgexpand.c: Likewise.
+ * expr.c: Likewise.
+ * gimple-builder.c: Likewise.
+ * gimple-fold.c: Likewise.
+ * gimple-match-head.c: Likewise.
+ * gimple-ssa-isolate-paths.c: Likewise.
+ * gimple-ssa-strength-reduction.c: Likewise.
+ * gimple-walk.c: Likewise. Remove redundant second include of
+ gimple-walk.h.
+ * gimple.c: Include gimple-compat.h.
+ (gimple_assign_rhs_could_trap_p): Strengthen param "s" from gimple
+ to gassign *s.
+ * gimplify-me.c: Include gimple-compat.h.
+ * graphite-sese-to-poly.c: Likewise.
+ * ipa-icf-gimple.c: Likewise.
+ * ipa-inline-analysis.c: Likewise.
+ * ipa-polymorphic-call.c: Likewise.
+ * ipa-prop.c: Likewise.
+ * ipa-split.c: Likewise.
+ * omp-low.c: Likewise.
+ * predict.c: Likewise.
+ * sese.c: Likewise.
+ * trans-mem.c: Likewise.
+ (tm_log_emit_saves): Strengthen local "stmt" from gimple to
+ gassign *.
+ * tree-affine.c: Include gimple-compat.h.
+ * tree-call-cdce.c: Likewise.
+ * tree-complex.c: Likewise.
+ * tree-data-ref.c: Likewise.
+ * tree-eh.c: Likewise.
+ * tree-emutls.c (lower_emutls_1): Strengthen local "x" from gimple
+ to gassign *.
+ * tree-if-conv.c: Include gimple-compat.h.
+ * tree-inline.c: Likewise.
+ * tree-into-ssa.c: Likewise.
+ * tree-loop-distribution.c: Likewise.
+ * tree-nested.c: Likewise.
+ * tree-nrv.c: Likewise.
+ * tree-object-size.c: Likewise.
+ * tree-outof-ssa.c: Likewise.
+ * tree-parloops.c: Likewise.
+ * tree-predcom.c: Likewise.
+ * tree-scalar-evolution.c: Likewise.
+ (follow_ssa_edge_in_rhs): Strengthen param "stmt" from gimple to
+ gassign *.
+ (follow_ssa_edge): Add a checked cast to gassign * within
+ case GIMPLE_ASSIGN.
+ * tree-sra.c: Include gimple-compat.h.
+ * tree-ssa-alias.c: Likewise.
+ * tree-ssa-ccp.c: Likewise.
+ * tree-ssa-coalesce.c: Likewise.
+ * tree-ssa-copy.c: Likewise.
+ * tree-ssa-copyrename.c: Likewise.
+ * tree-ssa-dce.c: Likewise.
+ * tree-ssa-dom.c: Likewise.
+ * tree-ssa-dse.c: Likewise.
+ * tree-ssa-forwprop.c: Likewise.
+ * tree-ssa-ifcombine.c: Likewise.
+ * tree-ssa-live.c: Likewise.
+ * tree-ssa-loop-ch.c: Likewise.
+ * tree-ssa-loop-im.c: Likewise.
+ * tree-ssa-loop-ivcanon.c: Likewise.
+ * tree-ssa-loop-ivopts.c: Likewise.
+ * tree-ssa-loop-niter.c: Likewise.
+ * tree-ssa-loop-prefetch.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-sink.c: Likewise.
+ * tree-ssa-strlen.c: Likewise.
+ * tree-ssa-structalias.c: Likewise.
+ * tree-ssa-tail-merge.c: Likewise.
+ * tree-ssa-ter.c: Likewise.
+ * tree-ssa-threadedge.c: Likewise.
+ * tree-ssa-uninit.c: Likewise.
+ * tree-ssa.c: Likewise.
+ * tree-stdarg.c: Likewise.
+ * tree-switch-conversion.c (struct switch_conv_info): Strengthen
+ fields "arr_ref_first" and "arr_ref_last" from gimple to
+ gassign *.
+ (build_one_array): Likewise for local "load".
+ (build_arrays): Likewise for local "stmt".
+ * tree-vect-data-refs.c: Include gimple-compat.h.
+ * tree-vect-generic.c: Likewise.
+ * tree-vect-loop.c: Likewise.
+ * tree-vect-patterns.c: Likewise.
+ * tree-vect-slp.c: Likewise.
+ * tree-vect-stmts.c: Likewise.
+ (vect_init_vector): Strengthen local "init_stmt" from gimple to
+ gassign *.
+ * tree-vrp.c: Include gimple-compat.h.
+ * tsan.c: Likewise.
+ * ubsan.c: Likewise.
+ * value-prof.c: Likewise.
+ * vtable-verify.c: Likewise.
+
2014-10-28 David Malcolm <dmalcolm@redhat.com>
* auto-profile.c (autofdo::function_instance::find_icall_target_map):
@@ -67,6 +67,7 @@ along with GCC; see the file COPYING3. If not see
#include "ubsan.h"
#include "params.h"
#include "builtins.h"
+#include "gimple-compat.h"
/* AddressSanitizer finds out-of-bounds and use-after-free bugs
with <2x slowdown on average.
@@ -1523,7 +1524,7 @@ build_shadow_mem_access (gimple_stmt_iterator *gsi, location_t location,
{
tree t, uintptr_type = TREE_TYPE (base_addr);
tree shadow_type = TREE_TYPE (shadow_ptr_type);
- gimple g;
+ gassign *g;
t = build_int_cst (uintptr_type, ASAN_SHADOW_SHIFT);
g = gimple_build_assign_with_ops (RSHIFT_EXPR,
@@ -1564,7 +1565,7 @@ maybe_create_ssa_name (location_t loc, tree base, gimple_stmt_iterator *iter,
{
if (TREE_CODE (base) == SSA_NAME)
return base;
- gimple g
+ gassign *g
= gimple_build_assign_with_ops (TREE_CODE (base),
make_ssa_name (TREE_TYPE (base), NULL),
base, NULL_TREE);
@@ -1585,7 +1586,7 @@ maybe_cast_to_ptrmode (location_t loc, tree len, gimple_stmt_iterator *iter,
{
if (ptrofftype_p (len))
return len;
- gimple g
+ gassign *g
= gimple_build_assign_with_ops (NOP_EXPR,
make_ssa_name (pointer_sized_int_node, NULL),
len, NULL);
@@ -1854,7 +1855,7 @@ instrument_mem_region_access (tree base, tree len,
static bool
instrument_strlen_call (gimple_stmt_iterator *iter)
{
- gimple g;
+ gassign *g;
gcall *call = as_a <gcall *> (gsi_stmt (*iter));
gcc_assert (is_gimple_call (call));
@@ -1980,7 +1981,7 @@ instrument_builtin_call (gimple_stmt_iterator *iter)
static bool
maybe_instrument_assignment (gimple_stmt_iterator *iter)
{
- gimple s = gsi_stmt (*iter);
+ gassign *s = as_a <gassign *> (gsi_stmt (*iter));
gcc_assert (gimple_assign_single_p (s));
@@ -67,6 +67,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-inline.h"
#include "stringpool.h"
#include "auto-profile.h"
+#include "gimple-compat.h"
/* The following routines implements AutoFDO optimization.
@@ -85,6 +85,7 @@ along with GCC; see the file COPYING3. If not see
#include "recog.h"
#include "output.h"
#include "builtins.h"
+#include "gimple-compat.h"
/* Some systems use __main in a way incompatible with its use in gcc, in these
cases use the macros NAME__MAIN to give a quoted symbol and SYMBOL__MAIN to
@@ -75,6 +75,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-ssa-address.h"
#include "cfgexpand.h"
#include "builtins.h"
+#include "gimple-compat.h"
#ifndef STACK_PUSH_CODE
#ifdef STACK_GROWS_DOWNWARD
@@ -38,6 +38,7 @@ along with GCC; see the file COPYING3. If not see
#include "is-a.h"
#include "gimple.h"
#include "tree-ssanames.h"
+#include "gimple-compat.h"
/* Return the expression type to use based on the CODE and type of
new file mode 100644
@@ -0,0 +1,123 @@
+/* Compatibility for source files using gimple accessors with base class.
+
+ Copyright (C) 2014 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_GIMPLE_COMPAT_H
+#define GCC_GIMPLE_COMPAT_H
+
+/* Compatibility implementations of various gimple_assign_ accessors,
+ taking a gimple/const_gimple rather than a gassign *. */
+
+static inline tree
+gimple_assign_lhs (const_gimple gs)
+{
+ return gimple_assign_lhs (as_a <const gassign *> (gs));
+}
+
+static inline tree *
+gimple_assign_lhs_ptr (const_gimple gs)
+{
+ return gimple_assign_lhs_ptr (as_a <const gassign *> (gs));
+}
+
+static inline void
+gimple_assign_set_lhs (gimple gs, tree lhs)
+{
+ gimple_assign_set_lhs (as_a <gassign *> (gs), lhs);
+}
+
+static inline enum gimple_rhs_class
+gimple_assign_rhs_class (const_gimple gs)
+{
+ return gimple_assign_rhs_class (as_a <const gassign *> (gs));
+}
+
+static inline tree
+gimple_assign_rhs1 (const_gimple gs)
+{
+ return gimple_assign_rhs1 (as_a <const gassign *> (gs));
+}
+
+static inline tree *
+gimple_assign_rhs1_ptr (const_gimple gs)
+{
+ return gimple_assign_rhs1_ptr (as_a <const gassign *> (gs));
+}
+
+static inline void
+gimple_assign_set_rhs1 (gimple gs, tree rhs)
+{
+ gimple_assign_set_rhs1 (as_a <gassign *> (gs), rhs);
+}
+
+static inline tree
+gimple_assign_rhs2 (const_gimple gs)
+{
+ return gimple_assign_rhs2 (as_a <const gassign *> (gs));
+}
+
+static inline tree *
+gimple_assign_rhs2_ptr (const_gimple gs)
+{
+ return gimple_assign_rhs2_ptr (as_a <const gassign *> (gs));
+}
+
+static inline void
+gimple_assign_set_rhs2 (gimple gs, tree rhs)
+{
+ gimple_assign_set_rhs2 (as_a <gassign *> (gs), rhs);
+}
+
+static inline tree
+gimple_assign_rhs3 (const_gimple gs)
+{
+ return gimple_assign_rhs3 (as_a <const gassign *> (gs));
+}
+
+static inline void
+gimple_assign_set_rhs3 (gimple gs, tree rhs)
+{
+ gimple_assign_set_rhs3 (as_a <gassign *> (gs), rhs);
+}
+
+static inline void
+gimple_assign_set_nontemporal_move (gimple gs, bool nontemporal)
+{
+ gimple_assign_set_nontemporal_move (as_a <gassign *> (gs), nontemporal);
+}
+
+static inline enum tree_code
+gimple_assign_rhs_code (const_gimple gs)
+{
+ return gimple_assign_rhs_code (as_a <const gassign *> (gs));
+}
+
+static inline void
+gimple_assign_set_rhs_code (gimple s, enum tree_code code)
+{
+ gimple_assign_set_rhs_code (as_a <gassign *> (s), code);
+}
+
+static inline bool
+gimple_assign_rhs_could_trap_p (gimple gs)
+{
+ return gimple_assign_rhs_could_trap_p (as_a <gassign *> (gs));
+}
+
+#endif /* GCC_GIMPLE_COMPAT_H */
@@ -65,6 +65,7 @@ along with GCC; see the file COPYING3. If not see
#include "output.h"
#include "tree-eh.h"
#include "gimple-match.h"
+#include "gimple-compat.h"
/* Return true when DECL can be referenced from current unit.
FROM_DECL (if non-null) specify constructor of variable DECL was taken from.
@@ -50,6 +50,7 @@ along with GCC; see the file COPYING3. If not see
#include "ssa-iterators.h"
#include "dumpfile.h"
#include "gimple-match.h"
+#include "gimple-compat.h"
/* Forward declarations of the private auto-generated matchers.
@@ -55,6 +55,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-cfg.h"
#include "diagnostic-core.h"
#include "intl.h"
+#include "gimple-compat.h"
static bool cfg_altered;
@@ -76,6 +76,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-affine.h"
#include "wide-int-print.h"
#include "builtins.h"
+#include "gimple-compat.h"
/* Information about a strength reduction candidate. Each statement
in the candidate table represents an expression of one of the
@@ -41,8 +41,8 @@ along with GCC; see the file COPYING3. If not see
#include "gimple.h"
#include "gimple-iterator.h"
#include "gimple-walk.h"
-#include "gimple-walk.h"
#include "demangle.h"
+#include "gimple-compat.h"
/* Walk all the statements in the sequence *PSEQ calling walk_gimple_stmt
on each one. WI is as in walk_gimple_stmt.
@@ -58,6 +58,7 @@ along with GCC; see the file COPYING3. If not see
#include "bitmap.h"
#include "stringpool.h"
#include "tree-ssanames.h"
+#include "gimple-compat.h"
/* All the tuples have their operand vector (if present) at the very bottom
@@ -1947,9 +1948,8 @@ gimple_could_trap_p (gimple s)
/* Return true if RHS of a GIMPLE_ASSIGN S can trap. */
bool
-gimple_assign_rhs_could_trap_p (gimple s)
+gimple_assign_rhs_could_trap_p (gassign *s)
{
- gcc_assert (is_gimple_assign (s));
return gimple_could_trap_p_1 (s, true, false);
}
@@ -1110,6 +1110,14 @@ is_a_helper <const gasm *>::test (const_gimple gs)
template <>
template <>
inline bool
+is_a_helper <const gassign *>::test (const_gimple gs)
+{
+ return gs->code == GIMPLE_ASSIGN;
+}
+
+template <>
+template <>
+inline bool
is_a_helper <const gbind *>::test (const_gimple gs)
{
return gs->code == GIMPLE_BIND;
@@ -1376,7 +1384,7 @@ gimple gimple_copy (gimple);
bool gimple_has_side_effects (const_gimple);
bool gimple_could_trap_p_1 (gimple, bool, bool);
bool gimple_could_trap_p (gimple);
-bool gimple_assign_rhs_could_trap_p (gimple);
+bool gimple_assign_rhs_could_trap_p (gassign *);
extern void dump_gimple_statistics (void);
unsigned get_gimple_rhs_num_ops (enum tree_code);
extern tree canonicalize_cond_expr_cond (tree);
@@ -2270,9 +2278,8 @@ get_gimple_rhs_class (enum tree_code code)
/* Return the LHS of assignment statement GS. */
static inline tree
-gimple_assign_lhs (const_gimple gs)
+gimple_assign_lhs (const gassign *gs)
{
- GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
return gimple_op (gs, 0);
}
@@ -2280,9 +2287,8 @@ gimple_assign_lhs (const_gimple gs)
/* Return a pointer to the LHS of assignment statement GS. */
static inline tree *
-gimple_assign_lhs_ptr (const_gimple gs)
+gimple_assign_lhs_ptr (const gassign *gs)
{
- GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
return gimple_op_ptr (gs, 0);
}
@@ -2290,9 +2296,8 @@ gimple_assign_lhs_ptr (const_gimple gs)
/* Set LHS to be the LHS operand of assignment statement GS. */
static inline void
-gimple_assign_set_lhs (gimple gs, tree lhs)
+gimple_assign_set_lhs (gassign *gs, tree lhs)
{
- GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
gimple_set_op (gs, 0, lhs);
if (lhs && TREE_CODE (lhs) == SSA_NAME)
@@ -2303,9 +2308,8 @@ gimple_assign_set_lhs (gimple gs, tree lhs)
/* Return the first operand on the RHS of assignment statement GS. */
static inline tree
-gimple_assign_rhs1 (const_gimple gs)
+gimple_assign_rhs1 (const gassign *gs)
{
- GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
return gimple_op (gs, 1);
}
@@ -2314,19 +2318,16 @@ gimple_assign_rhs1 (const_gimple gs)
statement GS. */
static inline tree *
-gimple_assign_rhs1_ptr (const_gimple gs)
+gimple_assign_rhs1_ptr (const gassign *gs)
{
- GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
return gimple_op_ptr (gs, 1);
}
/* Set RHS to be the first operand on the RHS of assignment statement GS. */
static inline void
-gimple_assign_set_rhs1 (gimple gs, tree rhs)
+gimple_assign_set_rhs1 (gassign *gs, tree rhs)
{
- GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
-
gimple_set_op (gs, 1, rhs);
}
@@ -2335,10 +2336,8 @@ gimple_assign_set_rhs1 (gimple gs, tree rhs)
If GS does not have two operands, NULL is returned instead. */
static inline tree
-gimple_assign_rhs2 (const_gimple gs)
+gimple_assign_rhs2 (const gassign *gs)
{
- GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
-
if (gimple_num_ops (gs) >= 3)
return gimple_op (gs, 2);
else
@@ -2350,9 +2349,8 @@ gimple_assign_rhs2 (const_gimple gs)
statement GS. */
static inline tree *
-gimple_assign_rhs2_ptr (const_gimple gs)
+gimple_assign_rhs2_ptr (const gassign *gs)
{
- GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
return gimple_op_ptr (gs, 2);
}
@@ -2360,10 +2358,8 @@ gimple_assign_rhs2_ptr (const_gimple gs)
/* Set RHS to be the second operand on the RHS of assignment statement GS. */
static inline void
-gimple_assign_set_rhs2 (gimple gs, tree rhs)
+gimple_assign_set_rhs2 (gassign *gs, tree rhs)
{
- GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
-
gimple_set_op (gs, 2, rhs);
}
@@ -2371,10 +2367,8 @@ gimple_assign_set_rhs2 (gimple gs, tree rhs)
If GS does not have two operands, NULL is returned instead. */
static inline tree
-gimple_assign_rhs3 (const_gimple gs)
+gimple_assign_rhs3 (const gassign *gs)
{
- GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
-
if (gimple_num_ops (gs) >= 4)
return gimple_op (gs, 3);
else
@@ -2385,9 +2379,8 @@ gimple_assign_rhs3 (const_gimple gs)
statement GS. */
static inline tree *
-gimple_assign_rhs3_ptr (const_gimple gs)
+gimple_assign_rhs3_ptr (const gassign *gs)
{
- GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
return gimple_op_ptr (gs, 3);
}
@@ -2395,10 +2388,8 @@ gimple_assign_rhs3_ptr (const_gimple gs)
/* Set RHS to be the third operand on the RHS of assignment statement GS. */
static inline void
-gimple_assign_set_rhs3 (gimple gs, tree rhs)
+gimple_assign_set_rhs3 (gassign *gs, tree rhs)
{
- GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
-
gimple_set_op (gs, 3, rhs);
}
@@ -2423,9 +2414,8 @@ gimple_assign_nontemporal_move_p (const gassign *gs)
/* Sets nontemporal move flag of GS to NONTEMPORAL. */
static inline void
-gimple_assign_set_nontemporal_move (gimple gs, bool nontemporal)
+gimple_assign_set_nontemporal_move (gassign *gs, bool nontemporal)
{
- GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
gs->nontemporal_move = nontemporal;
}
@@ -2435,10 +2425,9 @@ gimple_assign_set_nontemporal_move (gimple gs, bool nontemporal)
tree code of the object. */
static inline enum tree_code
-gimple_assign_rhs_code (const_gimple gs)
+gimple_assign_rhs_code (const gassign *gs)
{
enum tree_code code;
- GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
code = (enum tree_code) gs->subcode;
/* While we initially set subcode to the TREE_CODE of the rhs for
@@ -2455,9 +2444,8 @@ gimple_assign_rhs_code (const_gimple gs)
assignment S. */
static inline void
-gimple_assign_set_rhs_code (gimple s, enum tree_code code)
+gimple_assign_set_rhs_code (gassign *s, enum tree_code code)
{
- GIMPLE_CHECK (s, GIMPLE_ASSIGN);
s->subcode = code;
}
@@ -2467,7 +2455,7 @@ gimple_assign_set_rhs_code (gimple s, enum tree_code code)
This will never return GIMPLE_INVALID_RHS. */
static inline enum gimple_rhs_class
-gimple_assign_rhs_class (const_gimple gs)
+gimple_assign_rhs_class (const gassign *gs)
{
return get_gimple_rhs_class (gimple_assign_rhs_code (gs));
}
@@ -2481,8 +2469,9 @@ gimple_assign_rhs_class (const_gimple gs)
static inline bool
gimple_assign_single_p (const_gimple gs)
{
- return (is_gimple_assign (gs)
- && gimple_assign_rhs_class (gs) == GIMPLE_SINGLE_RHS);
+ if (const gassign *assign = dyn_cast <const gassign *> (gs))
+ return gimple_assign_rhs_class (assign) == GIMPLE_SINGLE_RHS;
+ return false;
}
/* Return true if GS performs a store to its lhs. */
@@ -2502,7 +2491,7 @@ gimple_assign_load_p (const_gimple gs)
tree rhs;
if (!gimple_assign_single_p (gs))
return false;
- rhs = gimple_assign_rhs1 (gs);
+ rhs = gimple_assign_rhs1 (as_a <const gassign *> (gs));
if (TREE_CODE (rhs) == WITH_SIZE_EXPR)
return true;
rhs = get_base_address (rhs);
@@ -2518,7 +2507,7 @@ gimple_assign_cast_p (const_gimple s)
{
if (is_gimple_assign (s))
{
- enum tree_code sc = gimple_assign_rhs_code (s);
+ enum tree_code sc = gimple_assign_rhs_code (as_a <const gassign *> (s));
return CONVERT_EXPR_CODE_P (sc)
|| sc == VIEW_CONVERT_EXPR
|| sc == FIX_TRUNC_EXPR;
@@ -2533,7 +2522,7 @@ static inline bool
gimple_clobber_p (const_gimple s)
{
return gimple_assign_single_p (s)
- && TREE_CLOBBER_P (gimple_assign_rhs1 (s));
+ && TREE_CLOBBER_P (gimple_assign_rhs1 (as_a <const gassign *> (s)));
}
/* Return true if GS is a GIMPLE_CALL. */
@@ -5626,17 +5615,20 @@ gimple_expr_type (const_gimple stmt)
type = gimple_call_return_type (call_stmt);
}
else
- switch (gimple_assign_rhs_code (stmt))
- {
- case POINTER_PLUS_EXPR:
- type = TREE_TYPE (gimple_assign_rhs1 (stmt));
- break;
-
- default:
- /* As fallback use the type of the LHS. */
- type = TREE_TYPE (gimple_get_lhs (stmt));
- break;
- }
+ {
+ const gassign *assign = as_a <const gassign *> (stmt);
+ switch (gimple_assign_rhs_code (assign))
+ {
+ case POINTER_PLUS_EXPR:
+ type = TREE_TYPE (gimple_assign_rhs1 (assign));
+ break;
+
+ default:
+ /* As fallback use the type of the LHS. */
+ type = TREE_TYPE (gimple_assign_lhs (assign));
+ break;
+ }
+ }
return type;
}
else if (code == GIMPLE_COND)
@@ -49,6 +49,7 @@ along with GCC; see the file COPYING3. If not see
#include "gimple-ssa.h"
#include "stringpool.h"
#include "tree-ssanames.h"
+#include "gimple-compat.h"
/* Expand EXPR to list of gimple statements STMTS. GIMPLE_TEST_F specifies
@@ -86,6 +86,7 @@ extern "C" {
#include "domwalk.h"
#include "sese.h"
#include "tree-ssa-propagate.h"
+#include "gimple-compat.h"
#ifdef HAVE_isl
#include "expr.h"
@@ -56,6 +56,7 @@ along with GCC; see the file COPYING3. If not see
#include "ipa-icf-gimple.h"
#include "ipa-icf.h"
+#include "gimple-compat.h"
namespace ipa_icf_gimple {
@@ -116,6 +116,7 @@ along with GCC; see the file COPYING3. If not see
#include "ipa-utils.h"
#include "cilk.h"
#include "cfgexpand.h"
+#include "gimple-compat.h"
/* Estimate runtime of function can easilly run into huge numbers with many
nested loops. Be sure we can compute time * INLINE_SIZE_SCALE * 2 in an
@@ -51,6 +51,7 @@ along with GCC; see the file COPYING3. If not see
#include "data-streamer.h"
#include "lto-streamer.h"
#include "streamer-hooks.h"
+#include "gimple-compat.h"
/* Return true when TYPE contains an polymorphic type and thus is interesting
for devirtualization machinery. */
@@ -74,6 +74,7 @@ along with GCC; see the file COPYING3. If not see
#include "domwalk.h"
#include "builtins.h"
#include "calls.h"
+#include "gimple-compat.h"
/* Intermediate information that we get from alias analysis about a particular
parameter in a particular basic_block. When a parameter or the memory it
@@ -122,6 +122,7 @@ along with GCC; see the file COPYING3. If not see
#include "gimple-pretty-print.h"
#include "ipa-inline.h"
#include "cfgloop.h"
+#include "gimple-compat.h"
/* Per basic block info. */
@@ -81,6 +81,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-nested.h"
#include "tree-eh.h"
#include "cilk.h"
+#include "gimple-compat.h"
/* Lowering of OpenMP parallel and workshare constructs proceeds in two
@@ -77,6 +77,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-pass.h"
#include "tree-scalar-evolution.h"
#include "cfgloop.h"
+#include "gimple-compat.h"
/* real constants: 0, 1, 1-1/REG_BR_PROB_BASE, REG_BR_PROB_BASE,
1/REG_BR_PROB_BASE, 0.5, BB_FREQ_MAX. */
@@ -63,6 +63,7 @@ along with GCC; see the file COPYING3. If not see
#include "value-prof.h"
#include "sese.h"
#include "tree-ssa-propagate.h"
+#include "gimple-compat.h"
/* Helper function for debug_rename_map. */
@@ -65,6 +65,7 @@
#include "gimple-pretty-print.h"
#include "cfgloop.h"
#include "tree-ssa-address.h"
+#include "gimple-compat.h"
#define A_RUNINSTRUMENTEDCODE 0x0001
@@ -1281,7 +1282,7 @@ tm_log_emit_saves (basic_block entry_block, basic_block bb)
{
size_t i;
gimple_stmt_iterator gsi = gsi_last_bb (bb);
- gimple stmt;
+ gassign *stmt;
struct tm_log_entry l, *lp;
for (i = 0; i < tm_log_save_addresses.length (); ++i)
@@ -44,6 +44,7 @@ along with GCC; see the file COPYING3. If not see
#include "dumpfile.h"
#include "cfgexpand.h"
#include "wide-int-print.h"
+#include "gimple-compat.h"
/* Extends CST as appropriate for the affine combinations COMB. */
@@ -49,6 +49,8 @@ along with GCC; see the file COPYING3. If not see
#include "tree-into-ssa.h"
#include "tree-pass.h"
#include "flags.h"
+#include "gimple-compat.h"
+
/* Conditional dead call elimination
@@ -58,6 +58,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-ssa-propagate.h"
#include "tree-hasher.h"
#include "cfgloop.h"
+#include "gimple-compat.h"
/* For each complex ssa name, a lattice value. We're interested in finding
@@ -107,6 +107,7 @@ along with GCC; see the file COPYING3. If not see
#include "langhooks.h"
#include "tree-affine.h"
#include "params.h"
+#include "gimple-compat.h"
static struct datadep_stats
{
@@ -63,6 +63,7 @@ along with GCC; see the file COPYING3. If not see
#include "target.h"
#include "cfgloop.h"
#include "gimple-low.h"
+#include "gimple-compat.h"
/* In some instances a tree and a gimple need to be stored in a same table,
i.e. in hash tables. This is a structure to do this. */
@@ -489,7 +489,7 @@ lower_emutls_1 (tree *ptr, int *walk_subtrees, void *cb_data)
new assignment statement, and substitute yet another SSA_NAME. */
if (wi->changed)
{
- gimple x;
+ gassign *x;
addr = create_tmp_var (TREE_TYPE (t), NULL);
x = gimple_build_assign (addr, t);
@@ -126,6 +126,7 @@ along with GCC; see the file COPYING3. If not see
#include "dbgcnt.h"
#include "expr.h"
#include "optabs.h"
+#include "gimple-compat.h"
/* List of basic blocks in if-conversion-suitable order. */
static basic_block *ifc_bbs;
@@ -75,6 +75,7 @@ along with GCC; see the file COPYING3. If not see
#include "target.h"
#include "cfgloop.h"
#include "builtins.h"
+#include "gimple-compat.h"
#include "rtl.h" /* FIXME: For asm_str_count. */
@@ -63,6 +63,7 @@ along with GCC; see the file COPYING3. If not see
#include "params.h"
#include "diagnostic-core.h"
#include "tree-into-ssa.h"
+#include "gimple-compat.h"
#define PERCENT(x,y) ((float)(x) * 100.0 / (float)(y))
@@ -83,6 +83,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-pass.h"
#include "gimple-pretty-print.h"
#include "tree-vectorizer.h"
+#include "gimple-compat.h"
/* A Reduced Dependence Graph (RDG) vertex representing a statement. */
@@ -51,6 +51,7 @@
#include "expr.h" /* FIXME: For STACK_SAVEAREA_MODE and SAVE_NONLOCAL. */
#include "langhooks.h"
#include "gimple-low.h"
+#include "gimple-compat.h"
/* The object of this pass is to lower the representation of a set of nested
@@ -49,6 +49,7 @@ along with GCC; see the file COPYING3. If not see
#include "flags.h" /* For "optimize" in gate_pass_return_slot.
FIXME: That should be up to the pass manager,
but pass_nrv is not in pass_all_optimizations. */
+#include "gimple-compat.h"
/* This file implements return value optimizations for functions which
return aggregate types.
@@ -53,6 +53,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-phinodes.h"
#include "ssa-iterators.h"
#include "builtins.h"
+#include "gimple-compat.h"
struct object_size_info
{
@@ -59,6 +59,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-ssa-ter.h"
#include "tree-ssa-coalesce.h"
#include "tree-outof-ssa.h"
+#include "gimple-compat.h"
/* FIXME: A lot of code here deals with expanding to RTL. All that code
should be in cfgexpand.c. */
@@ -68,6 +68,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-parloops.h"
#include "omp-low.h"
#include "tree-nested.h"
+#include "gimple-compat.h"
/* This pass tries to distribute iterations of loops into several threads.
The implementation is straightforward -- for each loop we test whether its
@@ -233,6 +233,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-affine.h"
#include "tree-inline.h"
#include "wide-int-print.h"
+#include "gimple-compat.h"
/* The maximum number of iterations between the considered memory
references. */
@@ -298,6 +298,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-ssa-propagate.h"
#include "gimple-fold.h"
#include "gimplify-me.h"
+#include "gimple-compat.h"
static tree analyze_scalar_evolution_1 (struct loop *, tree, tree);
static tree analyze_scalar_evolution_for_address_of (struct loop *loop,
@@ -1150,7 +1151,7 @@ follow_ssa_edge_expr (struct loop *loop, gimple at_stmt, tree expr,
Return true if the strongly connected component has been found. */
static t_bool
-follow_ssa_edge_in_rhs (struct loop *loop, gimple stmt,
+follow_ssa_edge_in_rhs (struct loop *loop, gassign *stmt,
gphi *halting_phi, tree *evolution_of_loop,
int limit)
{
@@ -1388,7 +1389,7 @@ follow_ssa_edge (struct loop *loop, gimple def, gphi *halting_phi,
return t_false;
case GIMPLE_ASSIGN:
- return follow_ssa_edge_in_rhs (loop, def, halting_phi,
+ return follow_ssa_edge_in_rhs (loop, as_a <gassign *> (def), halting_phi,
evolution_of_loop, limit);
default:
@@ -123,6 +123,7 @@ along with GCC; see the file COPYING3. If not see
#include "ipa-inline.h"
#include "ipa-utils.h"
#include "builtins.h"
+#include "gimple-compat.h"
/* Enumeration of all aggregate reductions we can do. */
enum sra_mode { SRA_MODE_EARLY_IPA, /* early call regularization */
@@ -56,6 +56,7 @@ along with GCC; see the file COPYING3. If not see
#include "alloc-pool.h"
#include "tree-ssa-alias.h"
#include "ipa-reference.h"
+#include "gimple-compat.h"
/* Broad overview of how alias analysis on gimple works:
@@ -164,6 +164,7 @@ along with GCC; see the file COPYING3. If not see
#include "params.h"
#include "wide-int-print.h"
#include "builtins.h"
+#include "gimple-compat.h"
/* Possible lattice values. */
@@ -53,6 +53,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-ssa-live.h"
#include "tree-ssa-coalesce.h"
#include "diagnostic-core.h"
+#include "gimple-compat.h"
/* This set of routines implements a coalesce_list. This is an object which
@@ -55,6 +55,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-scalar-evolution.h"
#include "tree-ssa-dom.h"
#include "tree-ssa-loop-niter.h"
+#include "gimple-compat.h"
/* This file implements the copy propagation pass and provides a
@@ -52,6 +52,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-ssa-live.h"
#include "tree-pass.h"
#include "langhooks.h"
+#include "gimple-compat.h"
static struct
{
@@ -84,6 +84,7 @@ along with GCC; see the file COPYING3. If not see
#include "flags.h"
#include "cfgloop.h"
#include "tree-scalar-evolution.h"
+#include "gimple-compat.h"
static struct stmt_stats
{
@@ -66,6 +66,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-ssa-threadedge.h"
#include "tree-ssa-dom.h"
#include "inchash.h"
+#include "gimple-compat.h"
/* This file implements optimizations on the dominator tree. */
@@ -55,6 +55,7 @@ along with GCC; see the file COPYING3. If not see
#include "flags.h"
#include "langhooks.h"
#include "tree-cfgcleanup.h"
+#include "gimple-compat.h"
/* This file implements dead store elimination.
@@ -67,6 +67,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-cfgcleanup.h"
#include "tree-into-ssa.h"
#include "cfganal.h"
+#include "gimple-compat.h"
/* This pass propagates the RHS of assignment statements into use
sites of the LHS of the assignment. It's basically a specialized
@@ -54,6 +54,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-phinodes.h"
#include "ssa-iterators.h"
#include "tree-pass.h"
+#include "gimple-compat.h"
#ifndef LOGICAL_OP_NON_SHORT_CIRCUIT
#define LOGICAL_OP_NON_SHORT_CIRCUIT \
@@ -57,6 +57,7 @@ along with GCC; see the file COPYING3. If not see
#include "diagnostic-core.h"
#include "debug.h"
#include "flags.h"
+#include "gimple-compat.h"
#ifdef ENABLE_CHECKING
static void verify_live_on_entry (tree_live_info_p);
@@ -48,6 +48,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-inline.h"
#include "flags.h"
#include "tree-ssa-threadedge.h"
+#include "gimple-compat.h"
/* Duplicates headers of loops if they are small enough, so that the statements
in the loop body are always executed when the loop is entered. This
@@ -64,6 +64,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-ssa-propagate.h"
#include "trans-mem.h"
#include "gimple-fold.h"
+#include "gimple-compat.h"
/* TODO: Support for predicated code motion. I.e.
@@ -83,6 +83,7 @@ along with GCC; see the file COPYING3. If not see
#include "target.h"
#include "tree-cfgcleanup.h"
#include "builtins.h"
+#include "gimple-compat.h"
/* Specifies types of loops that may be unrolled. */
@@ -120,6 +120,7 @@ along with GCC; see the file COPYING3. If not see
#include "expmed.h"
#include "tree-ssa-address.h"
#include "builtins.h"
+#include "gimple-compat.h"
/* FIXME: Expressions are expanded to RTL in this pass to determine the
cost of different addressing modes. This should be moved to a TBD
@@ -65,6 +65,7 @@ along with GCC; see the file COPYING3. If not see
#include "stringpool.h"
#include "tree-ssanames.h"
#include "wide-int-print.h"
+#include "gimple-compat.h"
#define SWAP(X, Y) do { affine_iv *tmp = (X); (X) = (Y); (Y) = tmp; } while (0)
@@ -60,6 +60,7 @@ along with GCC; see the file COPYING3. If not see
#include "langhooks.h"
#include "tree-inline.h"
#include "tree-data-ref.h"
+#include "gimple-compat.h"
/* FIXME: Needed for optabs, but this should all be moved to a TBD interface
@@ -125,6 +125,7 @@ along with GCC; see the file COPYING3. If not see
#include "target.h"
#include "gimple-pretty-print.h"
#include "builtins.h"
+#include "gimple-compat.h"
/* FIXME: RTL headers have to be included here for optabs. */
#include "rtl.h" /* Because optabs.h wants enum rtx_code. */
@@ -65,6 +65,7 @@ along with GCC; see the file COPYING3. If not see
#include "optabs.h"
#include "tree-scalar-evolution.h"
#include "tree-inline.h"
+#include "gimple-compat.h"
#ifndef HAVE_conditional_move
#define HAVE_conditional_move (0)
@@ -52,6 +52,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-pass.h"
#include "langhooks.h"
#include "flags.h"
+#include "gimple-compat.h"
/* This pass propagates indirect loads through the PHI node for its
address to make the load source possibly non-addressable and to
@@ -76,6 +76,7 @@ along with GCC; see the file COPYING3. If not see
#include "ipa-prop.h"
#include "tree-ssa-propagate.h"
#include "ipa-utils.h"
+#include "gimple-compat.h"
/* TODO:
@@ -60,6 +60,7 @@
#include "langhooks.h"
#include "value-prof.h"
#include "domwalk.h"
+#include "gimple-compat.h"
/* This file implements a generic value propagation engine based on
the same propagation used by the SSA-CCP algorithm [1].
@@ -74,6 +74,7 @@ along with GCC; see the file COPYING3. If not see
#include "builtins.h"
#include "gimplify.h"
#include "optabs.h"
+#include "gimple-compat.h"
/* This is a simple global reassociation pass. It is, in part, based
on the LLVM pass of the same name (They do some things more/less
@@ -65,6 +65,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-ssa-sccvn.h"
#include "tree-cfg.h"
#include "domwalk.h"
+#include "gimple-compat.h"
/* This algorithm is based on the SCC algorithm presented by Keith
Cooper and L. Taylor Simpson in "SCC-Based Value numbering"
@@ -54,6 +54,7 @@ along with GCC; see the file COPYING3. If not see
#include "flags.h"
#include "cfgloop.h"
#include "params.h"
+#include "gimple-compat.h"
/* TODO:
1. Sinking store only using scalar promotion (IE without moving the RHS):
@@ -62,6 +62,7 @@ along with GCC; see the file COPYING3. If not see
#include "gimple-pretty-print.h"
#include "params.h"
#include "expr.h"
+#include "gimple-compat.h"
/* A vector indexed by SSA_NAME_VERSION. 0 means unknown, positive value
is an index into strinfo vector, negative value stands for
@@ -61,6 +61,7 @@
#include "splay-tree.h"
#include "params.h"
#include "alias.h"
+#include "gimple-compat.h"
/* The idea behind this analyzer is to generate set constraints from the
program, then solve the resulting constraints in order to generate the
@@ -228,6 +228,7 @@ along with GCC; see the file COPYING3. If not see
#include "cfgloop.h"
#include "tree-pass.h"
#include "trans-mem.h"
+#include "gimple-compat.h"
/* Describes a group of bbs with the same successors. The successor bbs are
cached in succs, and the successor edge flags are cached in succ_flags.
@@ -54,6 +54,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-outof-ssa.h"
#include "flags.h"
#include "gimple-walk.h"
+#include "gimple-compat.h"
/* Temporary Expression Replacement (TER)
@@ -56,6 +56,7 @@ along with GCC; see the file COPYING3. If not see
#include "params.h"
#include "tree-ssa-threadedge.h"
#include "builtins.h"
+#include "gimple-compat.h"
/* To avoid code explosion due to jump threading, we limit the
number of statements we are going to copy. This variable
@@ -52,6 +52,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-pass.h"
#include "diagnostic-core.h"
#include "params.h"
+#include "gimple-compat.h"
/* This implements the pass that does predicate aware warning on uses of
possibly uninitialized variables. The pass first collects the set of
@@ -62,6 +62,7 @@ along with GCC; see the file COPYING3. If not see
#include "diagnostic-core.h"
#include "cfgloop.h"
#include "cfgexpand.h"
+#include "gimple-compat.h"
/* Pointer map of variable mappings, keyed by edge. */
static hash_map<edge, auto_vec<edge_var_map> > *edge_var_maps;
@@ -53,6 +53,7 @@ along with GCC; see the file COPYING3. If not see
#include "sbitmap.h"
#include "tree-pass.h"
#include "tree-stdarg.h"
+#include "gimple-compat.h"
/* A simple pass that attempts to optimize stdarg functions on architectures
that need to save register arguments to stack on entry to stdarg functions.
@@ -599,10 +599,10 @@ struct switch_conv_info
/* The first load statement that loads a temporary from a new static array.
*/
- gimple arr_ref_first;
+ gassign *arr_ref_first;
/* The last load statement that loads a temporary from a new static array. */
- gimple arr_ref_last;
+ gassign *arr_ref_last;
/* String reason why the case wasn't a good candidate that is written to the
dump file, if there is one. */
@@ -1037,7 +1037,7 @@ build_one_array (gswitch *swtch, int num, tree arr_index_type,
gphi *phi, tree tidx, struct switch_conv_info *info)
{
tree name, cst;
- gimple load;
+ gassign *load;
gimple_stmt_iterator gsi = gsi_for_stmt (swtch);
location_t loc = gimple_location (swtch);
@@ -1103,7 +1103,7 @@ build_arrays (gswitch *swtch, struct switch_conv_info *info)
{
tree arr_index_type;
tree tidx, sub, utype;
- gimple stmt;
+ gassign *stmt;
gimple_stmt_iterator gsi;
gphi_iterator gpi;
int i;
@@ -69,6 +69,7 @@ along with GCC; see the file COPYING3. If not see
#include "optabs.h"
#include "builtins.h"
#include "varasm.h"
+#include "gimple-compat.h"
/* Return true if load- or store-lanes optab OPTAB is implemented for
COUNT vectors of type VECTYPE. NAME is the name of OPTAB. */
@@ -52,6 +52,7 @@ along with GCC; see the file COPYING3. If not see
#include "flags.h"
#include "diagnostic.h"
#include "target.h"
+#include "gimple-compat.h"
/* Need to include rtl.h, expr.h, etc. for optabs. */
#include "expr.h"
@@ -66,6 +66,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-scalar-evolution.h"
#include "tree-vectorizer.h"
#include "target.h"
+#include "gimple-compat.h"
/* Loop Vectorization Pass.
@@ -59,6 +59,7 @@ along with GCC; see the file COPYING3. If not see
#include "diagnostic-core.h"
#include "dumpfile.h"
#include "builtins.h"
+#include "gimple-compat.h"
/* Pattern recognition functions */
static gimple vect_recog_widen_sum_pattern (vec<gimple> *, tree *,
@@ -55,6 +55,7 @@ along with GCC; see the file COPYING3. If not see
#include "optabs.h"
#include "tree-vectorizer.h"
#include "langhooks.h"
+#include "gimple-compat.h"
/* Extract the location of the basic block in the source code.
Return the basic block location if succeed and NULL if not. */
@@ -66,6 +66,7 @@ along with GCC; see the file COPYING3. If not see
#include "dumpfile.h"
#include "cgraph.h"
#include "builtins.h"
+#include "gimple-compat.h"
/* For lang_hooks.types.type_for_mode. */
#include "langhooks.h"
@@ -1314,7 +1315,7 @@ tree
vect_init_vector (gimple stmt, tree val, tree type, gimple_stmt_iterator *gsi)
{
tree new_var;
- gimple init_stmt;
+ gassign *init_stmt;
tree vec_oprnd;
tree new_temp;
@@ -72,6 +72,7 @@ along with GCC; see the file COPYING3. If not see
#include "optabs.h"
#include "tree-ssa-threadedge.h"
#include "wide-int.h"
+#include "gimple-compat.h"
@@ -59,6 +59,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-ssa-propagate.h"
#include "tsan.h"
#include "asan.h"
+#include "gimple-compat.h"
/* Number of instrumented memory accesses in the current function. */
@@ -56,6 +56,7 @@ along with GCC; see the file COPYING3. If not see
#include "dfp.h"
#include "builtins.h"
#include "tree-object-size.h"
+#include "gimple-compat.h"
/* Map from a tree to a VAR_DECL tree. */
@@ -69,6 +69,7 @@ along with GCC; see the file COPYING3. If not see
#include "builtins.h"
#include "tree-nested.h"
#include "params.h"
+#include "gimple-compat.h"
/* In this file value profile based optimizations are placed. Currently the
following optimizations are implemented (for more detailed descriptions
@@ -161,6 +161,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-ssanames.h"
#include "tree-pass.h"
#include "cfgloop.h"
+#include "gimple-compat.h"
#include "vtable-verify.h"
--
1.8.5.3