* alias.h (component_uses_parent_alias_set): Likewise.
* cfgrtl.c (print_rtl_with_bb): Likewise.
* double-int.c (tree_to_double_int, double_int_fits_to_tree_p,
mpz_get_double_int): Likewise.
* double-int.h (double_int_fits_to_tree_p, tree_to_double_int,
mpz_get_double_int): Likewise.
* expr.c (is_aligning_offset, undefined_operand_subword_p,
mostly_zeros_p, all_zeros_p, safe_from_p, is_aligning_offset):
Likewise.
* expr.h (safe_from_p): Likewise.
* gimple-low.c (try_catch_may_fallthru, block_may_fallthru):
Likewise.
* gimplify.c (should_carry_locus_p, zero_sized_field_decl,
zero_sized_type, goa_lhs_expr_p): Likewise.
* omp-low.c (is_variable_sized, use_pointer_for_field): Likewise.
* rtl.h (print_rtl_with_bb): Likewise.
* sched-vis.c (print_exp, print_value, print_pattern): Likewise.
* tree-cfg.c (const_first_stmt, const_last_stmt): New.
* tree-flow-inline.h (bb_stmt_list): Constify.
(cbsi_start, cbsi_last, cbsi_end_p, cbsi_next, cbsi_prev,
cbsi_stmt): New.
* tree-flow.h (const_block_stmt_iterator, cbsi_start, cbsi_last,
const_first_stmt, const_last_stmt): New.
(block_may_fallthru, empty_block_p): Constify.
* tree-iterator.c (EXPR_FIRST_BODY, EXPR_LAST_BODY,
EXPR_ONLY_BODY): New.
(expr_first, expr_last, expr_only): Use macro for body.
(const_expr_first, const_expr_last, const_expr_only): New.
* tree-iterator.h (const_tree_stmt_iterator, ctsi_start,
ctsi_last, ctsi_end_p, ctsi_one_before_end_p, ctsi_next,
ctsi_prev, ctsi_stmt): New.
* tree-scalar-evolution.c (get_loop_exit_condition): Constify.
* tree-scalar-evolution.h (get_loop_exit_condition): Likewise.
* tree-ssa-loop-niter.c (loop_only_exit_p,
derive_constant_upper_bound): Likewise.
* tree-ssa-phiopt.c (empty_block_p): Likewise.
* tree-ssa-threadupdate.c (redirection_block_p): Likewise.
* tree-vectorizer.c (slpeel_can_duplicate_loop_p): Likewise.
* tree-vectorizer.h (slpeel_can_duplicate_loop_p): Likewise.
* tree-vrp.c (vrp_bitmap_equal_p): Likewise.
* tree.c (get_type_static_bounds): Likewise.
* tree.h (const_expr_first, const_expr_last, const_expr_only): New.
(get_type_static_bounds): Constify.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127483
138bc75d-0d04-0410-961f-
82ee72b054a4
+2007-08-14 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * alias.c (component_uses_parent_alias_set): Constify.
+ * alias.h (component_uses_parent_alias_set): Likewise.
+ * cfgrtl.c (print_rtl_with_bb): Likewise.
+ * double-int.c (tree_to_double_int, double_int_fits_to_tree_p,
+ mpz_get_double_int): Likewise.
+ * double-int.h (double_int_fits_to_tree_p, tree_to_double_int,
+ mpz_get_double_int): Likewise.
+ * expr.c (is_aligning_offset, undefined_operand_subword_p,
+ mostly_zeros_p, all_zeros_p, safe_from_p, is_aligning_offset):
+ Likewise.
+ * expr.h (safe_from_p): Likewise.
+ * gimple-low.c (try_catch_may_fallthru, block_may_fallthru):
+ Likewise.
+ * gimplify.c (should_carry_locus_p, zero_sized_field_decl,
+ zero_sized_type, goa_lhs_expr_p): Likewise.
+ * omp-low.c (is_variable_sized, use_pointer_for_field): Likewise.
+ * rtl.h (print_rtl_with_bb): Likewise.
+ * sched-vis.c (print_exp, print_value, print_pattern): Likewise.
+ * tree-cfg.c (const_first_stmt, const_last_stmt): New.
+ * tree-flow-inline.h (bb_stmt_list): Constify.
+ (cbsi_start, cbsi_last, cbsi_end_p, cbsi_next, cbsi_prev,
+ cbsi_stmt): New.
+ * tree-flow.h (const_block_stmt_iterator, cbsi_start, cbsi_last,
+ const_first_stmt, const_last_stmt): New.
+ (block_may_fallthru, empty_block_p): Constify.
+ * tree-iterator.c (EXPR_FIRST_BODY, EXPR_LAST_BODY,
+ EXPR_ONLY_BODY): New.
+ (expr_first, expr_last, expr_only): Use macro for body.
+ (const_expr_first, const_expr_last, const_expr_only): New.
+ * tree-iterator.h (const_tree_stmt_iterator, ctsi_start,
+ ctsi_last, ctsi_end_p, ctsi_one_before_end_p, ctsi_next,
+ ctsi_prev, ctsi_stmt): New.
+ * tree-scalar-evolution.c (get_loop_exit_condition): Constify.
+ * tree-scalar-evolution.h (get_loop_exit_condition): Likewise.
+ * tree-ssa-loop-niter.c (loop_only_exit_p,
+ derive_constant_upper_bound): Likewise.
+ * tree-ssa-phiopt.c (empty_block_p): Likewise.
+ * tree-ssa-threadupdate.c (redirection_block_p): Likewise.
+ * tree-vectorizer.c (slpeel_can_duplicate_loop_p): Likewise.
+ * tree-vectorizer.h (slpeel_can_duplicate_loop_p): Likewise.
+ * tree-vrp.c (vrp_bitmap_equal_p): Likewise.
+ * tree.c (get_type_static_bounds): Likewise.
+ * tree.h (const_expr_first, const_expr_last, const_expr_only): New.
+ (get_type_static_bounds): Constify.
+
2007-08-14 Rask Ingemann Lambertsen <rask@sygehus.dk>
PR target/30315
assignable alias sets. */
bool
-component_uses_parent_alias_set (tree t)
+component_uses_parent_alias_set (const_tree t)
{
while (1)
{
extern alias_set_type new_alias_set (void);
extern alias_set_type get_varargs_alias_set (void);
extern alias_set_type get_frame_alias_set (void);
-extern bool component_uses_parent_alias_set (tree);
+extern bool component_uses_parent_alias_set (const_tree);
extern bool alias_set_subset_of (alias_set_type, alias_set_type);
/* This alias set can be used to force a memory to conflict with all
basic block. */
void
-print_rtl_with_bb (FILE *outf, rtx rtx_first)
+print_rtl_with_bb (FILE *outf, const_rtx rtx_first)
{
- rtx tmp_rtx;
+ const_rtx tmp_rtx;
if (rtx_first == 0)
fprintf (outf, "(nil)\n");
else
is unsigned. */
double_int
-tree_to_double_int (tree cst)
+tree_to_double_int (const_tree cst)
{
/* We do not need to call double_int_restrict here to ensure the semantics as
described, as this is the default one for trees. */
to be the same as the signedness of TYPE. */
bool
-double_int_fits_to_tree_p (tree type, double_int cst)
+double_int_fits_to_tree_p (const_tree type, double_int cst)
{
double_int ext = double_int_ext (cst,
TYPE_PRECISION (type),
appropriate minimum or maximum TYPE bound. */
double_int
-mpz_get_double_int (tree type, mpz_t val, bool wrap)
+mpz_get_double_int (const_tree type, mpz_t val, bool wrap)
{
unsigned HOST_WIDE_INT *vp;
size_t count, numb;
/* Constructors and conversions. */
union tree_node *double_int_to_tree (union tree_node *, double_int);
-bool double_int_fits_to_tree_p (union tree_node *, double_int);
-double_int tree_to_double_int (union tree_node *);
+bool double_int_fits_to_tree_p (const union tree_node *, double_int);
+double_int tree_to_double_int (const union tree_node *);
/* Constructs double_int from integer CST. The bits over the precision of
HOST_WIDE_INT are filled with the sign bit. */
/* Conversion to and from GMP integer representations. */
void mpz_set_double_int (mpz_t, double_int, bool);
-double_int mpz_get_double_int (tree, mpz_t, bool);
+double_int mpz_get_double_int (const_tree, mpz_t, bool);
#endif /* DOUBLE_INT_H */
static unsigned HOST_WIDE_INT highest_pow2_factor_for_target (const_tree, const_tree);
-static int is_aligning_offset (tree, tree);
+static int is_aligning_offset (const_tree, const_tree);
static void expand_operands (tree, tree, rtx, rtx*, rtx*,
enum expand_modifier);
static rtx reduce_to_bit_field_precision (rtx, rtx, tree);
undefined bits of a paradoxical subreg. */
static bool
-undefined_operand_subword_p (rtx op, int i)
+undefined_operand_subword_p (const_rtx op, int i)
{
enum machine_mode innermode, innermostmode;
int offset;
/* Return 1 if EXP contains mostly (3/4) zeros. */
static int
-mostly_zeros_p (tree exp)
+mostly_zeros_p (const_tree exp)
{
if (TREE_CODE (exp) == CONSTRUCTOR)
/* Return 1 if EXP contains all zeros. */
static int
-all_zeros_p (tree exp)
+all_zeros_p (const_tree exp)
{
if (TREE_CODE (exp) == CONSTRUCTOR)
searches for optimization opportunities. */
int
-safe_from_p (rtx x, tree exp, int top_p)
+safe_from_p (const_rtx x, tree exp, int top_p)
{
rtx exp_rtl = 0;
int i, nops;
aligned more than BIGGEST_ALIGNMENT. */
static int
-is_aligning_offset (tree offset, tree exp)
+is_aligning_offset (const_tree offset, const_tree exp)
{
/* Strip off any conversions. */
while (TREE_CODE (offset) == NON_LVALUE_EXPR
extern rtx expand_mult_highpart_adjust (enum machine_mode, rtx, rtx, rtx, rtx, int);
extern rtx assemble_static_space (unsigned HOST_WIDE_INT);
-extern int safe_from_p (rtx, tree, int);
+extern int safe_from_p (const_rtx, tree, int);
/* Call this once to initialize the contents of the optabs
appropriately for the current target machine. */
This is a subroutine of block_may_fallthru. */
static bool
-try_catch_may_fallthru (tree stmt)
+try_catch_may_fallthru (const_tree stmt)
{
tree_stmt_iterator i;
If we're wrong, we'll just delete the extra code later. */
bool
-block_may_fallthru (tree block)
+block_may_fallthru (const_tree block)
{
- tree stmt = expr_last (block);
+ const_tree stmt = const_expr_last (block);
switch (stmt ? TREE_CODE (stmt) : ERROR_MARK)
{
/* Determines whether to assign a locus to the statement STMT. */
static bool
-should_carry_locus_p (tree stmt)
+should_carry_locus_p (const_tree stmt)
{
/* Don't emit a line note for a label. We particularly don't want to
emit one for the break label, since it doesn't actually correspond
/* Return true if FDECL is accessing a field that is zero sized. */
static bool
-zero_sized_field_decl (tree fdecl)
+zero_sized_field_decl (const_tree fdecl)
{
if (TREE_CODE (fdecl) == FIELD_DECL && DECL_SIZE (fdecl)
&& integer_zerop (DECL_SIZE (fdecl)))
/* Return true if TYPE is zero sized. */
static bool
-zero_sized_type (tree type)
+zero_sized_type (const_tree type)
{
if (AGGREGATE_TYPE_P (type) && TYPE_SIZE (type)
&& integer_zerop (TYPE_SIZE (type)))
EXPR is this stabilized form. */
static bool
-goa_lhs_expr_p (tree expr, tree addr)
+goa_lhs_expr_p (const_tree expr, const_tree addr)
{
/* Also include casts to other type variants. The C front end is fond
of adding these for e.g. volatile variables. This is like
/* Return true if EXPR is variable sized. */
static inline bool
-is_variable_sized (tree expr)
+is_variable_sized (const_tree expr)
{
return !TREE_CONSTANT (TYPE_SIZE_UNIT (TREE_TYPE (expr)));
}
if DECL is to be shared. */
static bool
-use_pointer_for_field (tree decl, bool shared_p)
+use_pointer_for_field (const_tree decl, bool shared_p)
{
if (AGGREGATE_TYPE_P (TREE_TYPE (decl)))
return true;
unsigned int, int);
/* In cfgrtl.c */
-extern void print_rtl_with_bb (FILE *, rtx);
+extern void print_rtl_with_bb (FILE *, const_rtx);
/* In cfg.c. */
extern void dump_reg_info (FILE *);
#include "tree-pass.h"
static char *safe_concat (char *, char *, const char *);
-static void print_exp (char *, rtx, int);
-static void print_value (char *, rtx, int);
-static void print_pattern (char *, rtx, int);
+static void print_exp (char *, const_rtx, int);
+static void print_value (char *, const_rtx, int);
+static void print_pattern (char *, const_rtx, int);
#define BUF_LEN 2048
may be stored in objects representing values. */
static void
-print_exp (char *buf, rtx x, int verbose)
+print_exp (char *buf, const_rtx x, int verbose)
{
char tmp[BUF_LEN];
const char *st[4];
registers, labels, symbols and memory accesses. */
static void
-print_value (char *buf, rtx x, int verbose)
+print_value (char *buf, const_rtx x, int verbose)
{
char t[BUF_LEN];
char *cur = buf;
/* The next step in insn detalization, its pattern recognition. */
static void
-print_pattern (char *buf, rtx x, int verbose)
+print_pattern (char *buf, const_rtx x, int verbose)
{
char t1[BUF_LEN], t2[BUF_LEN], t3[BUF_LEN];
return !bsi_end_p (i) ? bsi_stmt (i) : NULL_TREE;
}
+const_tree
+const_first_stmt (const_basic_block bb)
+{
+ const_block_stmt_iterator i = cbsi_start (bb);
+ return !cbsi_end_p (i) ? cbsi_stmt (i) : NULL_TREE;
+}
/* Return the last statement in basic block BB. */
return !bsi_end_p (b) ? bsi_stmt (b) : NULL_TREE;
}
+const_tree
+const_last_stmt (const_basic_block bb)
+{
+ const_block_stmt_iterator b = cbsi_last (bb);
+ return !cbsi_end_p (b) ? cbsi_stmt (b) : NULL_TREE;
+}
/* Return the last statement of an otherwise empty block. Return NULL
if the block is totally empty, or if it contains more than one
/* Returns the list of statements in BB. */
static inline tree
-bb_stmt_list (basic_block bb)
+bb_stmt_list (const_basic_block bb)
{
gcc_assert (!(bb->flags & BB_RTL));
return bb->il.tree->stmt_list;
return bsi;
}
+static inline const_block_stmt_iterator
+cbsi_start (const_basic_block bb)
+{
+ const_block_stmt_iterator bsi;
+ if (bb->index < NUM_FIXED_BLOCKS)
+ {
+ bsi.tsi.ptr = NULL;
+ bsi.tsi.container = NULL;
+ }
+ else
+ bsi.tsi = ctsi_start (bb_stmt_list (bb));
+ bsi.bb = bb;
+ return bsi;
+}
+
/* Return a block statement iterator that points to the first non-label
statement in block BB. */
return bsi;
}
+static inline const_block_stmt_iterator
+cbsi_last (const_basic_block bb)
+{
+ const_block_stmt_iterator bsi;
+
+ if (bb->index < NUM_FIXED_BLOCKS)
+ {
+ bsi.tsi.ptr = NULL;
+ bsi.tsi.container = NULL;
+ }
+ else
+ bsi.tsi = ctsi_last (bb_stmt_list (bb));
+ bsi.bb = bb;
+ return bsi;
+}
+
/* Return true if block statement iterator I has reached the end of
the basic block. */
static inline bool
return tsi_end_p (i.tsi);
}
+static inline bool
+cbsi_end_p (const_block_stmt_iterator i)
+{
+ return ctsi_end_p (i.tsi);
+}
+
/* Modify block statement iterator I so that it is at the next
statement in the basic block. */
static inline void
tsi_next (&i->tsi);
}
+static inline void
+cbsi_next (const_block_stmt_iterator *i)
+{
+ ctsi_next (&i->tsi);
+}
+
/* Modify block statement iterator I so that it is at the previous
statement in the basic block. */
static inline void
tsi_prev (&i->tsi);
}
+static inline void
+cbsi_prev (const_block_stmt_iterator *i)
+{
+ ctsi_prev (&i->tsi);
+}
+
/* Return the statement that block statement iterator I is currently
at. */
static inline tree
return tsi_stmt (i.tsi);
}
+static inline const_tree
+cbsi_stmt (const_block_stmt_iterator i)
+{
+ return ctsi_stmt (i.tsi);
+}
+
/* Return a pointer to the statement that block statement iterator I
is currently at. */
static inline tree *
basic_block bb;
} block_stmt_iterator;
+typedef struct {
+ const_tree_stmt_iterator tsi;
+ const_basic_block bb;
+} const_block_stmt_iterator;
+
static inline block_stmt_iterator bsi_start (basic_block);
+static inline const_block_stmt_iterator cbsi_start (const_basic_block);
static inline block_stmt_iterator bsi_last (basic_block);
+static inline const_block_stmt_iterator cbsi_last (const_basic_block);
static inline block_stmt_iterator bsi_after_labels (basic_block);
block_stmt_iterator bsi_for_stmt (tree);
static inline bool bsi_end_p (block_stmt_iterator);
extern void cleanup_dead_labels (void);
extern void group_case_labels (void);
extern tree first_stmt (basic_block);
+extern const_tree const_first_stmt (const_basic_block);
extern tree last_stmt (basic_block);
+extern const_tree const_last_stmt (const_basic_block);
extern tree last_and_only_stmt (basic_block);
extern edge find_taken_edge (basic_block, tree);
extern basic_block label_to_block_fn (struct function *, tree);
/* In gimple-low.c */
extern void record_vars_into (tree, tree);
extern void record_vars (tree);
-extern bool block_may_fallthru (tree);
+extern bool block_may_fallthru (const_tree);
/* In tree-ssa-alias.c */
extern void dump_may_aliases_for (FILE *, tree);
extern tree get_vectype_for_scalar_type (tree);
/* In tree-ssa-phiopt.c */
-bool empty_block_p (basic_block);
+bool empty_block_p (const_basic_block);
basic_block *blocks_in_phiopt_order (void);
/* In tree-ssa-loop*.c */
/* Return the first expression in a sequence of COMPOUND_EXPRs,
or in a STATEMENT_LIST. */
+#define EXPR_FIRST_BODY do { \
+ if (expr == NULL_TREE) \
+ return expr; \
+ if (TREE_CODE (expr) == STATEMENT_LIST) \
+ { \
+ struct tree_statement_list_node *n = STATEMENT_LIST_HEAD (expr); \
+ return n ? n->stmt : NULL_TREE; \
+ } \
+ while (TREE_CODE (expr) == COMPOUND_EXPR) \
+ expr = TREE_OPERAND (expr, 0); \
+ return expr; \
+} while (0)
+
tree
expr_first (tree expr)
{
- if (expr == NULL_TREE)
- return expr;
-
- if (TREE_CODE (expr) == STATEMENT_LIST)
- {
- struct tree_statement_list_node *n = STATEMENT_LIST_HEAD (expr);
- return n ? n->stmt : NULL_TREE;
- }
+ EXPR_FIRST_BODY;
+}
- while (TREE_CODE (expr) == COMPOUND_EXPR)
- expr = TREE_OPERAND (expr, 0);
- return expr;
+const_tree
+const_expr_first (const_tree expr)
+{
+ EXPR_FIRST_BODY;
}
/* Return the last expression in a sequence of COMPOUND_EXPRs,
or in a STATEMENT_LIST. */
+#define EXPR_LAST_BODY do { \
+ if (expr == NULL_TREE) \
+ return expr;\
+ if (TREE_CODE (expr) == STATEMENT_LIST) \
+ { \
+ struct tree_statement_list_node *n = STATEMENT_LIST_TAIL (expr); \
+ return n ? n->stmt : NULL_TREE; \
+ } \
+ while (TREE_CODE (expr) == COMPOUND_EXPR) \
+ expr = TREE_OPERAND (expr, 1); \
+ return expr; \
+} while (0)
+
tree
expr_last (tree expr)
{
- if (expr == NULL_TREE)
- return expr;
-
- if (TREE_CODE (expr) == STATEMENT_LIST)
- {
- struct tree_statement_list_node *n = STATEMENT_LIST_TAIL (expr);
- return n ? n->stmt : NULL_TREE;
- }
+ EXPR_LAST_BODY;
+}
- while (TREE_CODE (expr) == COMPOUND_EXPR)
- expr = TREE_OPERAND (expr, 1);
- return expr;
+const_tree
+const_expr_last (const_tree expr)
+{
+ EXPR_LAST_BODY;
}
/* If EXPR is a single statement return it. If EXPR is a
STATEMENT_LIST containing exactly one statement S, return S.
Otherwise, return NULL. */
+#define EXPR_ONLY_BODY do { \
+ if (expr == NULL_TREE) \
+ return NULL_TREE; \
+ if (TREE_CODE (expr) == STATEMENT_LIST) \
+ { \
+ struct tree_statement_list_node *n = STATEMENT_LIST_TAIL (expr); \
+ if (n && STATEMENT_LIST_HEAD (expr) == n) \
+ return n->stmt; \
+ else \
+ return NULL_TREE; \
+ } \
+ if (TREE_CODE (expr) == COMPOUND_EXPR) \
+ return NULL_TREE; \
+ return expr; \
+} while (0)
+
tree
expr_only (tree expr)
{
- if (expr == NULL_TREE)
- return NULL_TREE;
-
- if (TREE_CODE (expr) == STATEMENT_LIST)
- {
- struct tree_statement_list_node *n = STATEMENT_LIST_TAIL (expr);
- if (n && STATEMENT_LIST_HEAD (expr) == n)
- return n->stmt;
- else
- return NULL_TREE;
- }
-
- if (TREE_CODE (expr) == COMPOUND_EXPR)
- return NULL_TREE;
+ EXPR_ONLY_BODY;
+}
- return expr;
+const_tree
+const_expr_only (const_tree expr)
+{
+ EXPR_ONLY_BODY;
}
#include "gt-tree-iterator.h"
tree container;
} tree_stmt_iterator;
+typedef struct {
+ struct tree_statement_list_node *ptr;
+ const_tree container;
+} const_tree_stmt_iterator;
+
static inline tree_stmt_iterator
tsi_start (tree t)
{
return i;
}
+static inline const_tree_stmt_iterator
+ctsi_start (const_tree t)
+{
+ const_tree_stmt_iterator i;
+
+ i.ptr = STATEMENT_LIST_HEAD (t);
+ i.container = t;
+
+ return i;
+}
+
static inline tree_stmt_iterator
tsi_last (tree t)
{
return i;
}
+static inline const_tree_stmt_iterator
+ctsi_last (tree t)
+{
+ const_tree_stmt_iterator i;
+
+ i.ptr = STATEMENT_LIST_TAIL (t);
+ i.container = t;
+
+ return i;
+}
+
static inline bool
tsi_end_p (tree_stmt_iterator i)
{
}
static inline bool
+ctsi_end_p (const_tree_stmt_iterator i)
+{
+ return i.ptr == NULL;
+}
+
+static inline bool
tsi_one_before_end_p (tree_stmt_iterator i)
{
return i.ptr != NULL && i.ptr->next == NULL;
}
+static inline bool
+ctsi_one_before_end_p (const_tree_stmt_iterator i)
+{
+ return i.ptr != NULL && i.ptr->next == NULL;
+}
+
static inline void
tsi_next (tree_stmt_iterator *i)
{
}
static inline void
+ctsi_next (const_tree_stmt_iterator *i)
+{
+ i->ptr = i->ptr->next;
+}
+
+static inline void
tsi_prev (tree_stmt_iterator *i)
{
i->ptr = i->ptr->prev;
}
+static inline void
+ctsi_prev (const_tree_stmt_iterator *i)
+{
+ i->ptr = i->ptr->prev;
+}
+
static inline tree *
tsi_stmt_ptr (tree_stmt_iterator i)
{
return i.ptr->stmt;
}
+static inline const_tree
+ctsi_stmt (const_tree_stmt_iterator i)
+{
+ return i.ptr->stmt;
+}
+
enum tsi_iterator_update
{
TSI_NEW_STMT, /* Only valid when single statement is added, move
analyze, then give up. */
tree
-get_loop_exit_condition (struct loop *loop)
+get_loop_exit_condition (const struct loop *loop)
{
tree res = NULL_TREE;
edge exit_edge = single_exit (loop);
extern tree number_of_latch_executions (struct loop *);
extern tree number_of_exit_cond_executions (struct loop *);
-extern tree get_loop_exit_condition (struct loop *);
+extern tree get_loop_exit_condition (const struct loop *);
extern void scev_initialize (void);
extern void scev_reset (void);
/* Returns true if EXIT is the only possible exit from LOOP. */
static bool
-loop_only_exit_p (struct loop *loop, edge exit)
+loop_only_exit_p (const struct loop *loop, const_edge exit)
{
basic_block *body;
block_stmt_iterator bsi;
be nonnegative. */
static double_int
-derive_constant_upper_bound (tree val)
+derive_constant_upper_bound (const_tree val)
{
tree type = TREE_TYPE (val);
tree op0, op1, subtype, maxt;
/* Return TRUE if block BB has no executable statements, otherwise return
FALSE. */
bool
-empty_block_p (basic_block bb)
+empty_block_p (const_basic_block bb)
{
- block_stmt_iterator bsi;
+ const_block_stmt_iterator bsi;
/* BB must have no executable statements. */
- bsi = bsi_start (bb);
- while (!bsi_end_p (bsi)
- && (TREE_CODE (bsi_stmt (bsi)) == LABEL_EXPR
- || IS_EMPTY_STMT (bsi_stmt (bsi))))
- bsi_next (&bsi);
+ bsi = cbsi_start (bb);
+ while (!cbsi_end_p (bsi)
+ && (TREE_CODE (cbsi_stmt (bsi)) == LABEL_EXPR
+ || IS_EMPTY_STMT (cbsi_stmt (bsi))))
+ cbsi_next (&bsi);
- if (!bsi_end_p (bsi))
+ if (!cbsi_end_p (bsi))
return false;
return true;
is one, this is equivalent to a "forwarder" block. */
static bool
-redirection_block_p (basic_block bb)
+redirection_block_p (const_basic_block bb)
{
- block_stmt_iterator bsi;
+ const_block_stmt_iterator bsi;
/* Advance to the first executable statement. */
- bsi = bsi_start (bb);
- while (!bsi_end_p (bsi)
- && (TREE_CODE (bsi_stmt (bsi)) == LABEL_EXPR
- || IS_EMPTY_STMT (bsi_stmt (bsi))))
- bsi_next (&bsi);
+ bsi = cbsi_start (bb);
+ while (!cbsi_end_p (bsi)
+ && (TREE_CODE (cbsi_stmt (bsi)) == LABEL_EXPR
+ || IS_EMPTY_STMT (cbsi_stmt (bsi))))
+ cbsi_next (&bsi);
/* Check if this is an empty block. */
- if (bsi_end_p (bsi))
+ if (cbsi_end_p (bsi))
return true;
/* Test that we've reached the terminating control statement. */
- return bsi_stmt (bsi)
- && (TREE_CODE (bsi_stmt (bsi)) == COND_EXPR
- || TREE_CODE (bsi_stmt (bsi)) == GOTO_EXPR
- || TREE_CODE (bsi_stmt (bsi)) == SWITCH_EXPR);
+ return cbsi_stmt (bsi)
+ && (TREE_CODE (cbsi_stmt (bsi)) == COND_EXPR
+ || TREE_CODE (cbsi_stmt (bsi)) == GOTO_EXPR
+ || TREE_CODE (cbsi_stmt (bsi)) == SWITCH_EXPR);
}
/* BB is a block which ends with a COND_EXPR or SWITCH_EXPR and when BB
*/
bool
-slpeel_can_duplicate_loop_p (struct loop *loop, edge e)
+slpeel_can_duplicate_loop_p (const struct loop *loop, const_edge e)
{
edge exit_e = single_exit (loop);
edge entry_e = loop_preheader_edge (loop);
extern struct loop *slpeel_tree_peel_loop_to_edge
(struct loop *, edge, tree, tree, bool, unsigned int);
extern void slpeel_make_loop_iterate_ntimes (struct loop *, tree);
-extern bool slpeel_can_duplicate_loop_p (struct loop *, edge);
+extern bool slpeel_can_duplicate_loop_p (const struct loop *, const_edge);
#ifdef ENABLE_CHECKING
extern void slpeel_verify_cfg_after_peeling (struct loop *, struct loop *);
#endif
/* Return true, if the bitmaps B1 and B2 are equal. */
static inline bool
-vrp_bitmap_equal_p (bitmap b1, bitmap b2)
+vrp_bitmap_equal_p (const_bitmap b1, const_bitmap b2)
{
return (b1 == b2
|| (b1 && b2
precision of the type are returned instead. */
void
-get_type_static_bounds (tree type, mpz_t min, mpz_t max)
+get_type_static_bounds (const_tree type, mpz_t min, mpz_t max)
{
if (!POINTER_TYPE_P (type) && TYPE_MIN_VALUE (type)
&& TREE_CODE (TYPE_MIN_VALUE (type)) == INTEGER_CST)
extern tree convert (tree, tree);
extern unsigned int expr_align (const_tree);
extern tree expr_first (tree);
+extern const_tree const_expr_first (const_tree);
extern tree expr_last (tree);
+extern const_tree const_expr_last (const_tree);
extern tree expr_only (tree);
+extern const_tree const_expr_only (const_tree);
extern tree size_in_bytes (tree);
extern HOST_WIDE_INT int_size_in_bytes (const_tree);
extern HOST_WIDE_INT max_int_size_in_bytes (tree);
/* In tree.c */
extern int really_constant_p (const_tree);
extern int int_fits_type_p (const_tree, const_tree);
-extern void get_type_static_bounds (tree, mpz_t, mpz_t);
+extern void get_type_static_bounds (const_tree, mpz_t, mpz_t);
extern bool variably_modified_type_p (tree, tree);
extern int tree_log2 (const_tree);
extern int tree_floor_log2 (const_tree);