+2007-08-26 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * alias.c (memory_modified_1, memory_modified_in_insn_p):
+ Constify.
+ * basic-block.h (tree_predicted_by_p, rtl_predicted_by_p):
+ Likewise.
+ * bb-reorder.c (copy_bb_p): Likewise.
+ * cfghooks.c (can_remove_branch_p, can_merge_blocks_p,
+ predicted_by_p, can_duplicate_block_p, block_ends_with_call_p,
+ block_ends_with_condjump_p): Likewise.
+ * cfghooks.h (can_remove_branch_p, can_merge_blocks_p,
+ predicted_by_p, can_duplicate_block_p, block_ends_with_call_p,
+ block_ends_with_condjump_p): Likewise.
+ * cfglayout.c (cfg_layout_can_duplicate_bb_p): Likewise.
+ * cfgrtl.c (can_delete_note_p, can_delete_label_p,
+ rtl_can_merge_blocks, cfg_layout_can_merge_blocks_p,
+ rtl_block_ends_with_call_p, rtl_block_ends_with_condjump_p,
+ need_fake_edge_p, rtl_can_remove_branch_p): Likewise.
+ * dbxout.c (dbx_debug_hooks, xcoff_debug_hooks): Use
+ debug_true_const_tree instad of debug_true_tree.
+ * debug.c (do_nothing_debug_hooks): Likewise.
+ * debug.h (ignore_block, debug_true_const_tree): Constify.
+ * dwarf2out.c (stack_adjust_offset, clobbers_queued_reg_save,
+ dwarf2out_ignore_block, is_pseudo_reg, is_tagged_type,
+ decl_ultimate_origin, block_ultimate_origin, lookup_decl_loc,
+ same_dw_val_p, add_ranges, is_subrange_type, type_is_enum,
+ dbx_reg_number, is_based_loc, field_type,
+ simple_type_align_in_bits, simple_decl_align_in_bits,
+ simple_type_size_in_bits, field_byte_offset, insert_float,
+ type_tag, member_declared_type, is_redundant_typedef,
+ secname_for_decl, is_inlined_entry_point): Likewise.
+ * emit-rtl.c (const_next_insn, const_previous_insn,
+ const_next_nonnote_insn, const_prev_nonnote_insn,
+ const_next_real_insn, const_prev_real_insn,
+ const_next_active_insn, const_prev_active_insn, const_next_label,
+ const_prev_label): Likewise.
+ * except.h (lookup_stmt_eh_region_fn, lookup_stmt_eh_region):
+ Likewise.
+ * haifa-sched.c (may_trap_exp, haifa_classify_insn,
+ find_set_reg_weight, no_real_insns_p, find_set_reg_weight,
+ sched_insn_is_legitimate_for_speculation_p): Likewise.
+ * jump.c (reversed_comparison_code_parts,
+ reversed_comparison_code, reversed_comparison, condjump_label):
+ Likewise.
+ * predict.c (rtl_predicted_by_p, tree_predicted_by_p): Likewise.
+ * reg-stack.c (stack_regs_mentioned_p, stack_regs_mentioned):
+ Likewise.
+ * rtl.h (const_previous_insn, const_next_insn,
+ const_prev_nonnote_insn, const_next_nonnote_insn,
+ const_prev_real_insn, const_next_real_insn,
+ const_prev_active_insn, const_next_active_insn, const_prev_label,
+ const_next_label, modified_between_p, modified_in_p,
+ const_note_storeskeep_with_call_p, condjump_label,
+ reversed_comparison, reversed_comparison_code,
+ reversed_comparison_code_parts, memory_modified_in_insn_p,
+ stack_regs_mentioned): Likewise.
+ * rtlanal.c (modified_between_p, modified_in_p, const_note_stores,
+ keep_with_call_p): Likewise.
+ * sched-deps.c (deps_may_trap_p, sched_get_condition,
+ conditions_mutex_p, sched_insns_conditions_mutex_psd_next_list,
+ sd_lists_size, sd_lists_empty_p): Likewise.
+ * sched-int.h (sched_insns_conditions_mutex_p,
+ haifa_classify_insn, no_real_insns_p,
+ sched_insn_is_legitimate_for_speculation_p, sd_next_list,
+ sd_lists_size, sd_lists_empty_p): Likewise.
+ * sdbout.c (sdb_debug_hooks): Likewise.
+ * tree-cfg.c (tree_can_merge_blocks_p, is_ctrl_altering_stmt,
+ stmt_ends_bb_p, tree_can_remove_branch_p, tree_can_duplicate_bb_p,
+ -tree_block_ends_with_call_p, tree_block_ends_with_condjump_p):
+ Likewise.
+ * tree-eh.c (lookup_stmt_eh_region_fn, lookup_stmt_eh_region,
+ tree_can_throw_internal): Likewise.
+ * tree-flow-inline.h (phi_nodes): Likewise.
+ * tree-flow.h (phi_nodesstmt_ends_bb_p, is_ctrl_altering_stmt,
+ tree_can_throw_internal, lookup_stmt_eh_region): Likewise.
+ * tree-gimple.c (const_get_call_expr_in): Likewise.
+ * tree-gimple.h (const_get_call_expr_in): Likewise.
+ * tree.c (const_lookup_attribute, attribute_list_equal,
+ attribute_list_contained): Likewise.
+ * tree.h (attribute_list_equal, attribute_list_contained,
+ const_lookup_attribute): Likewise.
+ * vmsdbgout.c (vmsdbgout_ignore_block): Likewise.
+
2007-08-26 Bernhard Fischer <aldot@gcc.gnu.org>
* tree-ssa-sccvn.c, tree-ssa-sccvn.h, tree-vn.c,
static int nonoverlapping_memrefs_p (const_rtx, const_rtx);
static int write_dependence_p (const_rtx, const_rtx, int);
-static void memory_modified_1 (rtx, const_rtx, void *);
+static void memory_modified_1 (const_rtx, const_rtx, const void *);
static void record_alias_subset (alias_set_type, alias_set_type);
/* Set up all info needed to perform alias analysis on memory references. */
to be memory reference. */
static bool memory_modified;
static void
-memory_modified_1 (rtx x, const_rtx pat ATTRIBUTE_UNUSED, void *data)
+memory_modified_1 (const_rtx x, const_rtx pat ATTRIBUTE_UNUSED, const void *data)
{
if (MEM_P (x))
{
- if (anti_dependence (x, (rtx)data) || output_dependence (x, (rtx)data))
+ if (anti_dependence (x, (const_rtx)data) || output_dependence (x, (const_rtx)data))
memory_modified = true;
}
}
/* Return true when INSN possibly modify memory contents of MEM
(i.e. address can be modified). */
bool
-memory_modified_in_insn_p (rtx mem, rtx insn)
+memory_modified_in_insn_p (const_rtx mem, const_rtx insn)
{
if (!INSN_P (insn))
return false;
memory_modified = false;
- note_stores (PATTERN (insn), memory_modified_1, mem);
+ const_note_stores (PATTERN (insn), memory_modified_1, mem);
return memory_modified;
}
extern bool maybe_hot_bb_p (const_basic_block);
extern bool probably_cold_bb_p (const_basic_block);
extern bool probably_never_executed_bb_p (const_basic_block);
-extern bool tree_predicted_by_p (basic_block, enum br_predictor);
-extern bool rtl_predicted_by_p (basic_block, enum br_predictor);
+extern bool tree_predicted_by_p (const_basic_block, enum br_predictor);
+extern bool rtl_predicted_by_p (const_basic_block, enum br_predictor);
extern void tree_predict_edge (edge, enum br_predictor, int);
extern void rtl_predict_edge (edge, enum br_predictor, int);
extern void predict_edge_def (edge, enum br_predictor, enum prediction);
static fibheapkey_t bb_to_key (basic_block);
static bool better_edge_p (const_basic_block, const_edge, int, int, int, int, const_edge);
static void connect_traces (int, struct trace *);
-static bool copy_bb_p (basic_block, int);
+static bool copy_bb_p (const_basic_block, int);
static int get_uncond_jump_length (void);
static bool push_to_next_round_p (const_basic_block, int, int, int, gcov_type);
static void find_rarely_executed_basic_blocks_and_crossing_edges (edge **,
when code size is allowed to grow by duplication. */
static bool
-copy_bb_p (basic_block bb, int code_may_grow)
+copy_bb_p (const_basic_block bb, int code_may_grow)
{
int size = 0;
int max_size = uncond_jump_length;
to the destination of the other edge going from its source. */
bool
-can_remove_branch_p (edge e)
+can_remove_branch_p (const_edge e)
{
if (!cfg_hooks->can_remove_branch_p)
internal_error ("%s does not support can_remove_branch_p",
/* Checks whether we may merge blocks BB1 and BB2. */
bool
-can_merge_blocks_p (basic_block bb1, basic_block bb2)
+can_merge_blocks_p (const_basic_block bb1, const_basic_block bb2)
{
bool ret;
}
bool
-predicted_by_p (basic_block bb, enum br_predictor predictor)
+predicted_by_p (const_basic_block bb, enum br_predictor predictor)
{
if (!cfg_hooks->predict_edge)
internal_error ("%s does not support predicted_by_p", cfg_hooks->name);
/* Returns true if we can duplicate basic block BB. */
bool
-can_duplicate_block_p (basic_block bb)
+can_duplicate_block_p (const_basic_block bb)
{
if (!cfg_hooks->can_duplicate_block_p)
internal_error ("%s does not support can_duplicate_block_p",
instructions that must stay with the call, 0 otherwise. */
bool
-block_ends_with_call_p (basic_block bb)
+block_ends_with_call_p (const_basic_block bb)
{
if (!cfg_hooks->block_ends_with_call_p)
internal_error ("%s does not support block_ends_with_call_p", cfg_hooks->name);
/* Return 1 if BB ends with a conditional branch, 0 otherwise. */
bool
-block_ends_with_condjump_p (basic_block bb)
+block_ends_with_condjump_p (const_basic_block bb)
{
if (!cfg_hooks->block_ends_with_condjump_p)
internal_error ("%s does not support block_ends_with_condjump_p",
/* Returns true if it is possible to remove the edge by redirecting it
to the destination of the other edge going from its source. */
- bool (*can_remove_branch_p) (edge);
+ bool (*can_remove_branch_p) (const_edge);
/* Remove statements corresponding to a given basic block. */
void (*delete_basic_block) (basic_block);
bool (*move_block_after) (basic_block b, basic_block a);
/* Return true when blocks A and B can be merged into single basic block. */
- bool (*can_merge_blocks_p) (basic_block a, basic_block b);
+ bool (*can_merge_blocks_p) (const_basic_block a, const_basic_block b);
/* Merge blocks A and B. */
void (*merge_blocks) (basic_block a, basic_block b);
/* Return true if the one of outgoing edges is already predicted by
PREDICTOR. */
- bool (*predicted_by_p) (basic_block bb, enum br_predictor predictor);
+ bool (*predicted_by_p) (const_basic_block bb, enum br_predictor predictor);
/* Return true when block A can be duplicated. */
- bool (*can_duplicate_block_p) (basic_block a);
+ bool (*can_duplicate_block_p) (const_basic_block a);
/* Duplicate block A. */
basic_block (*duplicate_block) (basic_block a);
/* Say whether a block ends with a call, possibly followed by some
other code that must stay with the call. */
- bool (*block_ends_with_call_p) (basic_block);
+ bool (*block_ends_with_call_p) (const_basic_block);
/* Say whether a block ends with a conditional branch. Switches
and unconditional branches do not qualify. */
- bool (*block_ends_with_condjump_p) (basic_block);
+ bool (*block_ends_with_condjump_p) (const_basic_block);
/* Add fake edges to the function exit for any non constant and non noreturn
calls, volatile inline assembly in the bitmap of blocks specified by
extern void dump_bb (basic_block, FILE *, int);
extern edge redirect_edge_and_branch (edge, basic_block);
extern basic_block redirect_edge_and_branch_force (edge, basic_block);
-extern bool can_remove_branch_p (edge);
+extern bool can_remove_branch_p (const_edge);
extern void remove_branch (edge);
extern void remove_edge (edge);
extern edge split_block (basic_block, void *);
extern basic_block split_edge (edge);
extern basic_block create_basic_block (void *, void *, basic_block);
extern basic_block create_empty_bb (basic_block);
-extern bool can_merge_blocks_p (basic_block, basic_block);
+extern bool can_merge_blocks_p (const_basic_block, const_basic_block);
extern void merge_blocks (basic_block, basic_block);
extern edge make_forwarder_block (basic_block, bool (*)(edge),
void (*) (basic_block));
extern void tidy_fallthru_edge (edge);
extern void tidy_fallthru_edges (void);
extern void predict_edge (edge e, enum br_predictor predictor, int probability);
-extern bool predicted_by_p (basic_block bb, enum br_predictor predictor);
-extern bool can_duplicate_block_p (basic_block);
+extern bool predicted_by_p (const_basic_block bb, enum br_predictor predictor);
+extern bool can_duplicate_block_p (const_basic_block);
extern basic_block duplicate_block (basic_block, edge, basic_block);
-extern bool block_ends_with_call_p (basic_block bb);
-extern bool block_ends_with_condjump_p (basic_block bb);
+extern bool block_ends_with_call_p (const_basic_block bb);
+extern bool block_ends_with_condjump_p (const_basic_block bb);
extern int flow_call_edges_add (sbitmap);
extern void execute_on_growing_pred (edge);
extern void execute_on_shrinking_pred (edge);
only be used through the cfghooks interface, and we do not want to move
it to cfgrtl.c since it would require also moving quite a lot of related
code. */
-extern bool cfg_layout_can_duplicate_bb_p (basic_block);
+extern bool cfg_layout_can_duplicate_bb_p (const_basic_block);
bool
-cfg_layout_can_duplicate_bb_p (basic_block bb)
+cfg_layout_can_duplicate_bb_p (const_basic_block bb)
{
/* Do not attempt to duplicate tablejumps, as we need to unshare
the dispatch table. This is difficult to do, as the instructions
#include "tree-pass.h"
#include "df.h"
-static int can_delete_note_p (rtx);
-static int can_delete_label_p (rtx);
+static int can_delete_note_p (const_rtx);
+static int can_delete_label_p (const_rtx);
static void commit_one_edge_insertion (edge);
static basic_block rtl_split_edge (edge);
static bool rtl_move_block_after (basic_block, basic_block);
so that we may simply delete it. */
static int
-can_delete_note_p (rtx note)
+can_delete_note_p (const_rtx note)
{
return (NOTE_KIND (note) == NOTE_INSN_DELETED
|| NOTE_KIND (note) == NOTE_INSN_BASIC_BLOCK);
/* True if a given label can be deleted. */
static int
-can_delete_label_p (rtx label)
+can_delete_label_p (const_rtx label)
{
return (!LABEL_PRESERVE_P (label)
/* User declared labels must be preserved. */
/* Return true when block A and B can be merged. */
static bool
-rtl_can_merge_blocks (basic_block a,basic_block b)
+
+rtl_can_merge_blocks (const_basic_block a, const_basic_block b)
{
/* If we are partitioning hot/cold basic blocks, we don't want to
mess up unconditional or indirect jumps that cross between hot
/* Return true when blocks A and B can be safely merged. */
static bool
-cfg_layout_can_merge_blocks_p (basic_block a, basic_block b)
+cfg_layout_can_merge_blocks_p (const_basic_block a, const_basic_block b)
{
/* If we are partitioning hot/cold basic blocks, we don't want to
mess up unconditional or indirect jumps that cross between hot
instructions that must stay with the call, 0 otherwise. */
static bool
-rtl_block_ends_with_call_p (basic_block bb)
+rtl_block_ends_with_call_p (const_basic_block bb)
{
rtx insn = BB_END (bb);
/* Return 1 if BB ends with a conditional branch, 0 otherwise. */
static bool
-rtl_block_ends_with_condjump_p (basic_block bb)
+rtl_block_ends_with_condjump_p (const_basic_block bb)
{
return any_condjump_p (BB_END (bb));
}
Helper function for rtl_flow_call_edges_add. */
static bool
-need_fake_edge_p (rtx insn)
+need_fake_edge_p (const_rtx insn)
{
if (!INSN_P (insn))
return false;
it to the destination of the other edge from E->src. */
static bool
-rtl_can_remove_branch_p (edge e)
+rtl_can_remove_branch_p (const_edge e)
{
- basic_block src = e->src;
- basic_block target = EDGE_SUCC (src, EDGE_SUCC (src, 0) == e)->dest;
- rtx insn = BB_END (src), set;
+ const_basic_block src = e->src;
+ const_basic_block target = EDGE_SUCC (src, EDGE_SUCC (src, 0) == e)->dest;
+ const_rtx insn = BB_END (src), set;
/* The conditions are taken from try_redirect_by_replacing_jump. */
if (target == EXIT_BLOCK_PTR)
should only be used through the cfghooks interface, and we do not want to
move them here since it would require also moving quite a lot of related
code. They are in cfglayout.c. */
-extern bool cfg_layout_can_duplicate_bb_p (basic_block);
+extern bool cfg_layout_can_duplicate_bb_p (const_basic_block);
extern basic_block cfg_layout_duplicate_bb (basic_block);
struct cfg_hooks cfg_layout_rtl_cfg_hooks = {
dbxout_end_source_file,
dbxout_begin_block,
dbxout_end_block,
- debug_true_tree, /* ignore_block */
+ debug_true_const_tree, /* ignore_block */
dbxout_source_line, /* source_line */
dbxout_begin_prologue, /* begin_prologue */
debug_nothing_int_charstar, /* end_prologue */
dbxout_end_source_file,
xcoffout_begin_block,
xcoffout_end_block,
- debug_true_tree, /* ignore_block */
+ debug_true_const_tree, /* ignore_block */
xcoffout_source_line,
xcoffout_begin_prologue, /* begin_prologue */
debug_nothing_int_charstar, /* end_prologue */
debug_nothing_int,
debug_nothing_int_int, /* begin_block */
debug_nothing_int_int, /* end_block */
- debug_true_tree, /* ignore_block */
+ debug_true_const_tree, /* ignore_block */
debug_nothing_int_charstar, /* source_line */
debug_nothing_int_charstar, /* begin_prologue */
debug_nothing_int_charstar, /* end_prologue */
}
bool
-debug_true_tree (tree block ATTRIBUTE_UNUSED)
+debug_true_const_tree (const_tree block ATTRIBUTE_UNUSED)
{
return true;
}
instructions. This may not be the case for blocks containing
nested functions, since we may actually call such a function even
though the BLOCK information is messed up. Defaults to true. */
- bool (* ignore_block) (tree);
+ bool (* ignore_block) (const_tree);
/* Record a source file location at (FILE, LINE). */
void (* source_line) (unsigned int line, const char *file);
extern void debug_nothing_tree (tree);
extern void debug_nothing_tree_int (tree, int);
extern void debug_nothing_tree_tree (tree, tree);
-extern bool debug_true_tree (tree);
+extern bool debug_true_const_tree (const_tree);
extern void debug_nothing_rtx (rtx);
/* Hooks for various debug formats. */
#ifdef DWARF2_UNWIND_INFO
static void initial_return_save (rtx);
#endif
-static HOST_WIDE_INT stack_adjust_offset (rtx);
+static HOST_WIDE_INT stack_adjust_offset (const_rtx);
static void output_cfi (dw_cfi_ref, dw_fde_ref, int);
static void output_call_frame_info (int);
static void dwarf2out_stack_adjust (rtx, bool);
static void flush_queued_reg_saves (void);
-static bool clobbers_queued_reg_save (rtx);
+static bool clobbers_queued_reg_save (const_rtx);
static void dwarf2out_frame_debug_expr (rtx, const char *);
/* Support for complex CFA locations. */
contains. */
static HOST_WIDE_INT
-stack_adjust_offset (rtx pattern)
+stack_adjust_offset (const_rtx pattern)
{
- rtx src = SET_SRC (pattern);
- rtx dest = SET_DEST (pattern);
+ const_rtx src = SET_SRC (pattern);
+ const_rtx dest = SET_DEST (pattern);
HOST_WIDE_INT offset = 0;
enum rtx_code code;
have a new location for? */
static bool
-clobbers_queued_reg_save (rtx insn)
+clobbers_queued_reg_save (const_rtx insn)
{
struct queued_reg_save *q;
static void dwarf2out_end_source_file (unsigned);
static void dwarf2out_begin_block (unsigned, unsigned);
static void dwarf2out_end_block (unsigned, unsigned);
-static bool dwarf2out_ignore_block (tree);
+static bool dwarf2out_ignore_block (const_tree);
static void dwarf2out_global_decl (tree);
static void dwarf2out_type_decl (tree, int);
static void dwarf2out_imported_module_or_decl (tree, tree);
/* Forward declarations for functions defined in this file. */
-static int is_pseudo_reg (rtx);
+static int is_pseudo_reg (const_rtx);
static tree type_main_variant (tree);
-static int is_tagged_type (tree);
+static int is_tagged_type (const_tree);
static const char *dwarf_tag_name (unsigned);
static const char *dwarf_attr_name (unsigned);
static const char *dwarf_form_name (unsigned);
-static tree decl_ultimate_origin (tree);
-static tree block_ultimate_origin (tree);
+static tree decl_ultimate_origin (const_tree);
+static tree block_ultimate_origin (const_tree);
static tree decl_class_context (tree);
static void add_dwarf_attr (dw_die_ref, dw_attr_ref);
static inline enum dw_val_class AT_class (dw_attr_ref);
static dw_die_ref lookup_decl_die (tree);
static hashval_t decl_loc_table_hash (const void *);
static int decl_loc_table_eq (const void *, const void *);
-static var_loc_list *lookup_decl_loc (tree);
+static var_loc_list *lookup_decl_loc (const_tree);
static void equate_decl_number_to_die (tree, dw_die_ref);
static void add_var_loc_to_decl (tree, struct var_loc_node *);
static void print_spaces (FILE *);
static void attr_checksum (dw_attr_ref, struct md5_ctx *, int *);
static void die_checksum (dw_die_ref, struct md5_ctx *, int *);
static int same_loc_p (dw_loc_descr_ref, dw_loc_descr_ref, int *);
-static int same_dw_val_p (dw_val_node *, dw_val_node *, int *);
+static int same_dw_val_p (const dw_val_node *, const dw_val_node *, int *);
static int same_attr_p (dw_attr_ref, dw_attr_ref, int *);
static int same_die_p (dw_die_ref, dw_die_ref, int *);
static int same_die_p_wrap (dw_die_ref, dw_die_ref);
static void add_arange (tree, dw_die_ref);
static void output_aranges (void);
static unsigned int add_ranges_num (int);
-static unsigned int add_ranges (tree);
+static unsigned int add_ranges (const_tree);
static unsigned int add_ranges_by_labels (const char *, const char *);
static void output_ranges (void);
static void output_line_info (void);
static void output_file_names (void);
static dw_die_ref base_type_die (tree);
static int is_base_type (tree);
-static bool is_subrange_type (tree);
+static bool is_subrange_type (const_tree);
static dw_die_ref subrange_type_die (tree, dw_die_ref);
static dw_die_ref modified_type_die (tree, int, int, dw_die_ref);
-static int type_is_enum (tree);
-static unsigned int dbx_reg_number (rtx);
+static int type_is_enum (const_tree);
+static unsigned int dbx_reg_number (const_rtx);
static void add_loc_descr_op_piece (dw_loc_descr_ref *, int);
static dw_loc_descr_ref reg_loc_descriptor (rtx, enum var_init_status);
static dw_loc_descr_ref one_reg_loc_descriptor (unsigned int,
static dw_loc_descr_ref int_loc_descriptor (HOST_WIDE_INT);
static dw_loc_descr_ref based_loc_descr (rtx, HOST_WIDE_INT,
enum var_init_status);
-static int is_based_loc (rtx);
+static int is_based_loc (const_rtx);
static dw_loc_descr_ref mem_loc_descriptor (rtx, enum machine_mode mode,
enum var_init_status);
static dw_loc_descr_ref concat_loc_descriptor (rtx, rtx,
static dw_loc_descr_ref loc_descriptor_from_tree_1 (tree, int);
static dw_loc_descr_ref loc_descriptor_from_tree (tree);
static HOST_WIDE_INT ceiling (HOST_WIDE_INT, unsigned int);
-static tree field_type (tree);
-static unsigned int simple_type_align_in_bits (tree);
-static unsigned int simple_decl_align_in_bits (tree);
-static unsigned HOST_WIDE_INT simple_type_size_in_bits (tree);
-static HOST_WIDE_INT field_byte_offset (tree);
+static tree field_type (const_tree);
+static unsigned int simple_type_align_in_bits (const_tree);
+static unsigned int simple_decl_align_in_bits (const_tree);
+static unsigned HOST_WIDE_INT simple_type_size_in_bits (const_tree);
+static HOST_WIDE_INT field_byte_offset (const_tree);
static void add_AT_location_description (dw_die_ref, enum dwarf_attribute,
dw_loc_descr_ref);
static void add_data_member_location_attribute (dw_die_ref, tree);
static void add_const_value_attribute (dw_die_ref, rtx);
static void insert_int (HOST_WIDE_INT, unsigned, unsigned char *);
static HOST_WIDE_INT extract_int (const unsigned char *, unsigned);
-static void insert_float (rtx, unsigned char *);
+static void insert_float (const_rtx, unsigned char *);
static rtx rtl_for_decl_location (tree);
static void add_location_or_const_value_attribute (dw_die_ref, tree,
enum dwarf_attribute);
static inline int class_or_namespace_scope_p (dw_die_ref);
static void add_type_attribute (dw_die_ref, tree, int, int, dw_die_ref);
static void add_calling_convention_attribute (dw_die_ref, tree);
-static const char *type_tag (tree);
-static tree member_declared_type (tree);
+static const char *type_tag (const_tree);
+static tree member_declared_type (const_tree);
#if 0
static const char *decl_start_label (tree);
#endif
static void gen_tagged_type_instantiation_die (tree, dw_die_ref);
static void gen_block_die (tree, dw_die_ref, int);
static void decls_for_scope (tree, dw_die_ref, int);
-static int is_redundant_typedef (tree);
+static int is_redundant_typedef (const_tree);
static void gen_namespace_die (tree);
static void gen_decl_die (tree, dw_die_ref);
static dw_die_ref force_decl_die (tree);
/* Test if rtl node points to a pseudo register. */
static inline int
-is_pseudo_reg (rtx rtl)
+is_pseudo_reg (const_rtx rtl)
{
return ((REG_P (rtl) && REGNO (rtl) >= FIRST_PSEUDO_REGISTER)
|| (GET_CODE (rtl) == SUBREG
/* Return nonzero if the given type node represents a tagged type. */
static inline int
-is_tagged_type (tree type)
+is_tagged_type (const_tree type)
{
enum tree_code code = TREE_CODE (type);
given block. */
static tree
-decl_ultimate_origin (tree decl)
+decl_ultimate_origin (const_tree decl)
{
if (!CODE_CONTAINS_STRUCT (TREE_CODE (decl), TS_DECL_COMMON))
return NULL_TREE;
given block. */
static tree
-block_ultimate_origin (tree block)
+block_ultimate_origin (const_tree block)
{
tree immediate_origin = BLOCK_ABSTRACT_ORIGIN (block);
/* Return the var_loc list associated with a given declaration. */
static inline var_loc_list *
-lookup_decl_loc (tree decl)
+lookup_decl_loc (const_tree decl)
{
return htab_find_with_hash (decl_loc_table, decl, DECL_UID (decl));
}
/* Do the values look the same? */
static int
-same_dw_val_p (dw_val_node *v1, dw_val_node *v2, int *mark)
+same_dw_val_p (const dw_val_node *v1, const dw_val_node *v2, int *mark)
{
dw_loc_descr_ref loc1, loc2;
rtx r1, r2;
range terminator if BLOCK is NULL. */
static unsigned int
-add_ranges (tree block)
+add_ranges (const_tree block)
{
return add_ranges_num (block ? BLOCK_NUMBER (block) : 0);
}
ERROR_MARK node. */
static inline unsigned HOST_WIDE_INT
-simple_type_size_in_bits (tree type)
+simple_type_size_in_bits (const_tree type)
{
if (TREE_CODE (type) == ERROR_MARK)
return BITS_PER_WORD;
emitted as a subrange type. */
static inline bool
-is_subrange_type (tree type)
+is_subrange_type (const_tree type)
{
tree subtype = TREE_TYPE (type);
an enumerated type. */
static inline int
-type_is_enum (tree type)
+type_is_enum (const_tree type)
{
return TREE_CODE (type) == ENUMERAL_TYPE;
}
/* Return the DBX register number described by a given RTL node. */
static unsigned int
-dbx_reg_number (rtx rtl)
+dbx_reg_number (const_rtx rtl)
{
unsigned regno = REGNO (rtl);
/* Return true if this RTL expression describes a base+offset calculation. */
static inline int
-is_based_loc (rtx rtl)
+is_based_loc (const_rtx rtl)
{
return (GET_CODE (rtl) == PLUS
&& ((REG_P (XEXP (rtl, 0))
ERROR_MARK node. */
static inline tree
-field_type (tree decl)
+field_type (const_tree decl)
{
tree type;
be an ERROR_MARK node. */
static inline unsigned
-simple_type_align_in_bits (tree type)
+simple_type_align_in_bits (const_tree type)
{
return (TREE_CODE (type) != ERROR_MARK) ? TYPE_ALIGN (type) : BITS_PER_WORD;
}
static inline unsigned
-simple_decl_align_in_bits (tree decl)
+simple_decl_align_in_bits (const_tree decl)
{
return (TREE_CODE (decl) != ERROR_MARK) ? DECL_ALIGN (decl) : BITS_PER_WORD;
}
just yet). */
static HOST_WIDE_INT
-field_byte_offset (tree decl)
+field_byte_offset (const_tree decl)
{
HOST_WIDE_INT object_offset_in_bits;
HOST_WIDE_INT bitpos_int;
/* Writes floating point values to dw_vec_const array. */
static void
-insert_float (rtx rtl, unsigned char *array)
+insert_float (const_rtx rtl, unsigned char *array)
{
REAL_VALUE_TYPE rv;
long val[4];
XXX: If you split a variable across multiple sections, we won't notice. */
static const char *
-secname_for_decl (tree decl)
+secname_for_decl (const_tree decl)
{
const char *secname;
was declared without a tag. */
static const char *
-type_tag (tree type)
+type_tag (const_tree type)
{
const char *name = 0;
for bit field types. */
static inline tree
-member_declared_type (tree member)
+member_declared_type (const_tree member)
{
return (DECL_BIT_FIELD_TYPE (member)
? DECL_BIT_FIELD_TYPE (member) : TREE_TYPE (member));
first subblock's abstract origin is the function's outermost block,
then we're looking at the main entry point. */
static bool
-is_inlined_entry_point (tree stmt)
+is_inlined_entry_point (const_tree stmt)
{
tree decl, block;
/* Is this a typedef we can avoid emitting? */
static inline int
-is_redundant_typedef (tree decl)
+is_redundant_typedef (const_tree decl)
{
if (TYPE_DECL_IS_STUB (decl))
return 1;
we may end up calling them anyway. */
static bool
-dwarf2out_ignore_block (tree block)
+dwarf2out_ignore_block (const_tree block)
{
tree decl;
/* Return the next insn. If it is a SEQUENCE, return the first insn
of the sequence. */
+#define NEXT_INSN_BODY do { \
+ if (insn) \
+ { \
+ insn = NEXT_INSN (insn); \
+ if (insn && NONJUMP_INSN_P (insn) \
+ && GET_CODE (PATTERN (insn)) == SEQUENCE) \
+ insn = XVECEXP (PATTERN (insn), 0, 0); \
+ } \
+ return insn; \
+} while (0)
+
rtx
next_insn (rtx insn)
{
- if (insn)
- {
- insn = NEXT_INSN (insn);
- if (insn && NONJUMP_INSN_P (insn)
- && GET_CODE (PATTERN (insn)) == SEQUENCE)
- insn = XVECEXP (PATTERN (insn), 0, 0);
- }
+ NEXT_INSN_BODY;
+}
- return insn;
+const_rtx
+const_next_insn (const_rtx insn)
+{
+ NEXT_INSN_BODY;
}
+#undef NEXT_INSN_BODY
+
/* Return the previous insn. If it is a SEQUENCE, return the last insn
of the sequence. */
+#define PREVIOUS_INSN_BODY do { \
+ if (insn) \
+ { \
+ insn = PREV_INSN (insn); \
+ if (insn && NONJUMP_INSN_P (insn) \
+ && GET_CODE (PATTERN (insn)) == SEQUENCE) \
+ insn = XVECEXP (PATTERN (insn), 0, XVECLEN (PATTERN (insn), 0) - 1); \
+ } \
+ return insn; \
+} while (0)
+
rtx
previous_insn (rtx insn)
{
- if (insn)
- {
- insn = PREV_INSN (insn);
- if (insn && NONJUMP_INSN_P (insn)
- && GET_CODE (PATTERN (insn)) == SEQUENCE)
- insn = XVECEXP (PATTERN (insn), 0, XVECLEN (PATTERN (insn), 0) - 1);
- }
+ PREVIOUS_INSN_BODY;
+}
- return insn;
+const_rtx
+const_previous_insn (const_rtx insn)
+{
+ PREVIOUS_INSN_BODY;
}
+#undef PREVIOUS_INSN_BODY
+
/* Return the next insn after INSN that is not a NOTE. This routine does not
look inside SEQUENCEs. */
+#define NEXT_NONNOTE_INSN_BODY do { \
+ while (insn) \
+ { \
+ insn = NEXT_INSN (insn); \
+ if (insn == 0 || !NOTE_P (insn)) \
+ break; \
+ } \
+ return insn; \
+} while (0)
+
rtx
next_nonnote_insn (rtx insn)
{
- while (insn)
- {
- insn = NEXT_INSN (insn);
- if (insn == 0 || !NOTE_P (insn))
- break;
- }
+ NEXT_NONNOTE_INSN_BODY;
+}
- return insn;
+const_rtx
+const_next_nonnote_insn (const_rtx insn)
+{
+ NEXT_NONNOTE_INSN_BODY;
}
+#undef NEXT_NONNOTE_INSN_BODY
+
/* Return the previous insn before INSN that is not a NOTE. This routine does
not look inside SEQUENCEs. */
+#define PREV_NONNOTE_INSN_BODY do { \
+ while (insn) \
+ { \
+ insn = PREV_INSN (insn); \
+ if (insn == 0 || !NOTE_P (insn)) \
+ break; \
+ } \
+ return insn; \
+} while (0)
+
rtx
prev_nonnote_insn (rtx insn)
{
- while (insn)
- {
- insn = PREV_INSN (insn);
- if (insn == 0 || !NOTE_P (insn))
- break;
- }
+ PREV_NONNOTE_INSN_BODY;
+}
- return insn;
+const_rtx
+const_prev_nonnote_insn (const_rtx insn)
+{
+ PREV_NONNOTE_INSN_BODY;
}
+#undef PREV_NONNOTE_INSN_BODY
+
/* Return the next INSN, CALL_INSN or JUMP_INSN after INSN;
or 0, if there is none. This routine does not look inside
SEQUENCEs. */
+#define NEXT_REAL_INSN_BODY do { \
+ while (insn) \
+ { \
+ insn = NEXT_INSN (insn); \
+ if (insn == 0 || INSN_P (insn)) \
+ break; \
+ } \
+ return insn; \
+} while (0)
+
rtx
next_real_insn (rtx insn)
{
- while (insn)
- {
- insn = NEXT_INSN (insn);
- if (insn == 0 || INSN_P (insn))
- break;
- }
+ NEXT_REAL_INSN_BODY;
+}
- return insn;
+const_rtx
+const_next_real_insn (const_rtx insn)
+{
+ NEXT_REAL_INSN_BODY;
}
+#undef NEXT_REAL_INSN_BODY
+
/* Return the last INSN, CALL_INSN or JUMP_INSN before INSN;
or 0, if there is none. This routine does not look inside
SEQUENCEs. */
+#define PREV_REAL_INSN_BODY do { \
+ while (insn) \
+ { \
+ insn = PREV_INSN (insn); \
+ if (insn == 0 || INSN_P (insn)) \
+ break; \
+ } \
+ return insn; \
+} while (0)
+
rtx
prev_real_insn (rtx insn)
{
- while (insn)
- {
- insn = PREV_INSN (insn);
- if (insn == 0 || INSN_P (insn))
- break;
- }
+ PREV_REAL_INSN_BODY;
+}
- return insn;
+const_rtx
+const_prev_real_insn (const_rtx insn)
+{
+ PREV_REAL_INSN_BODY;
}
+#undef PREV_REAL_INSN_BODY
+
/* Return the last CALL_INSN in the current list, or 0 if there is none.
This routine does not look inside SEQUENCEs. */
&& GET_CODE (PATTERN (insn)) != CLOBBER))));
}
+#define NEXT_ACTIVE_INSN_BODY do { \
+ while (insn) \
+ { \
+ insn = NEXT_INSN (insn); \
+ if (insn == 0 || active_insn_p (insn)) \
+ break; \
+ } \
+ return insn;\
+} while (0)
+
rtx
next_active_insn (rtx insn)
{
- while (insn)
- {
- insn = NEXT_INSN (insn);
- if (insn == 0 || active_insn_p (insn))
- break;
- }
+ NEXT_ACTIVE_INSN_BODY;
+}
- return insn;
+const_rtx
+const_next_active_insn (const_rtx insn)
+{
+ NEXT_ACTIVE_INSN_BODY;
}
+#undef NEXT_ACTIVE_INSN_BODY
+
/* Find the last insn before INSN that really does something. This routine
does not look inside SEQUENCEs. Until reload has completed, this is the
same as prev_real_insn. */
+#define PREV_ACTIVE_INSN_BODY do { \
+ while (insn) \
+ { \
+ insn = PREV_INSN (insn);\
+ if (insn == 0 || active_insn_p (insn)) \
+ break; \
+ } \
+ return insn; \
+} while (0)
+
rtx
prev_active_insn (rtx insn)
{
- while (insn)
- {
- insn = PREV_INSN (insn);
- if (insn == 0 || active_insn_p (insn))
- break;
- }
+ PREV_ACTIVE_INSN_BODY;
+}
- return insn;
+const_rtx
+const_prev_active_insn (const_rtx insn)
+{
+ PREV_ACTIVE_INSN_BODY;
}
+#undef PREV_ACTIVE_INSN_BODY
+
/* Return the next CODE_LABEL after the insn INSN, or 0 if there is none. */
+#define NEXT_LABEL_BODY do { \
+ while (insn) \
+ { \
+ insn = NEXT_INSN (insn); \
+ if (insn == 0 || LABEL_P (insn)) \
+ break; \
+ } \
+ return insn; \
+} while (0)
+
rtx
next_label (rtx insn)
{
- while (insn)
- {
- insn = NEXT_INSN (insn);
- if (insn == 0 || LABEL_P (insn))
- break;
- }
+ NEXT_LABEL_BODY;
+}
- return insn;
+const_rtx
+const_next_label (const_rtx insn)
+{
+ NEXT_LABEL_BODY;
}
+#undef NEXT_LABEL_BODY
+
/* Return the last CODE_LABEL before the insn INSN, or 0 if there is none. */
+#define PREV_LABEL_BODY do { \
+ while (insn) \
+ { \
+ insn = PREV_INSN (insn); \
+ if (insn == 0 || LABEL_P (insn)) \
+ break; \
+ } \
+ return insn; \
+} while (0)
+
rtx
prev_label (rtx insn)
{
- while (insn)
- {
- insn = PREV_INSN (insn);
- if (insn == 0 || LABEL_P (insn))
- break;
- }
+ PREV_LABEL_BODY;
+}
- return insn;
+const_rtx
+const_prev_label (const_rtx insn)
+{
+ PREV_LABEL_BODY;
}
+#undef PREV_LABEL_BODY
+
/* Return the last label to mark the same position as LABEL. Return null
if LABEL itself is null. */
/* tree-eh.c */
extern void add_stmt_to_eh_region_fn (struct function *, tree, int);
extern bool remove_stmt_from_eh_region_fn (struct function *, tree);
-extern int lookup_stmt_eh_region_fn (struct function *, tree);
-extern int lookup_stmt_eh_region (tree);
+extern int lookup_stmt_eh_region_fn (struct function *, const_tree);
+extern int lookup_stmt_eh_region (const_tree);
extern bool verify_eh_edges (tree);
/* If non-NULL, this is a function that returns an expression to be
/* Number of instructions in current scheduling region. */
static int rgn_n_insns;
-static int may_trap_exp (rtx, int);
+static int may_trap_exp (const_rtx, int);
/* Nonzero iff the address is comprised from at most 1 register. */
#define CONST_BASED_ADDRESS_P(x) \
as found by analyzing insn's expression. */
static int
-may_trap_exp (rtx x, int is_store)
+may_trap_exp (const_rtx x, int is_store)
{
enum rtx_code code;
being either PFREE or PRISKY. */
int
-haifa_classify_insn (rtx insn)
+haifa_classify_insn (const_rtx insn)
{
rtx pat = PATTERN (insn);
int tmp_class = TRAP_FREE;
static void swap_sort (rtx *, int);
static void queue_insn (rtx, int);
static int schedule_insn (rtx);
-static int find_set_reg_weight (rtx);
+static int find_set_reg_weight (const_rtx);
static void find_insn_reg_weight (basic_block);
static void find_insn_reg_weight1 (rtx);
static void adjust_priority (rtx);
/* Return nonzero if there are no real insns in the range [ HEAD, TAIL ]. */
int
-no_real_insns_p (rtx head, rtx tail)
+no_real_insns_p (const_rtx head, const_rtx tail)
{
while (head != NEXT_INSN (tail))
{
a new register is not needed. */
static int
-find_set_reg_weight (rtx x)
+find_set_reg_weight (const_rtx x)
{
if (GET_CODE (x) == CLOBBER
&& register_operand (SET_DEST (x), VOIDmode))
/* Return true if INSN can potentially be speculated with type DS. */
bool
-sched_insn_is_legitimate_for_speculation_p (rtx insn, ds_t ds)
+sched_insn_is_legitimate_for_speculation_p (const_rtx insn, ds_t ds)
{
if (HAS_INTERNAL_DEP (insn))
return false;
description should define REVERSIBLE_CC_MODE and REVERSE_CONDITION macros
to help this function avoid overhead in these cases. */
enum rtx_code
-reversed_comparison_code_parts (enum rtx_code code, rtx arg0, rtx arg1, rtx insn)
+reversed_comparison_code_parts (enum rtx_code code, const_rtx arg0,
+ const_rtx arg1, const_rtx insn)
{
enum machine_mode mode;
if (GET_MODE_CLASS (mode) == MODE_CC || CC0_P (arg0))
{
- rtx prev;
+ const_rtx prev;
/* Try to search for the comparison to determine the real mode.
This code is expensive, but with sane machine description it
will be never used, since REVERSIBLE_CC_MODE will return true
if (! insn)
return UNKNOWN;
- for (prev = prev_nonnote_insn (insn);
+ for (prev = const_prev_nonnote_insn (insn);
prev != 0 && !LABEL_P (prev);
- prev = prev_nonnote_insn (prev))
+ prev = const_prev_nonnote_insn (prev))
{
const_rtx set = set_of (arg0, prev);
if (set && GET_CODE (set) == SET
/* A wrapper around the previous function to take COMPARISON as rtx
expression. This simplifies many callers. */
enum rtx_code
-reversed_comparison_code (rtx comparison, rtx insn)
+reversed_comparison_code (const_rtx comparison, const_rtx insn)
{
if (!COMPARISON_P (comparison))
return UNKNOWN;
/* Return comparison with reversed code of EXP.
Return NULL_RTX in case we fail to do the reversal. */
rtx
-reversed_comparison (rtx exp, enum machine_mode mode)
+reversed_comparison (const_rtx exp, enum machine_mode mode)
{
enum rtx_code reversed_code = reversed_comparison_code (exp, NULL_RTX);
if (reversed_code == UNKNOWN)
/* Return the label of a conditional jump. */
rtx
-condjump_label (rtx insn)
+condjump_label (const_rtx insn)
{
rtx x = pc_set (insn);
PREDICTOR. */
bool
-rtl_predicted_by_p (basic_block bb, enum br_predictor predictor)
+rtl_predicted_by_p (const_basic_block bb, enum br_predictor predictor)
{
rtx note;
if (!INSN_P (BB_END (bb)))
PREDICTOR. */
bool
-tree_predicted_by_p (basic_block bb, enum br_predictor predictor)
+tree_predicted_by_p (const_basic_block bb, enum br_predictor predictor)
{
struct edge_prediction *i;
void **preds = pointer_map_contains (bb_predictions, bb);
/* Forward declarations */
-static int stack_regs_mentioned_p (rtx pat);
+static int stack_regs_mentioned_p (const_rtx pat);
static void pop_stack (stack, int);
static rtx *get_true_reg (rtx *);
/* Return nonzero if any stack register is mentioned somewhere within PAT. */
static int
-stack_regs_mentioned_p (rtx pat)
+stack_regs_mentioned_p (const_rtx pat)
{
const char *fmt;
int i;
/* Return nonzero if INSN mentions stacked registers, else return zero. */
int
-stack_regs_mentioned (rtx insn)
+stack_regs_mentioned (const_rtx insn)
{
unsigned int uid, max;
int test;
extern void add_function_usage_to (rtx, rtx);
extern rtx last_call_insn (void);
extern rtx previous_insn (rtx);
+extern const_rtx const_previous_insn (const_rtx);
extern rtx next_insn (rtx);
+extern const_rtx const_next_insn (const_rtx);
extern rtx prev_nonnote_insn (rtx);
+extern const_rtx const_prev_nonnote_insn (const_rtx);
extern rtx next_nonnote_insn (rtx);
+extern const_rtx const_next_nonnote_insn (const_rtx);
extern rtx prev_real_insn (rtx);
+extern const_rtx const_prev_real_insn (const_rtx);
extern rtx next_real_insn (rtx);
+extern const_rtx const_next_real_insn (const_rtx);
extern rtx prev_active_insn (rtx);
+extern const_rtx const_prev_active_insn (const_rtx);
extern rtx next_active_insn (rtx);
+extern const_rtx const_next_active_insn (const_rtx);
extern int active_insn_p (const_rtx);
extern rtx prev_label (rtx);
+extern const_rtx const_prev_label (const_rtx);
extern rtx next_label (rtx);
+extern const_rtx const_next_label (const_rtx);
extern rtx skip_consecutive_labels (rtx);
extern rtx next_cc0_user (rtx);
extern rtx prev_cc0_setter (rtx);
extern int reg_set_between_p (const_rtx, const_rtx, const_rtx);
extern int commutative_operand_precedence (rtx);
extern bool swap_commutative_operands_p (rtx, rtx);
-extern int modified_between_p (rtx, rtx, rtx);
+extern int modified_between_p (const_rtx, const_rtx, const_rtx);
extern int no_labels_between_p (const_rtx, const_rtx);
-extern int modified_in_p (rtx, rtx);
+extern int modified_in_p (const_rtx, const_rtx);
extern int reg_set_p (const_rtx, const_rtx);
extern rtx single_set_2 (const_rtx, const_rtx);
extern int multiple_sets (const_rtx);
extern int reg_overlap_mentioned_p (const_rtx, const_rtx);
extern const_rtx set_of (const_rtx, const_rtx);
extern void note_stores (const_rtx, void (*) (rtx, const_rtx, void *), void *);
+extern void const_note_stores (const_rtx, void (*) (const_rtx, const_rtx, const void *), const void *);
extern void note_uses (rtx *, void (*) (rtx *, void *), void *);
extern int dead_or_set_p (const_rtx, const_rtx);
extern int dead_or_set_regno_p (const_rtx, unsigned int);
extern void remove_node_from_expr_list (const_rtx, rtx *);
extern int loc_mentioned_in_p (rtx *, const_rtx);
extern rtx find_first_parameter_load (rtx, rtx);
-extern bool keep_with_call_p (rtx);
+extern bool keep_with_call_p (const_rtx);
extern bool label_is_jump_target_p (const_rtx, const_rtx);
extern int insn_rtx_cost (rtx);
extern int any_condjump_p (const_rtx);
extern int any_uncondjump_p (const_rtx);
extern rtx pc_set (const_rtx);
-extern rtx condjump_label (rtx);
+extern rtx condjump_label (const_rtx);
extern int simplejump_p (const_rtx);
extern int returnjump_p (rtx);
extern int onlyjump_p (const_rtx);
extern void redirect_jump_2 (rtx, rtx, rtx, int, int);
extern int redirect_jump (rtx, rtx, int);
extern void rebuild_jump_labels (rtx);
-extern rtx reversed_comparison (rtx, enum machine_mode);
-extern enum rtx_code reversed_comparison_code (rtx, rtx);
-extern enum rtx_code reversed_comparison_code_parts (enum rtx_code, rtx,
- rtx, rtx);
+extern rtx reversed_comparison (const_rtx, enum machine_mode);
+extern enum rtx_code reversed_comparison_code (const_rtx, const_rtx);
+extern enum rtx_code reversed_comparison_code_parts (enum rtx_code, const_rtx,
+ const_rtx, const_rtx);
extern void delete_for_peephole (rtx, rtx);
extern int condjump_in_parallel_p (const_rtx);
extern void init_alias_once (void);
extern void init_alias_analysis (void);
extern void end_alias_analysis (void);
-extern bool memory_modified_in_insn_p (rtx, rtx);
+extern bool memory_modified_in_insn_p (const_rtx, const_rtx);
extern rtx find_base_term (rtx);
extern rtx gen_hard_reg_clobber (enum machine_mode, unsigned int);
extern rtx get_reg_known_value (unsigned int);
extern bool get_reg_known_equiv_p (unsigned int);
#ifdef STACK_REGS
-extern int stack_regs_mentioned (rtx insn);
+extern int stack_regs_mentioned (const_rtx insn);
#endif
/* In toplev.c */
X contains a MEM; this routine does usememory aliasing. */
int
-modified_between_p (rtx x, rtx start, rtx end)
+modified_between_p (const_rtx x, const_rtx start, const_rtx end)
{
- enum rtx_code code = GET_CODE (x);
+ const enum rtx_code code = GET_CODE (x);
const char *fmt;
int i, j;
rtx insn;
does use memory aliasing. */
int
-modified_in_p (rtx x, rtx insn)
+modified_in_p (const_rtx x, const_rtx insn)
{
- enum rtx_code code = GET_CODE (x);
+ const enum rtx_code code = GET_CODE (x);
const char *fmt;
int i, j;
If the item being stored in or clobbered is a SUBREG of a hard register,
the SUBREG will be passed. */
+#define NOTE_STORES_BODY(NOTE_STORES_FN) do { \
+ int i; \
+ if (GET_CODE (x) == COND_EXEC) \
+ x = COND_EXEC_CODE (x); \
+ if (GET_CODE (x) == SET || GET_CODE (x) == CLOBBER) \
+ { \
+ rtx dest = SET_DEST (x); \
+ while ((GET_CODE (dest) == SUBREG \
+ && (!REG_P (SUBREG_REG (dest)) \
+ || REGNO (SUBREG_REG (dest)) >= FIRST_PSEUDO_REGISTER)) \
+ || GET_CODE (dest) == ZERO_EXTRACT \
+ || GET_CODE (dest) == STRICT_LOW_PART) \
+ dest = XEXP (dest, 0); \
+ /* If we have a PARALLEL, SET_DEST is a list of EXPR_LIST expressions, \
+ each of whose first operand is a register. */ \
+ if (GET_CODE (dest) == PARALLEL) \
+ { \
+ for (i = XVECLEN (dest, 0) - 1; i >= 0; i--) \
+ if (XEXP (XVECEXP (dest, 0, i), 0) != 0) \
+ (*fun) (XEXP (XVECEXP (dest, 0, i), 0), x, data); \
+ } \
+ else \
+ (*fun) (dest, x, data); \
+ } \
+ else if (GET_CODE (x) == PARALLEL) \
+ for (i = XVECLEN (x, 0) - 1; i >= 0; i--) \
+ NOTE_STORES_FN (XVECEXP (x, 0, i), fun, data); \
+} while (0)
+
void
note_stores (const_rtx x, void (*fun) (rtx, const_rtx, void *), void *data)
{
- int i;
+ NOTE_STORES_BODY(note_stores);
+}
- if (GET_CODE (x) == COND_EXEC)
- x = COND_EXEC_CODE (x);
+void
+const_note_stores (const_rtx x, void (*fun) (const_rtx, const_rtx, const void *), const void *data)
+{
+ NOTE_STORES_BODY(const_note_stores);
+}
- if (GET_CODE (x) == SET || GET_CODE (x) == CLOBBER)
- {
- rtx dest = SET_DEST (x);
-
- while ((GET_CODE (dest) == SUBREG
- && (!REG_P (SUBREG_REG (dest))
- || REGNO (SUBREG_REG (dest)) >= FIRST_PSEUDO_REGISTER))
- || GET_CODE (dest) == ZERO_EXTRACT
- || GET_CODE (dest) == STRICT_LOW_PART)
- dest = XEXP (dest, 0);
-
- /* If we have a PARALLEL, SET_DEST is a list of EXPR_LIST expressions,
- each of whose first operand is a register. */
- if (GET_CODE (dest) == PARALLEL)
- {
- for (i = XVECLEN (dest, 0) - 1; i >= 0; i--)
- if (XEXP (XVECEXP (dest, 0, i), 0) != 0)
- (*fun) (XEXP (XVECEXP (dest, 0, i), 0), x, data);
- }
- else
- (*fun) (dest, x, data);
- }
+#undef NOTE_STORES_BODY
- else if (GET_CODE (x) == PARALLEL)
- for (i = XVECLEN (x, 0) - 1; i >= 0; i--)
- note_stores (XVECEXP (x, 0, i), fun, data);
-}
\f
/* Like notes_stores, but call FUN for each expression that is being
referenced in PBODY, a pointer to the PATTERN of an insn. We only call
call instruction. */
bool
-keep_with_call_p (rtx insn)
+keep_with_call_p (const_rtx insn)
{
rtx set;
if we can break or not. */
if (SET_DEST (set) == stack_pointer_rtx)
{
- rtx i2 = next_nonnote_insn (insn);
+ const_rtx i2 = const_next_nonnote_insn (insn);
if (i2 && keep_with_call_p (i2))
return true;
}
static bitmap_head *spec_dependency_cache;
static int cache_size;
-static int deps_may_trap_p (rtx);
+static int deps_may_trap_p (const_rtx);
static void add_dependence_list (rtx, rtx, int, enum reg_note);
static void add_dependence_list_and_free (rtx, rtx *, int, enum reg_note);
static void delete_all_dependences (rtx);
static void sched_analyze_2 (struct deps *, rtx, rtx);
static void sched_analyze_insn (struct deps *, rtx, rtx);
-static rtx sched_get_condition (rtx);
-static int conditions_mutex_p (rtx, rtx);
+static rtx sched_get_condition (const_rtx);
+static int conditions_mutex_p (const_rtx, const_rtx);
static enum DEPS_ADJUST_RESULT maybe_add_or_update_dep_1 (dep_t, bool,
rtx, rtx);
/* Return nonzero if a load of the memory reference MEM can cause a trap. */
static int
-deps_may_trap_p (rtx mem)
+deps_may_trap_p (const_rtx mem)
{
- rtx addr = XEXP (mem, 0);
+ const_rtx addr = XEXP (mem, 0);
if (REG_P (addr) && REGNO (addr) >= FIRST_PSEUDO_REGISTER)
{
- rtx t = get_reg_known_value (REGNO (addr));
+ const_rtx t = get_reg_known_value (REGNO (addr));
if (t)
addr = t;
}
/* Find the condition under which INSN is executed. */
static rtx
-sched_get_condition (rtx insn)
+sched_get_condition (const_rtx insn)
{
rtx pat = PATTERN (insn);
rtx src;
/* Return nonzero if conditions COND1 and COND2 can never be both true. */
static int
-conditions_mutex_p (rtx cond1, rtx cond2)
+conditions_mutex_p (const_rtx cond1, const_rtx cond2)
{
if (COMPARISON_P (cond1)
&& COMPARISON_P (cond2)
/* Return true if insn1 and insn2 can never depend on one another because
the conditions under which they are executed are mutually exclusive. */
bool
-sched_insns_conditions_mutex_p (rtx insn1, rtx insn2)
+sched_insns_conditions_mutex_p (const_rtx insn1, const_rtx insn2)
{
rtx cond1, cond2;
This function is used to switch sd_iterator to the next list.
!!! For internal use only. Might consider moving it to sched-int.h. */
void
-sd_next_list (rtx insn, sd_list_types_def *types_ptr,
+sd_next_list (const_rtx insn, sd_list_types_def *types_ptr,
deps_list_t *list_ptr, bool *resolved_p_ptr)
{
sd_list_types_def types = *types_ptr;
/* Return the summary size of INSN's lists defined by LIST_TYPES. */
int
-sd_lists_size (rtx insn, sd_list_types_def list_types)
+sd_lists_size (const_rtx insn, sd_list_types_def list_types)
{
int size = 0;
/* Return true if INSN's lists defined by LIST_TYPES are all empty. */
bool
-sd_lists_empty_p (rtx insn, sd_list_types_def list_types)
+sd_lists_empty_p (const_rtx insn, sd_list_types_def list_types)
{
return sd_lists_size (insn, list_types) == 0;
}
extern void print_insn (char *, rtx, int);
/* Functions in sched-deps.c. */
-extern bool sched_insns_conditions_mutex_p (rtx, rtx);
+extern bool sched_insns_conditions_mutex_p (const_rtx, const_rtx);
extern void add_dependence (rtx, rtx, enum reg_note);
extern void sched_analyze (struct deps *, rtx, rtx);
extern bool deps_pools_are_empty_p (void);
extern void debug_ds (ds_t);
/* Functions in haifa-sched.c. */
-extern int haifa_classify_insn (rtx);
+extern int haifa_classify_insn (const_rtx);
extern void get_ebb_head_tail (basic_block, basic_block, rtx *, rtx *);
-extern int no_real_insns_p (rtx, rtx);
+extern int no_real_insns_p (const_rtx, const_rtx);
extern void rm_other_notes (rtx, rtx);
extern int try_ready (rtx);
extern void * xrecalloc (void *, size_t, size_t, size_t);
-extern bool sched_insn_is_legitimate_for_speculation_p (rtx, ds_t);
+extern bool sched_insn_is_legitimate_for_speculation_p (const_rtx, ds_t);
extern void unlink_bb_notes (basic_block, basic_block);
extern void add_block (basic_block, basic_block);
extern rtx bb_note (basic_block);
/* A type to hold above flags. */
typedef int sd_list_types_def;
-extern void sd_next_list (rtx, sd_list_types_def *, deps_list_t *, bool *);
+extern void sd_next_list (const_rtx, sd_list_types_def *, deps_list_t *, bool *);
/* Iterator to walk through, resolve and delete dependencies. */
struct _sd_iterator
sd_iterator_cond (&(ITER), &(DEP)); \
sd_iterator_next (&(ITER)))
-extern int sd_lists_size (rtx, sd_list_types_def);
-extern bool sd_lists_empty_p (rtx, sd_list_types_def);
+extern int sd_lists_size (const_rtx, sd_list_types_def);
+extern bool sd_lists_empty_p (const_rtx, sd_list_types_def);
extern void sd_init_insn (rtx);
extern void sd_finish_insn (rtx);
extern dep_t sd_find_dep_between (rtx, rtx, bool);
sdbout_end_source_file, /* end_source_file */
sdbout_begin_block, /* begin_block */
sdbout_end_block, /* end_block */
- debug_true_tree, /* ignore_block */
+ debug_true_const_tree, /* ignore_block */
sdbout_source_line, /* source_line */
#ifdef MIPS_DEBUGGING_INFO
/* Defer on MIPS systems so that parameter descriptions follow
/* Flowgraph optimization and cleanup. */
static void tree_merge_blocks (basic_block, basic_block);
-static bool tree_can_merge_blocks_p (basic_block, basic_block);
+static bool tree_can_merge_blocks_p (const_basic_block, const_basic_block);
static void remove_bb (basic_block);
static edge find_taken_edge_computed_goto (basic_block, tree);
static edge find_taken_edge_cond_expr (basic_block, tree);
/* Checks whether we can merge block B into block A. */
static bool
-tree_can_merge_blocks_p (basic_block a, basic_block b)
+tree_can_merge_blocks_p (const_basic_block a, const_basic_block b)
{
- tree stmt;
- block_stmt_iterator bsi;
+ const_tree stmt;
+ const_block_stmt_iterator bsi;
tree phi;
if (!single_succ_p (a))
/* If A ends by a statement causing exceptions or something similar, we
cannot merge the blocks. */
- stmt = last_stmt (a);
+ stmt = const_last_stmt (a);
if (stmt && stmt_ends_bb_p (stmt))
return false;
}
/* Do not remove user labels. */
- for (bsi = bsi_start (b); !bsi_end_p (bsi); bsi_next (&bsi))
+ for (bsi = cbsi_start (b); !cbsi_end_p (bsi); cbsi_next (&bsi))
{
- stmt = bsi_stmt (bsi);
+ stmt = cbsi_stmt (bsi);
if (TREE_CODE (stmt) != LABEL_EXPR)
break;
if (!DECL_ARTIFICIAL (LABEL_EXPR_LABEL (stmt)))
(e.g., a call to a non-returning function). */
bool
-is_ctrl_altering_stmt (tree t)
+is_ctrl_altering_stmt (const_tree t)
{
- tree call;
+ const_tree call;
gcc_assert (t);
- call = get_call_expr_in (t);
+ call = const_get_call_expr_in (t);
if (call)
{
/* A non-pure/const CALL_EXPR alters flow control if the current
/* Return true if T should end a basic block. */
bool
-stmt_ends_bb_p (tree t)
+stmt_ends_bb_p (const_tree t)
{
return is_ctrl_stmt (t) || is_ctrl_altering_stmt (t);
}
it to the destination of the other edge from E->src. */
static bool
-tree_can_remove_branch_p (edge e)
+tree_can_remove_branch_p (const_edge e)
{
if (e->flags & EDGE_ABNORMAL)
return false;
/* Return true if basic_block can be duplicated. */
static bool
-tree_can_duplicate_bb_p (basic_block bb ATTRIBUTE_UNUSED)
+tree_can_duplicate_bb_p (const_basic_block bb ATTRIBUTE_UNUSED)
{
return true;
}
otherwise. */
static bool
-tree_block_ends_with_call_p (basic_block bb)
+tree_block_ends_with_call_p (const_basic_block bb)
{
- block_stmt_iterator bsi = bsi_last (bb);
- return get_call_expr_in (bsi_stmt (bsi)) != NULL;
+ const_block_stmt_iterator bsi = cbsi_last (bb);
+ return const_get_call_expr_in (cbsi_stmt (bsi)) != NULL;
}
otherwise. */
static bool
-tree_block_ends_with_condjump_p (basic_block bb)
+tree_block_ends_with_condjump_p (const_basic_block bb)
{
- tree stmt = last_stmt (bb);
+ const_tree stmt = const_last_stmt (bb);
return (stmt && TREE_CODE (stmt) == COND_EXPR);
}
}
int
-lookup_stmt_eh_region_fn (struct function *ifun, tree t)
+lookup_stmt_eh_region_fn (struct function *ifun, const_tree t)
{
struct throw_stmt_node *p, n;
if (!get_eh_throw_stmt_table (ifun))
return -2;
- n.stmt = t;
+ /* The CONST_CAST is okay because we don't modify n.stmt throughout
+ its scope, or the scope of p. */
+ n.stmt = (tree) CONST_CAST (t);
p = (struct throw_stmt_node *) htab_find (get_eh_throw_stmt_table (ifun),
&n);
}
int
-lookup_stmt_eh_region (tree t)
+lookup_stmt_eh_region (const_tree t)
{
/* We can get called from initialized data when -fnon-call-exceptions
is on; prevent crash. */
}
bool
-tree_can_throw_internal (tree stmt)
+tree_can_throw_internal (const_tree stmt)
{
int region_nr;
bool is_resx = false;
/* Return the PHI nodes for basic block BB, or NULL if there are no
PHI nodes. */
static inline tree
-phi_nodes (basic_block bb)
+phi_nodes (const_basic_block bb)
{
gcc_assert (!(bb->flags & BB_RTL));
if (!bb->il.tree)
};
/* Accessors for basic block annotations. */
-static inline tree phi_nodes (basic_block);
+static inline tree phi_nodes (const_basic_block);
static inline void set_phi_nodes (basic_block, tree);
/*---------------------------------------------------------------------------
#define PENDING_STMT(e) ((e)->insns.t)
extern void delete_tree_cfg_annotations (void);
-extern bool stmt_ends_bb_p (tree);
+extern bool stmt_ends_bb_p (const_tree);
extern bool is_ctrl_stmt (const_tree);
-extern bool is_ctrl_altering_stmt (tree);
+extern bool is_ctrl_altering_stmt (const_tree);
extern bool computed_goto_p (const_tree);
extern bool simple_goto_p (const_tree);
extern bool tree_can_make_abnormal_goto (const_tree);
extern void make_eh_edges (tree);
extern bool tree_could_trap_p (tree);
extern bool tree_could_throw_p (tree);
-extern bool tree_can_throw_internal (tree);
+extern bool tree_can_throw_internal (const_tree);
extern bool tree_can_throw_external (tree);
-extern int lookup_stmt_eh_region (tree);
+extern int lookup_stmt_eh_region (const_tree);
extern void add_stmt_to_eh_region (tree, int);
extern bool remove_stmt_from_eh_region (tree);
extern bool maybe_clean_or_replace_eh_stmt (tree, tree);
/* If T makes a function call, return the corresponding CALL_EXPR operand.
Otherwise, return NULL_TREE. */
+#define GET_CALL_EXPR_IN_BODY do { \
+ /* FIXME tuples: delete the assertion below when conversion complete. */ \
+ gcc_assert (TREE_CODE (t) != MODIFY_EXPR); \
+ if (TREE_CODE (t) == GIMPLE_MODIFY_STMT) \
+ t = GIMPLE_STMT_OPERAND (t, 1); \
+ if (TREE_CODE (t) == WITH_SIZE_EXPR) \
+ t = TREE_OPERAND (t, 0); \
+ if (TREE_CODE (t) == CALL_EXPR) \
+ return t; \
+ return NULL_TREE; \
+} while (0)
+
tree
get_call_expr_in (tree t)
{
- /* FIXME tuples: delete the assertion below when conversion complete. */
- gcc_assert (TREE_CODE (t) != MODIFY_EXPR);
- if (TREE_CODE (t) == GIMPLE_MODIFY_STMT)
- t = GIMPLE_STMT_OPERAND (t, 1);
- if (TREE_CODE (t) == WITH_SIZE_EXPR)
- t = TREE_OPERAND (t, 0);
- if (TREE_CODE (t) == CALL_EXPR)
- return t;
- return NULL_TREE;
+ GET_CALL_EXPR_IN_BODY;
+}
+
+const_tree
+const_get_call_expr_in (const_tree t)
+{
+ GET_CALL_EXPR_IN_BODY;
}
/* Given a memory reference expression T, return its base address.
extern bool is_gimple_call_addr (tree);
/* If T makes a function call, returns the CALL_EXPR operand. */
extern tree get_call_expr_in (tree t);
+extern const_tree const_get_call_expr_in (const_tree t);
extern void recalculate_side_effects (tree);
returns the first occurrence; the TREE_CHAIN of the return value should
be passed back in if further occurrences are wanted. */
+#define LOOKUP_ATTRIBUTE_BODY(TYPE) do { \
+ TYPE l; \
+ size_t attr_len = strlen (attr_name); \
+ for (l = list; l; l = TREE_CHAIN (l)) \
+ { \
+ gcc_assert (TREE_CODE (TREE_PURPOSE (l)) == IDENTIFIER_NODE); \
+ if (is_attribute_with_length_p (attr_name, attr_len, TREE_PURPOSE (l))) \
+ return l; \
+ } \
+ return NULL_TREE; \
+} while (0)
+
tree
lookup_attribute (const char *attr_name, tree list)
{
- tree l;
- size_t attr_len = strlen (attr_name);
-
- for (l = list; l; l = TREE_CHAIN (l))
- {
- gcc_assert (TREE_CODE (TREE_PURPOSE (l)) == IDENTIFIER_NODE);
- if (is_attribute_with_length_p (attr_name, attr_len, TREE_PURPOSE (l)))
- return l;
- }
+ LOOKUP_ATTRIBUTE_BODY(tree);
+}
- return NULL_TREE;
+const_tree
+const_lookup_attribute (const char *attr_name, const_tree list)
+{
+ LOOKUP_ATTRIBUTE_BODY(const_tree);
}
/* Remove any instances of attribute ATTR_NAME in LIST and return the
equivalent to l1. */
int
-attribute_list_equal (tree l1, tree l2)
+attribute_list_equal (const_tree l1, const_tree l2)
{
return attribute_list_contained (l1, l2)
&& attribute_list_contained (l2, l1);
correctly. */
int
-attribute_list_contained (tree l1, tree l2)
+attribute_list_contained (const_tree l1, const_tree l2)
{
- tree t1, t2;
+ const_tree t1, t2;
/* First check the obvious, maybe the lists are identical. */
if (l1 == l2)
for (; t2 != 0; t2 = TREE_CHAIN (t2))
{
- tree attr;
- for (attr = lookup_attribute (IDENTIFIER_POINTER (TREE_PURPOSE (t2)), l1);
+ const_tree attr;
+ for (attr = const_lookup_attribute (IDENTIFIER_POINTER (TREE_PURPOSE (t2)), l1);
attr != NULL_TREE;
- attr = lookup_attribute (IDENTIFIER_POINTER (TREE_PURPOSE (t2)),
- TREE_CHAIN (attr)))
+ attr = const_lookup_attribute (IDENTIFIER_POINTER (TREE_PURPOSE (t2)),
+ TREE_CHAIN (attr)))
{
if (TREE_VALUE (t2) != NULL
&& TREE_CODE (TREE_VALUE (t2)) == TREE_LIST
extern tree value_member (tree, tree);
extern tree purpose_member (const_tree, tree);
-extern int attribute_list_equal (tree, tree);
-extern int attribute_list_contained (tree, tree);
+extern int attribute_list_equal (const_tree, const_tree);
+extern int attribute_list_contained (const_tree, const_tree);
extern int tree_int_cst_equal (const_tree, const_tree);
extern int tree_int_cst_lt (const_tree, const_tree);
extern int tree_int_cst_compare (const_tree, const_tree);
of the attribute or NULL_TREE if not found. */
extern tree lookup_attribute (const char *, tree);
+extern const_tree const_lookup_attribute (const char *, const_tree);
/* Remove any instances of attribute ATTR_NAME in LIST and return the
modified list. */
static void vmsdbgout_end_source_file (unsigned int);
static void vmsdbgout_begin_block (unsigned int, unsigned int);
static void vmsdbgout_end_block (unsigned int, unsigned int);
-static bool vmsdbgout_ignore_block (tree);
+static bool vmsdbgout_ignore_block (const_tree);
static void vmsdbgout_source_line (unsigned int, const char *);
static void vmsdbgout_begin_prologue (unsigned int, const char *);
static void vmsdbgout_end_prologue (unsigned int, const char *);
/* Not implemented in VMS Debug. */
static bool
-vmsdbgout_ignore_block (tree block)
+vmsdbgout_ignore_block (const_tree block)
{
bool retval = 0;