Commit 0bccc606 by Nathan Sidwell Committed by Nathan Sidwell

final.c (shorten_branches, [...]): Use gcc_assert and gcc_unreachable.

	* final.c (shorten_branches, final, get_insn_template,
	output_alternate_entry_point, final_scan_insn, alter_subreg,
	alter_cond, output_operand, asm_fprintf, final_forward_branch_p,
	leaf_renumber_regs_insn): Use gcc_assert and gcc_unreachable.
	* fix-header.c (lookup_std_proto): Likewise.
	* flow.c (first_insn_after_basic_block_note, verify_wide_reg,
	verify_local_live_at_start, update_life_info, mark_reg,
	calculate_global_regs_live, allocate_reg_life_data,
	init_propagate_block_info, mark_set_regs, flush_reg_cond_reg_1,
	ior_reg_cond, not_reg_cond, and_reg_cond, elim_reg_cond,
	attempt_auto_inc, mark_used_reg, mark_used_regs): Likewise.
	* fold-const.c (force_fit_type, div_and_round_double,
	may_negate_without_overflow_p, int_const_binop, const_binop,
	size_binop, size_diffop, fold_convert_const, fold_convert,
	invert_tree_comparison, swap_tree_comparison,
	comparison_to_compcode, compcode_to_comparison, invert_truthvalue,
	range_binop, make_range, fold_cond_expr_with_comparison,
	fold_div_compare, fold, fold_checksum_tree, fold_negate_const,
	fold_abs_const, fold_not_const, fold_relational_const, round_up,
	round_down): Likewise.
	* function.c (find_function_data, assign_stack_temp_for_type,
	instantiate_virtual_regs_lossage, aggregate_value_p,
	assign_parm_find_entry_rtl, assign_parm_setup_block,
	expand_function_start, expand_function_end, keep_stack_depressed,
	handle_epilogue_set, thread_prologue_and_epilogue_insns): Likewise.

From-SVN: r87192
parent 5f4a098e
2004-09-08 Nathan Sidwell <nathan@codesourcery.com>
* final.c (shorten_branches, final, get_insn_template,
output_alternate_entry_point, final_scan_insn, alter_subreg,
alter_cond, output_operand, asm_fprintf, final_forward_branch_p,
leaf_renumber_regs_insn): Use gcc_assert and gcc_unreachable.
* fix-header.c (lookup_std_proto): Likewise.
* flow.c (first_insn_after_basic_block_note, verify_wide_reg,
verify_local_live_at_start, update_life_info, mark_reg,
calculate_global_regs_live, allocate_reg_life_data,
init_propagate_block_info, mark_set_regs, flush_reg_cond_reg_1,
ior_reg_cond, not_reg_cond, and_reg_cond, elim_reg_cond,
attempt_auto_inc, mark_used_reg, mark_used_regs): Likewise.
* fold-const.c (force_fit_type, div_and_round_double,
may_negate_without_overflow_p, int_const_binop, const_binop,
size_binop, size_diffop, fold_convert_const, fold_convert,
invert_tree_comparison, swap_tree_comparison,
comparison_to_compcode, compcode_to_comparison, invert_truthvalue,
range_binop, make_range, fold_cond_expr_with_comparison,
fold_div_compare, fold, fold_checksum_tree, fold_negate_const,
fold_abs_const, fold_not_const, fold_relational_const, round_up,
round_down): Likewise.
* function.c (find_function_data, assign_stack_temp_for_type,
instantiate_virtual_regs_lossage, aggregate_value_p,
assign_parm_find_entry_rtl, assign_parm_setup_block,
expand_function_start, expand_function_end, keep_stack_depressed,
handle_epilogue_set, thread_prologue_and_epilogue_insns): Likewise.
2004-09-08 Daniel Berlin <dberlin@dberlin.org> 2004-09-08 Daniel Berlin <dberlin@dberlin.org>
* Makefile.in (tree-loop-linear.o): Added. * Makefile.in (tree-loop-linear.o): Added.
......
...@@ -788,8 +788,7 @@ shorten_branches (rtx first ATTRIBUTE_UNUSED) ...@@ -788,8 +788,7 @@ shorten_branches (rtx first ATTRIBUTE_UNUSED)
/* Range of labels grows monotonically in the function. Abort here /* Range of labels grows monotonically in the function. Abort here
means that the initialization of array got lost. */ means that the initialization of array got lost. */
if (n_old_labels > n_labels) gcc_assert (n_old_labels <= n_labels);
abort ();
memset (label_align + n_old_labels, 0, memset (label_align + n_old_labels, 0,
(n_labels - n_old_labels) * sizeof (struct label_alignment)); (n_labels - n_old_labels) * sizeof (struct label_alignment));
...@@ -933,8 +932,7 @@ shorten_branches (rtx first ATTRIBUTE_UNUSED) ...@@ -933,8 +932,7 @@ shorten_branches (rtx first ATTRIBUTE_UNUSED)
continue; continue;
pat = PATTERN (insn); pat = PATTERN (insn);
len = XVECLEN (pat, 1); len = XVECLEN (pat, 1);
if (len <= 0) gcc_assert (len > 0);
abort ();
min_align = MAX_CODE_ALIGN; min_align = MAX_CODE_ALIGN;
for (min = max_shuid, max = min_shuid, i = len - 1; i >= 0; i--) for (min = max_shuid, max = min_shuid, i = len - 1; i >= 0; i--)
{ {
...@@ -1566,10 +1564,8 @@ final (rtx first, FILE *file, int optimize, int prescan) ...@@ -1566,10 +1564,8 @@ final (rtx first, FILE *file, int optimize, int prescan)
{ {
/* This can be triggered by bugs elsewhere in the compiler if /* This can be triggered by bugs elsewhere in the compiler if
new insns are created after init_insn_lengths is called. */ new insns are created after init_insn_lengths is called. */
if (NOTE_P (insn)) gcc_assert (NOTE_P (insn));
insn_current_address = -1; insn_current_address = -1;
else
abort ();
} }
else else
insn_current_address = INSN_ADDRESSES (INSN_UID (insn)); insn_current_address = INSN_ADDRESSES (INSN_UID (insn));
...@@ -1589,12 +1585,11 @@ get_insn_template (int code, rtx insn) ...@@ -1589,12 +1585,11 @@ get_insn_template (int code, rtx insn)
case INSN_OUTPUT_FORMAT_MULTI: case INSN_OUTPUT_FORMAT_MULTI:
return insn_data[code].output.multi[which_alternative]; return insn_data[code].output.multi[which_alternative];
case INSN_OUTPUT_FORMAT_FUNCTION: case INSN_OUTPUT_FORMAT_FUNCTION:
if (insn == NULL) gcc_assert (insn);
abort ();
return (*insn_data[code].output.function) (recog_data.operand, insn); return (*insn_data[code].output.function) (recog_data.operand, insn);
default: default:
abort (); gcc_unreachable ();
} }
} }
...@@ -1625,7 +1620,7 @@ output_alternate_entry_point (FILE *file, rtx insn) ...@@ -1625,7 +1620,7 @@ output_alternate_entry_point (FILE *file, rtx insn)
case LABEL_NORMAL: case LABEL_NORMAL:
default: default:
abort (); gcc_unreachable ();
} }
} }
...@@ -1822,8 +1817,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, ...@@ -1822,8 +1817,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
/* End of a symbol-block. */ /* End of a symbol-block. */
--block_depth; --block_depth;
if (block_depth < 0) gcc_assert (block_depth >= 0);
abort ();
(*debug_hooks->end_block) (high_block_linenum, n); (*debug_hooks->end_block) (high_block_linenum, n);
} }
...@@ -1844,8 +1838,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, ...@@ -1844,8 +1838,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
break; break;
default: default:
if (NOTE_LINE_NUMBER (insn) <= 0) gcc_assert (NOTE_LINE_NUMBER (insn) > 0);
abort ();
break; break;
} }
break; break;
...@@ -2039,7 +2032,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, ...@@ -2039,7 +2032,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
#ifdef ASM_OUTPUT_ADDR_VEC #ifdef ASM_OUTPUT_ADDR_VEC
ASM_OUTPUT_ADDR_VEC (PREV_INSN (insn), body); ASM_OUTPUT_ADDR_VEC (PREV_INSN (insn), body);
#else #else
abort (); gcc_unreachable ();
#endif #endif
} }
else else
...@@ -2047,7 +2040,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, ...@@ -2047,7 +2040,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
#ifdef ASM_OUTPUT_ADDR_DIFF_VEC #ifdef ASM_OUTPUT_ADDR_DIFF_VEC
ASM_OUTPUT_ADDR_DIFF_VEC (PREV_INSN (insn), body); ASM_OUTPUT_ADDR_DIFF_VEC (PREV_INSN (insn), body);
#else #else
abort (); gcc_unreachable ();
#endif #endif
} }
#else #else
...@@ -2060,7 +2053,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, ...@@ -2060,7 +2053,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
ASM_OUTPUT_ADDR_VEC_ELT ASM_OUTPUT_ADDR_VEC_ELT
(file, CODE_LABEL_NUMBER (XEXP (XVECEXP (body, 0, idx), 0))); (file, CODE_LABEL_NUMBER (XEXP (XVECEXP (body, 0, idx), 0)));
#else #else
abort (); gcc_unreachable ();
#endif #endif
} }
else else
...@@ -2072,7 +2065,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, ...@@ -2072,7 +2065,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
CODE_LABEL_NUMBER (XEXP (XVECEXP (body, 1, idx), 0)), CODE_LABEL_NUMBER (XEXP (XVECEXP (body, 1, idx), 0)),
CODE_LABEL_NUMBER (XEXP (XEXP (body, 0), 0))); CODE_LABEL_NUMBER (XEXP (XEXP (body, 0), 0)));
#else #else
abort (); gcc_unreachable ();
#endif #endif
} }
} }
...@@ -2478,8 +2471,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, ...@@ -2478,8 +2471,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
{ {
rtx prev; rtx prev;
if (prev_nonnote_insn (insn) != last_ignored_compare) gcc_assert (prev_nonnote_insn (insn) == last_ignored_compare);
abort ();
/* We have already processed the notes between the setter and /* We have already processed the notes between the setter and
the user. Make sure we don't process them again, this is the user. Make sure we don't process them again, this is
...@@ -2510,7 +2502,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, ...@@ -2510,7 +2502,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
/* This instruction should have been split in shorten_branches, /* This instruction should have been split in shorten_branches,
to ensure that we would have valid length info for the to ensure that we would have valid length info for the
splitees. */ splitees. */
abort (); gcc_unreachable ();
#endif #endif
return new; return new;
...@@ -2622,14 +2614,14 @@ alter_subreg (rtx *xp) ...@@ -2622,14 +2614,14 @@ alter_subreg (rtx *xp)
if (new != 0) if (new != 0)
*xp = new; *xp = new;
/* Simplify_subreg can't handle some REG cases, but we have to. */ else
else if (REG_P (y))
{ {
/* Simplify_subreg can't handle some REG cases, but we have to. */
unsigned int regno = subreg_hard_regno (x, 1); unsigned int regno = subreg_hard_regno (x, 1);
gcc_assert (REG_P (y));
*xp = gen_rtx_REG_offset (y, GET_MODE (x), regno, SUBREG_BYTE (x)); *xp = gen_rtx_REG_offset (y, GET_MODE (x), regno, SUBREG_BYTE (x));
} }
else
abort ();
} }
return *xp; return *xp;
...@@ -2780,7 +2772,7 @@ alter_cond (rtx cond) ...@@ -2780,7 +2772,7 @@ alter_cond (rtx cond)
switch (GET_CODE (cond)) switch (GET_CODE (cond))
{ {
default: default:
abort (); gcc_unreachable ();
case NE: case NE:
PUT_CODE (cond, cc_status.flags & CC_Z_IN_N ? GE : LT); PUT_CODE (cond, cc_status.flags & CC_Z_IN_N ? GE : LT);
...@@ -3209,9 +3201,7 @@ output_operand (rtx x, int code ATTRIBUTE_UNUSED) ...@@ -3209,9 +3201,7 @@ output_operand (rtx x, int code ATTRIBUTE_UNUSED)
/* If X is a pseudo-register, abort now rather than writing trash to the /* If X is a pseudo-register, abort now rather than writing trash to the
assembler file. */ assembler file. */
gcc_assert (!x || !REG_P (x) || REGNO (x) < FIRST_PSEUDO_REGISTER);
if (x && REG_P (x) && REGNO (x) >= FIRST_PSEUDO_REGISTER)
abort ();
PRINT_OPERAND (asm_out_file, x, code); PRINT_OPERAND (asm_out_file, x, code);
} }
...@@ -3510,7 +3500,7 @@ asm_fprintf (FILE *file, const char *p, ...) ...@@ -3510,7 +3500,7 @@ asm_fprintf (FILE *file, const char *p, ...)
ASM_FPRINTF_EXTENSIONS (file, argptr, p) ASM_FPRINTF_EXTENSIONS (file, argptr, p)
#endif #endif
default: default:
abort (); gcc_unreachable ();
} }
break; break;
...@@ -3711,13 +3701,12 @@ int ...@@ -3711,13 +3701,12 @@ int
final_forward_branch_p (rtx insn) final_forward_branch_p (rtx insn)
{ {
int insn_id, label_id; int insn_id, label_id;
if (!uid_shuid)
abort (); gcc_assert (uid_shuid);
insn_id = INSN_SHUID (insn); insn_id = INSN_SHUID (insn);
label_id = INSN_SHUID (JUMP_LABEL (insn)); label_id = INSN_SHUID (JUMP_LABEL (insn));
/* We've hit some insns that does not have id information available. */ /* We've hit some insns that does not have id information available. */
if (!insn_id || !label_id) gcc_assert (insn_id && label_id);
abort ();
return insn_id < label_id; return insn_id < label_id;
} }
...@@ -3809,8 +3798,7 @@ leaf_renumber_regs_insn (rtx in_rtx) ...@@ -3809,8 +3798,7 @@ leaf_renumber_regs_insn (rtx in_rtx)
return; return;
} }
newreg = LEAF_REG_REMAP (newreg); newreg = LEAF_REG_REMAP (newreg);
if (newreg < 0) gcc_assert (newreg >= 0);
abort ();
regs_ever_live[REGNO (in_rtx)] = 0; regs_ever_live[REGNO (in_rtx)] = 0;
regs_ever_live[newreg] = 1; regs_ever_live[newreg] = 1;
REGNO (in_rtx) = newreg; REGNO (in_rtx) = newreg;
...@@ -3853,7 +3841,7 @@ leaf_renumber_regs_insn (rtx in_rtx) ...@@ -3853,7 +3841,7 @@ leaf_renumber_regs_insn (rtx in_rtx)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
} }
#endif #endif
......
...@@ -397,8 +397,7 @@ lookup_std_proto (const char *name, int name_length) ...@@ -397,8 +397,7 @@ lookup_std_proto (const char *name, int name_length)
&& strncmp (fn->fname, name, name_length) == 0) && strncmp (fn->fname, name, name_length) == 0)
return fn; return fn;
i = (i+1) % HASH_SIZE; i = (i+1) % HASH_SIZE;
if (i == i0) gcc_assert (i != i0);
abort ();
} }
} }
......
...@@ -346,8 +346,7 @@ first_insn_after_basic_block_note (basic_block block) ...@@ -346,8 +346,7 @@ first_insn_after_basic_block_note (basic_block block)
return NULL_RTX; return NULL_RTX;
if (LABEL_P (insn)) if (LABEL_P (insn))
insn = NEXT_INSN (insn); insn = NEXT_INSN (insn);
if (!NOTE_INSN_BASIC_BLOCK_P (insn)) gcc_assert (NOTE_INSN_BASIC_BLOCK_P (insn));
abort ();
return NEXT_INSN (insn); return NEXT_INSN (insn);
} }
...@@ -487,13 +486,12 @@ verify_wide_reg (int regno, basic_block bb) ...@@ -487,13 +486,12 @@ verify_wide_reg (int regno, basic_block bb)
break; break;
head = NEXT_INSN (head); head = NEXT_INSN (head);
} }
if (dump_file) if (dump_file)
{ {
fprintf (dump_file, "Register %d died unexpectedly.\n", regno); fprintf (dump_file, "Register %d died unexpectedly.\n", regno);
dump_bb (bb, dump_file, 0); dump_bb (bb, dump_file, 0);
} }
abort (); fatal_error ("internal consistency failure");
} }
/* A subroutine of update_life_info. Verify that there are no untoward /* A subroutine of update_life_info. Verify that there are no untoward
...@@ -517,7 +515,7 @@ verify_local_live_at_start (regset new_live_at_start, basic_block bb) ...@@ -517,7 +515,7 @@ verify_local_live_at_start (regset new_live_at_start, basic_block bb)
fputs ("Old:\n", dump_file); fputs ("Old:\n", dump_file);
dump_bb (bb, dump_file, 0); dump_bb (bb, dump_file, 0);
} }
abort (); fatal_error ("internal consistency failure");
} }
} }
else else
...@@ -538,9 +536,8 @@ verify_local_live_at_start (regset new_live_at_start, basic_block bb) ...@@ -538,9 +536,8 @@ verify_local_live_at_start (regset new_live_at_start, basic_block bb)
"Register %d died unexpectedly.\n", i); "Register %d died unexpectedly.\n", i);
dump_bb (bb, dump_file, 0); dump_bb (bb, dump_file, 0);
} }
abort (); fatal_error ("internal consistency failure");
} }
/* Verify that the now-live register is wider than word_mode. */ /* Verify that the now-live register is wider than word_mode. */
verify_wide_reg (i, bb); verify_wide_reg (i, bb);
}); });
...@@ -587,9 +584,8 @@ update_life_info (sbitmap blocks, enum update_life_extent extent, int prop_flags ...@@ -587,9 +584,8 @@ update_life_info (sbitmap blocks, enum update_life_extent extent, int prop_flags
/* Changes to the CFG are only allowed when /* Changes to the CFG are only allowed when
doing a global update for the entire CFG. */ doing a global update for the entire CFG. */
if ((prop_flags & PROP_ALLOW_CFG_CHANGES) gcc_assert (!(prop_flags & PROP_ALLOW_CFG_CHANGES)
&& (extent == UPDATE_LIFE_LOCAL || blocks)) || (extent != UPDATE_LIFE_LOCAL && !blocks));
abort ();
/* For a global update, we go through the relaxation process again. */ /* For a global update, we go through the relaxation process again. */
if (extent != UPDATE_LIFE_LOCAL) if (extent != UPDATE_LIFE_LOCAL)
...@@ -901,8 +897,7 @@ mark_reg (rtx reg, void *xset) ...@@ -901,8 +897,7 @@ mark_reg (rtx reg, void *xset)
regset set = (regset) xset; regset set = (regset) xset;
int regno = REGNO (reg); int regno = REGNO (reg);
if (GET_MODE (reg) == BLKmode) gcc_assert (GET_MODE (reg) != BLKmode);
abort ();
SET_REGNO_REG_SET (set, regno); SET_REGNO_REG_SET (set, regno);
if (regno < FIRST_PSEUDO_REGISTER) if (regno < FIRST_PSEUDO_REGISTER)
...@@ -1025,8 +1020,7 @@ calculate_global_regs_live (sbitmap blocks_in, sbitmap blocks_out, int flags) ...@@ -1025,8 +1020,7 @@ calculate_global_regs_live (sbitmap blocks_in, sbitmap blocks_out, int flags)
sick behavior here. */ sick behavior here. */
#ifdef ENABLE_CHECKING #ifdef ENABLE_CHECKING
FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, NULL, next_bb) FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, NULL, next_bb)
if (bb->aux) gcc_assert (!bb->aux);
abort ();
#endif #endif
tmp = INITIALIZE_REG_SET (tmp_head); tmp = INITIALIZE_REG_SET (tmp_head);
...@@ -1436,8 +1430,7 @@ allocate_reg_life_data (void) ...@@ -1436,8 +1430,7 @@ allocate_reg_life_data (void)
int i; int i;
max_regno = max_reg_num (); max_regno = max_reg_num ();
if (reg_deaths) gcc_assert (!reg_deaths);
abort ();
reg_deaths = xcalloc (sizeof (*reg_deaths), max_regno); reg_deaths = xcalloc (sizeof (*reg_deaths), max_regno);
/* Recalculate the register space, in case it has grown. Old style /* Recalculate the register space, in case it has grown. Old style
...@@ -1845,14 +1838,13 @@ init_propagate_block_info (basic_block bb, regset live, regset local_set, ...@@ -1845,14 +1838,13 @@ init_propagate_block_info (basic_block bb, regset live, regset local_set,
bb_false = bb_true; bb_false = bb_true;
bb_true = t; bb_true = t;
} }
else if (! (bb->succ->succ_next->flags & EDGE_FALLTHRU)) else
abort (); gcc_assert (bb->succ->succ_next->flags & EDGE_FALLTHRU);
} }
else else
{ {
/* This can happen with a conditional jump to the next insn. */ /* This can happen with a conditional jump to the next insn. */
if (JUMP_LABEL (BB_END (bb)) != BB_HEAD (bb_true)) gcc_assert (JUMP_LABEL (BB_END (bb)) == BB_HEAD (bb_true));
abort ();
/* Simplest way to do nothing. */ /* Simplest way to do nothing. */
bb_false = bb_true; bb_false = bb_true;
...@@ -2468,8 +2460,7 @@ mark_set_regs (struct propagate_block_info *pbi, rtx x, rtx insn) ...@@ -2468,8 +2460,7 @@ mark_set_regs (struct propagate_block_info *pbi, rtx x, rtx insn)
switch (code = GET_CODE (sub)) switch (code = GET_CODE (sub))
{ {
case COND_EXEC: case COND_EXEC:
if (cond != NULL_RTX) gcc_assert (!cond);
abort ();
cond = COND_EXEC_TEST (sub); cond = COND_EXEC_TEST (sub);
sub = COND_EXEC_CODE (sub); sub = COND_EXEC_CODE (sub);
...@@ -2958,8 +2949,8 @@ flush_reg_cond_reg_1 (splay_tree_node node, void *data) ...@@ -2958,8 +2949,8 @@ flush_reg_cond_reg_1 (splay_tree_node node, void *data)
xdata[1] = node->key; xdata[1] = node->key;
return -1; return -1;
} }
else if (rcli->condition == const1_rtx) else
abort (); gcc_assert (rcli->condition != const1_rtx);
return 0; return 0;
} }
...@@ -3073,7 +3064,7 @@ ior_reg_cond (rtx old, rtx x, int add) ...@@ -3073,7 +3064,7 @@ ior_reg_cond (rtx old, rtx x, int add)
return gen_rtx_IOR (0, old, x); return gen_rtx_IOR (0, old, x);
default: default:
abort (); gcc_unreachable ();
} }
} }
...@@ -3089,8 +3080,7 @@ not_reg_cond (rtx x) ...@@ -3089,8 +3080,7 @@ not_reg_cond (rtx x)
if (COMPARISON_P (x) if (COMPARISON_P (x)
&& REG_P (XEXP (x, 0))) && REG_P (XEXP (x, 0)))
{ {
if (XEXP (x, 1) != const0_rtx) gcc_assert (XEXP (x, 1) == const0_rtx);
abort ();
return gen_rtx_fmt_ee (reversed_comparison_code (x, NULL), return gen_rtx_fmt_ee (reversed_comparison_code (x, NULL),
VOIDmode, XEXP (x, 0), const0_rtx); VOIDmode, XEXP (x, 0), const0_rtx);
...@@ -3182,7 +3172,7 @@ and_reg_cond (rtx old, rtx x, int add) ...@@ -3182,7 +3172,7 @@ and_reg_cond (rtx old, rtx x, int add)
return gen_rtx_AND (0, old, x); return gen_rtx_AND (0, old, x);
default: default:
abort (); gcc_unreachable ();
} }
} }
...@@ -3242,7 +3232,7 @@ elim_reg_cond (rtx x, unsigned int regno) ...@@ -3242,7 +3232,7 @@ elim_reg_cond (rtx x, unsigned int regno)
return x; return x;
default: default:
abort (); gcc_unreachable ();
} }
} }
#endif /* HAVE_conditional_execution */ #endif /* HAVE_conditional_execution */
...@@ -3264,6 +3254,7 @@ attempt_auto_inc (struct propagate_block_info *pbi, rtx inc, rtx insn, ...@@ -3264,6 +3254,7 @@ attempt_auto_inc (struct propagate_block_info *pbi, rtx inc, rtx insn,
rtx q = SET_DEST (set); rtx q = SET_DEST (set);
rtx y = SET_SRC (set); rtx y = SET_SRC (set);
int opnum = XEXP (y, 0) == incr_reg ? 0 : 1; int opnum = XEXP (y, 0) == incr_reg ? 0 : 1;
int changed;
/* Make sure this reg appears only once in this insn. */ /* Make sure this reg appears only once in this insn. */
if (count_occurrences (PATTERN (insn), incr_reg, 1) != 1) if (count_occurrences (PATTERN (insn), incr_reg, 1) != 1)
...@@ -3363,8 +3354,8 @@ attempt_auto_inc (struct propagate_block_info *pbi, rtx inc, rtx insn, ...@@ -3363,8 +3354,8 @@ attempt_auto_inc (struct propagate_block_info *pbi, rtx inc, rtx insn,
/* Modify the old increment-insn to simply copy /* Modify the old increment-insn to simply copy
the already-incremented value of our register. */ the already-incremented value of our register. */
if (! validate_change (incr, &SET_SRC (set), incr_reg, 0)) changed = validate_change (incr, &SET_SRC (set), incr_reg, 0);
abort (); gcc_assert (changed);
/* If that makes it a no-op (copying the register into itself) delete /* If that makes it a no-op (copying the register into itself) delete
it so it won't appear to be a "use" and a "set" of this it so it won't appear to be a "use" and a "set" of this
...@@ -3570,10 +3561,7 @@ mark_used_reg (struct propagate_block_info *pbi, rtx reg, ...@@ -3570,10 +3561,7 @@ mark_used_reg (struct propagate_block_info *pbi, rtx reg,
for (i = regno_first; i <= regno_last; ++i) for (i = regno_first; i <= regno_last; ++i)
if (! REGNO_REG_SET_P (pbi->reg_live, i)) if (! REGNO_REG_SET_P (pbi->reg_live, i))
{ {
#ifdef ENABLE_CHECKING gcc_assert (!reg_deaths[i]);
if (reg_deaths[i])
abort ();
#endif
reg_deaths[i] = pbi->insn_num; reg_deaths[i] = pbi->insn_num;
} }
} }
...@@ -3925,8 +3913,7 @@ mark_used_regs (struct propagate_block_info *pbi, rtx x, rtx cond, rtx insn) ...@@ -3925,8 +3913,7 @@ mark_used_regs (struct propagate_block_info *pbi, rtx x, rtx cond, rtx insn)
} }
case COND_EXEC: case COND_EXEC:
if (cond != NULL_RTX) gcc_assert (!cond);
abort ();
mark_used_regs (pbi, COND_EXEC_TEST (x), NULL_RTX, insn); mark_used_regs (pbi, COND_EXEC_TEST (x), NULL_RTX, insn);
......
...@@ -207,8 +207,7 @@ force_fit_type (tree t, int overflowable, ...@@ -207,8 +207,7 @@ force_fit_type (tree t, int overflowable,
unsigned int prec; unsigned int prec;
int sign_extended_type; int sign_extended_type;
if (TREE_CODE (t) != INTEGER_CST) gcc_assert (TREE_CODE (t) == INTEGER_CST);
abort ();
low = TREE_INT_CST_LOW (t); low = TREE_INT_CST_LOW (t);
high = TREE_INT_CST_HIGH (t); high = TREE_INT_CST_HIGH (t);
...@@ -825,7 +824,7 @@ div_and_round_double (enum tree_code code, int uns, ...@@ -825,7 +824,7 @@ div_and_round_double (enum tree_code code, int uns,
break; break;
default: default:
abort (); gcc_unreachable ();
} }
/* Compute true remainder: rem = num - (quo * den) */ /* Compute true remainder: rem = num - (quo * den) */
...@@ -873,8 +872,7 @@ may_negate_without_overflow_p (tree t) ...@@ -873,8 +872,7 @@ may_negate_without_overflow_p (tree t)
unsigned int prec; unsigned int prec;
tree type; tree type;
if (TREE_CODE (t) != INTEGER_CST) gcc_assert (TREE_CODE (t) == INTEGER_CST);
abort ();
type = TREE_TYPE (t); type = TREE_TYPE (t);
if (TYPE_UNSIGNED (type)) if (TYPE_UNSIGNED (type))
...@@ -1425,7 +1423,7 @@ int_const_binop (enum tree_code code, tree arg1, tree arg2, int notrunc) ...@@ -1425,7 +1423,7 @@ int_const_binop (enum tree_code code, tree arg1, tree arg2, int notrunc)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
t = build_int_cst_wide (TREE_TYPE (arg1), low, hi); t = build_int_cst_wide (TREE_TYPE (arg1), low, hi);
...@@ -1588,7 +1586,7 @@ const_binop (enum tree_code code, tree arg1, tree arg2, int notrunc) ...@@ -1588,7 +1586,7 @@ const_binop (enum tree_code code, tree arg1, tree arg2, int notrunc)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
return t; return t;
} }
...@@ -1614,9 +1612,8 @@ size_binop (enum tree_code code, tree arg0, tree arg1) ...@@ -1614,9 +1612,8 @@ size_binop (enum tree_code code, tree arg0, tree arg1)
{ {
tree type = TREE_TYPE (arg0); tree type = TREE_TYPE (arg0);
if (TREE_CODE (type) != INTEGER_TYPE || ! TYPE_IS_SIZETYPE (type) gcc_assert (TREE_CODE (type) == INTEGER_TYPE && TYPE_IS_SIZETYPE (type)
|| type != TREE_TYPE (arg1)) && type == TREE_TYPE (arg1));
abort ();
/* Handle the special case of two integer constants faster. */ /* Handle the special case of two integer constants faster. */
if (TREE_CODE (arg0) == INTEGER_CST && TREE_CODE (arg1) == INTEGER_CST) if (TREE_CODE (arg0) == INTEGER_CST && TREE_CODE (arg1) == INTEGER_CST)
...@@ -1650,9 +1647,8 @@ size_diffop (tree arg0, tree arg1) ...@@ -1650,9 +1647,8 @@ size_diffop (tree arg0, tree arg1)
tree type = TREE_TYPE (arg0); tree type = TREE_TYPE (arg0);
tree ctype; tree ctype;
if (TREE_CODE (type) != INTEGER_TYPE || ! TYPE_IS_SIZETYPE (type) gcc_assert (TREE_CODE (type) == INTEGER_TYPE && TYPE_IS_SIZETYPE (type)
|| type != TREE_TYPE (arg1)) && type == TREE_TYPE (arg1));
abort ();
/* If the type is already signed, just do the simple thing. */ /* If the type is already signed, just do the simple thing. */
if (!TYPE_UNSIGNED (type)) if (!TYPE_UNSIGNED (type))
...@@ -1753,7 +1749,7 @@ fold_convert_const (enum tree_code code, tree type, tree arg1) ...@@ -1753,7 +1749,7 @@ fold_convert_const (enum tree_code code, tree type, tree arg1)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
/* If R is NaN, return zero and show we have an overflow. */ /* If R is NaN, return zero and show we have an overflow. */
...@@ -1854,9 +1850,11 @@ fold_convert (tree type, tree arg) ...@@ -1854,9 +1850,11 @@ fold_convert (tree type, tree arg)
TYPE_MAIN_VARIANT (orig))) TYPE_MAIN_VARIANT (orig)))
return fold (build1 (NOP_EXPR, type, arg)); return fold (build1 (NOP_EXPR, type, arg));
if (INTEGRAL_TYPE_P (type) || POINTER_TYPE_P (type) switch (TREE_CODE (type))
|| TREE_CODE (type) == OFFSET_TYPE)
{ {
case INTEGER_TYPE: case CHAR_TYPE: case ENUMERAL_TYPE: case BOOLEAN_TYPE:
case POINTER_TYPE: case REFERENCE_TYPE:
case OFFSET_TYPE:
if (TREE_CODE (arg) == INTEGER_CST) if (TREE_CODE (arg) == INTEGER_CST)
{ {
tem = fold_convert_const (NOP_EXPR, type, arg); tem = fold_convert_const (NOP_EXPR, type, arg);
...@@ -1871,12 +1869,11 @@ fold_convert (tree type, tree arg) ...@@ -1871,12 +1869,11 @@ fold_convert (tree type, tree arg)
tem = fold (build1 (REALPART_EXPR, TREE_TYPE (orig), arg)); tem = fold (build1 (REALPART_EXPR, TREE_TYPE (orig), arg));
return fold_convert (type, tem); return fold_convert (type, tem);
} }
if (TREE_CODE (orig) == VECTOR_TYPE gcc_assert (TREE_CODE (orig) == VECTOR_TYPE
&& tree_int_cst_equal (TYPE_SIZE (type), TYPE_SIZE (orig))) && tree_int_cst_equal (TYPE_SIZE (type), TYPE_SIZE (orig)));
return fold (build1 (NOP_EXPR, type, arg)); return fold (build1 (NOP_EXPR, type, arg));
}
else if (TREE_CODE (type) == REAL_TYPE) case REAL_TYPE:
{
if (TREE_CODE (arg) == INTEGER_CST) if (TREE_CODE (arg) == INTEGER_CST)
{ {
tem = fold_convert_const (FLOAT_EXPR, type, arg); tem = fold_convert_const (FLOAT_EXPR, type, arg);
...@@ -1890,56 +1887,70 @@ fold_convert (tree type, tree arg) ...@@ -1890,56 +1887,70 @@ fold_convert (tree type, tree arg)
return tem; return tem;
} }
if (INTEGRAL_TYPE_P (orig) || POINTER_TYPE_P (orig)) switch (TREE_CODE (orig))
return fold (build1 (FLOAT_EXPR, type, arg));
if (TREE_CODE (orig) == REAL_TYPE)
return fold (build1 (flag_float_store ? CONVERT_EXPR : NOP_EXPR,
type, arg));
if (TREE_CODE (orig) == COMPLEX_TYPE)
{ {
case INTEGER_TYPE: case CHAR_TYPE:
case BOOLEAN_TYPE: case ENUMERAL_TYPE:
case POINTER_TYPE: case REFERENCE_TYPE:
return fold (build1 (FLOAT_EXPR, type, arg));
case REAL_TYPE:
return fold (build1 (flag_float_store ? CONVERT_EXPR : NOP_EXPR,
type, arg));
case COMPLEX_TYPE:
tem = fold (build1 (REALPART_EXPR, TREE_TYPE (orig), arg)); tem = fold (build1 (REALPART_EXPR, TREE_TYPE (orig), arg));
return fold_convert (type, tem); return fold_convert (type, tem);
default:
gcc_unreachable ();
} }
}
else if (TREE_CODE (type) == COMPLEX_TYPE) case COMPLEX_TYPE:
{ switch (TREE_CODE (orig))
if (INTEGRAL_TYPE_P (orig) {
|| POINTER_TYPE_P (orig) case INTEGER_TYPE: case CHAR_TYPE:
|| TREE_CODE (orig) == REAL_TYPE) case BOOLEAN_TYPE: case ENUMERAL_TYPE:
return build2 (COMPLEX_EXPR, type, case POINTER_TYPE: case REFERENCE_TYPE:
fold_convert (TREE_TYPE (type), arg), case REAL_TYPE:
fold_convert (TREE_TYPE (type), integer_zero_node)); return build2 (COMPLEX_EXPR, type,
if (TREE_CODE (orig) == COMPLEX_TYPE) fold_convert (TREE_TYPE (type), arg),
{ fold_convert (TREE_TYPE (type), integer_zero_node));
tree rpart, ipart; case COMPLEX_TYPE:
{
tree rpart, ipart;
if (TREE_CODE (arg) == COMPLEX_EXPR)
{
rpart = fold_convert (TREE_TYPE (type), TREE_OPERAND (arg, 0));
ipart = fold_convert (TREE_TYPE (type), TREE_OPERAND (arg, 1));
return fold (build2 (COMPLEX_EXPR, type, rpart, ipart));
}
arg = save_expr (arg);
rpart = fold (build1 (REALPART_EXPR, TREE_TYPE (orig), arg));
ipart = fold (build1 (IMAGPART_EXPR, TREE_TYPE (orig), arg));
rpart = fold_convert (TREE_TYPE (type), rpart);
ipart = fold_convert (TREE_TYPE (type), ipart);
return fold (build2 (COMPLEX_EXPR, type, rpart, ipart));
}
default:
gcc_unreachable ();
}
case VECTOR_TYPE:
gcc_assert (tree_int_cst_equal (TYPE_SIZE (type), TYPE_SIZE (orig)));
gcc_assert (INTEGRAL_TYPE_P (orig) || POINTER_TYPE_P (orig)
|| TREE_CODE (orig) == VECTOR_TYPE);
return fold (build1 (NOP_EXPR, type, arg));
if (TREE_CODE (arg) == COMPLEX_EXPR) case VOID_TYPE:
{ return fold (build1 (CONVERT_EXPR, type, fold_ignored_result (arg)));
rpart = fold_convert (TREE_TYPE (type), TREE_OPERAND (arg, 0));
ipart = fold_convert (TREE_TYPE (type), TREE_OPERAND (arg, 1));
return fold (build2 (COMPLEX_EXPR, type, rpart, ipart));
}
arg = save_expr (arg); default:
rpart = fold (build1 (REALPART_EXPR, TREE_TYPE (orig), arg)); gcc_unreachable ();
ipart = fold (build1 (IMAGPART_EXPR, TREE_TYPE (orig), arg));
rpart = fold_convert (TREE_TYPE (type), rpart);
ipart = fold_convert (TREE_TYPE (type), ipart);
return fold (build2 (COMPLEX_EXPR, type, rpart, ipart));
}
}
else if (TREE_CODE (type) == VECTOR_TYPE)
{
if ((INTEGRAL_TYPE_P (orig) || POINTER_TYPE_P (orig))
&& tree_int_cst_equal (TYPE_SIZE (type), TYPE_SIZE (orig)))
return fold (build1 (NOP_EXPR, type, arg));
if (TREE_CODE (orig) == VECTOR_TYPE
&& tree_int_cst_equal (TYPE_SIZE (type), TYPE_SIZE (orig)))
return fold (build1 (NOP_EXPR, type, arg));
} }
else if (VOID_TYPE_P (type))
return fold (build1 (CONVERT_EXPR, type, fold_ignored_result (arg)));
abort ();
} }
/* Return an expr equal to X but certainly not valid as an lvalue. */ /* Return an expr equal to X but certainly not valid as an lvalue. */
...@@ -2048,7 +2059,7 @@ invert_tree_comparison (enum tree_code code, bool honor_nans) ...@@ -2048,7 +2059,7 @@ invert_tree_comparison (enum tree_code code, bool honor_nans)
case UNORDERED_EXPR: case UNORDERED_EXPR:
return ORDERED_EXPR; return ORDERED_EXPR;
default: default:
abort (); gcc_unreachable ();
} }
} }
...@@ -2072,7 +2083,7 @@ swap_tree_comparison (enum tree_code code) ...@@ -2072,7 +2083,7 @@ swap_tree_comparison (enum tree_code code)
case LE_EXPR: case LE_EXPR:
return GE_EXPR; return GE_EXPR;
default: default:
abort (); gcc_unreachable ();
} }
} }
...@@ -2115,7 +2126,7 @@ comparison_to_compcode (enum tree_code code) ...@@ -2115,7 +2126,7 @@ comparison_to_compcode (enum tree_code code)
case UNGE_EXPR: case UNGE_EXPR:
return COMPCODE_UNGE; return COMPCODE_UNGE;
default: default:
abort (); gcc_unreachable ();
} }
} }
...@@ -2157,7 +2168,7 @@ compcode_to_comparison (enum comparison_code code) ...@@ -2157,7 +2168,7 @@ compcode_to_comparison (enum comparison_code code)
case COMPCODE_UNGE: case COMPCODE_UNGE:
return UNGE_EXPR; return UNGE_EXPR;
default: default:
abort (); gcc_unreachable ();
} }
} }
...@@ -2959,8 +2970,7 @@ invert_truthvalue (tree arg) ...@@ -2959,8 +2970,7 @@ invert_truthvalue (tree arg)
default: default:
break; break;
} }
if (TREE_CODE (TREE_TYPE (arg)) != BOOLEAN_TYPE) gcc_assert (TREE_CODE (TREE_TYPE (arg)) == BOOLEAN_TYPE);
abort ();
return build1 (TRUTH_NOT_EXPR, type, arg); return build1 (TRUTH_NOT_EXPR, type, arg);
} }
...@@ -3486,7 +3496,7 @@ range_binop (enum tree_code code, tree type, tree arg0, int upper0_p, ...@@ -3486,7 +3496,7 @@ range_binop (enum tree_code code, tree type, tree arg0, int upper0_p,
result = sgn0 >= sgn1; result = sgn0 >= sgn1;
break; break;
default: default:
abort (); gcc_unreachable ();
} }
return constant_boolean_node (result, type); return constant_boolean_node (result, type);
...@@ -3575,7 +3585,7 @@ make_range (tree exp, int *pin_p, tree *plow, tree *phigh) ...@@ -3575,7 +3585,7 @@ make_range (tree exp, int *pin_p, tree *plow, tree *phigh)
in_p = ! in_p, low = 0, high = arg1; in_p = ! in_p, low = 0, high = arg1;
break; break;
default: default:
abort (); gcc_unreachable ();
} }
/* If this is an unsigned comparison, we also know that EXP is /* If this is an unsigned comparison, we also know that EXP is
...@@ -4151,7 +4161,7 @@ fold_cond_expr_with_comparison (tree type, tree arg0, tree arg1, tree arg2) ...@@ -4151,7 +4161,7 @@ fold_cond_expr_with_comparison (tree type, tree arg0, tree arg1, tree arg2)
tem = fold (build1 (ABS_EXPR, TREE_TYPE (arg1), arg1)); tem = fold (build1 (ABS_EXPR, TREE_TYPE (arg1), arg1));
return negate_expr (fold_convert (type, tem)); return negate_expr (fold_convert (type, tem));
default: default:
abort (); gcc_unreachable ();
} }
/* A != 0 ? A : 0 is simply A, unless A is -0. Likewise /* A != 0 ? A : 0 is simply A, unless A is -0. Likewise
...@@ -4247,7 +4257,7 @@ fold_cond_expr_with_comparison (tree type, tree arg0, tree arg1, tree arg2) ...@@ -4247,7 +4257,7 @@ fold_cond_expr_with_comparison (tree type, tree arg0, tree arg1, tree arg2)
} }
break; break;
default: default:
abort (); gcc_unreachable ();
} }
} }
...@@ -4317,7 +4327,7 @@ fold_cond_expr_with_comparison (tree type, tree arg0, tree arg1, tree arg2) ...@@ -4317,7 +4327,7 @@ fold_cond_expr_with_comparison (tree type, tree arg0, tree arg1, tree arg2)
case NE_EXPR: case NE_EXPR:
break; break;
default: default:
abort (); gcc_unreachable ();
} }
return NULL_TREE; return NULL_TREE;
...@@ -5660,7 +5670,7 @@ fold_div_compare (enum tree_code code, tree type, tree arg0, tree arg1) ...@@ -5660,7 +5670,7 @@ fold_div_compare (enum tree_code code, tree type, tree arg0, tree arg1)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
} }
else else
...@@ -5684,7 +5694,7 @@ fold_div_compare (enum tree_code code, tree type, tree arg0, tree arg1) ...@@ -5684,7 +5694,7 @@ fold_div_compare (enum tree_code code, tree type, tree arg0, tree arg1)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
} }
...@@ -8424,7 +8434,7 @@ fold (tree expr) ...@@ -8424,7 +8434,7 @@ fold (tree expr)
case LT_EXPR: case LT_EXPR:
return constant_boolean_node (0, type); return constant_boolean_node (0, type);
default: default:
abort (); gcc_unreachable ();
} }
} }
...@@ -9024,10 +9034,9 @@ fold_checksum_tree (tree expr, struct md5_ctx *ctx, htab_t ht) ...@@ -9024,10 +9034,9 @@ fold_checksum_tree (tree expr, struct md5_ctx *ctx, htab_t ht)
char buf[sizeof (struct tree_decl)]; char buf[sizeof (struct tree_decl)];
int i, len; int i, len;
if (sizeof (struct tree_exp) + 5 * sizeof (tree) gcc_assert ((sizeof (struct tree_exp) + 5 * sizeof (tree)
> sizeof (struct tree_decl) <= sizeof (struct tree_decl))
|| sizeof (struct tree_type) > sizeof (struct tree_decl)) && sizeof (struct tree_type) <= sizeof (struct tree_decl));
abort ();
if (expr == NULL) if (expr == NULL)
return; return;
slot = htab_find_slot (ht, expr, INSERT); slot = htab_find_slot (ht, expr, INSERT);
...@@ -10240,26 +10249,31 @@ fold_negate_const (tree arg0, tree type) ...@@ -10240,26 +10249,31 @@ fold_negate_const (tree arg0, tree type)
{ {
tree t = NULL_TREE; tree t = NULL_TREE;
if (TREE_CODE (arg0) == INTEGER_CST) switch (TREE_CODE (arg0))
{ {
unsigned HOST_WIDE_INT low; case INTEGER_CST:
HOST_WIDE_INT high; {
int overflow = neg_double (TREE_INT_CST_LOW (arg0), unsigned HOST_WIDE_INT low;
TREE_INT_CST_HIGH (arg0), HOST_WIDE_INT high;
&low, &high); int overflow = neg_double (TREE_INT_CST_LOW (arg0),
t = build_int_cst_wide (type, low, high); TREE_INT_CST_HIGH (arg0),
t = force_fit_type (t, 1, &low, &high);
(overflow | TREE_OVERFLOW (arg0)) t = build_int_cst_wide (type, low, high);
&& !TYPE_UNSIGNED (type), t = force_fit_type (t, 1,
TREE_CONSTANT_OVERFLOW (arg0)); (overflow | TREE_OVERFLOW (arg0))
} && !TYPE_UNSIGNED (type),
else if (TREE_CODE (arg0) == REAL_CST) TREE_CONSTANT_OVERFLOW (arg0));
t = build_real (type, REAL_VALUE_NEGATE (TREE_REAL_CST (arg0))); break;
#ifdef ENABLE_CHECKING }
else
abort (); case REAL_CST:
#endif t = build_real (type, REAL_VALUE_NEGATE (TREE_REAL_CST (arg0)));
break;
default:
gcc_unreachable ();
}
return t; return t;
} }
...@@ -10273,15 +10287,16 @@ fold_abs_const (tree arg0, tree type) ...@@ -10273,15 +10287,16 @@ fold_abs_const (tree arg0, tree type)
{ {
tree t = NULL_TREE; tree t = NULL_TREE;
if (TREE_CODE (arg0) == INTEGER_CST) switch (TREE_CODE (arg0))
{ {
case INTEGER_CST:
/* If the value is unsigned, then the absolute value is /* If the value is unsigned, then the absolute value is
the same as the ordinary value. */ the same as the ordinary value. */
if (TYPE_UNSIGNED (type)) if (TYPE_UNSIGNED (type))
return arg0; t = arg0;
/* Similarly, if the value is non-negative. */ /* Similarly, if the value is non-negative. */
else if (INT_CST_LT (integer_minus_one_node, arg0)) else if (INT_CST_LT (integer_minus_one_node, arg0))
return arg0; t = arg0;
/* If the value is negative, then the absolute value is /* If the value is negative, then the absolute value is
its negation. */ its negation. */
else else
...@@ -10294,21 +10309,20 @@ fold_abs_const (tree arg0, tree type) ...@@ -10294,21 +10309,20 @@ fold_abs_const (tree arg0, tree type)
t = build_int_cst_wide (type, low, high); t = build_int_cst_wide (type, low, high);
t = force_fit_type (t, -1, overflow | TREE_OVERFLOW (arg0), t = force_fit_type (t, -1, overflow | TREE_OVERFLOW (arg0),
TREE_CONSTANT_OVERFLOW (arg0)); TREE_CONSTANT_OVERFLOW (arg0));
return t;
} }
} break;
else if (TREE_CODE (arg0) == REAL_CST)
{ case REAL_CST:
if (REAL_VALUE_NEGATIVE (TREE_REAL_CST (arg0))) if (REAL_VALUE_NEGATIVE (TREE_REAL_CST (arg0)))
return build_real (type, REAL_VALUE_NEGATE (TREE_REAL_CST (arg0))); t = build_real (type, REAL_VALUE_NEGATE (TREE_REAL_CST (arg0)));
else else
return arg0; t = arg0;
break;
default:
gcc_unreachable ();
} }
#ifdef ENABLE_CHECKING
else
abort ();
#endif
return t; return t;
} }
...@@ -10320,19 +10334,14 @@ fold_not_const (tree arg0, tree type) ...@@ -10320,19 +10334,14 @@ fold_not_const (tree arg0, tree type)
{ {
tree t = NULL_TREE; tree t = NULL_TREE;
if (TREE_CODE (arg0) == INTEGER_CST) gcc_assert (TREE_CODE (arg0) == INTEGER_CST);
{
t = build_int_cst_wide (type, t = build_int_cst_wide (type,
~ TREE_INT_CST_LOW (arg0), ~ TREE_INT_CST_LOW (arg0),
~ TREE_INT_CST_HIGH (arg0)); ~ TREE_INT_CST_HIGH (arg0));
t = force_fit_type (t, 0, TREE_OVERFLOW (arg0), t = force_fit_type (t, 0, TREE_OVERFLOW (arg0),
TREE_CONSTANT_OVERFLOW (arg0)); TREE_CONSTANT_OVERFLOW (arg0));
}
#ifdef ENABLE_CHECKING
else
abort ();
#endif
return t; return t;
} }
...@@ -10385,7 +10394,7 @@ fold_relational_const (enum tree_code code, tree type, tree op0, tree op1) ...@@ -10385,7 +10394,7 @@ fold_relational_const (enum tree_code code, tree type, tree op0, tree op1)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
return constant_boolean_node (result, type); return constant_boolean_node (result, type);
...@@ -10576,8 +10585,7 @@ round_up (tree value, int divisor) ...@@ -10576,8 +10585,7 @@ round_up (tree value, int divisor)
{ {
tree div = NULL_TREE; tree div = NULL_TREE;
if (divisor <= 0) gcc_assert (divisor > 0);
abort ();
if (divisor == 1) if (divisor == 1)
return value; return value;
...@@ -10621,8 +10629,7 @@ round_down (tree value, int divisor) ...@@ -10621,8 +10629,7 @@ round_down (tree value, int divisor)
{ {
tree div = NULL_TREE; tree div = NULL_TREE;
if (divisor <= 0) gcc_assert (divisor > 0);
abort ();
if (divisor == 1) if (divisor == 1)
return value; return value;
......
...@@ -230,7 +230,7 @@ find_function_data (tree decl) ...@@ -230,7 +230,7 @@ find_function_data (tree decl)
if (p->decl == decl) if (p->decl == decl)
return p; return p;
abort (); gcc_unreachable ();
} }
/* Save the current context for compilation of a nested function. /* Save the current context for compilation of a nested function.
...@@ -604,12 +604,10 @@ assign_stack_temp_for_type (enum machine_mode mode, HOST_WIDE_INT size, int keep ...@@ -604,12 +604,10 @@ assign_stack_temp_for_type (enum machine_mode mode, HOST_WIDE_INT size, int keep
/* If SIZE is -1 it means that somebody tried to allocate a temporary /* If SIZE is -1 it means that somebody tried to allocate a temporary
of a variable size. */ of a variable size. */
if (size == -1) gcc_assert (size != -1);
abort ();
/* These are now unused. */ /* These are now unused. */
if (keep > 1) gcc_assert (keep <= 1);
abort ();
if (mode == BLKmode) if (mode == BLKmode)
align = BIGGEST_ALIGNMENT; align = BIGGEST_ALIGNMENT;
...@@ -695,8 +693,7 @@ assign_stack_temp_for_type (enum machine_mode mode, HOST_WIDE_INT size, int keep ...@@ -695,8 +693,7 @@ assign_stack_temp_for_type (enum machine_mode mode, HOST_WIDE_INT size, int keep
So for requests which depended on the rounding of SIZE, we go ahead So for requests which depended on the rounding of SIZE, we go ahead
and round it now. We also make sure ALIGNMENT is at least and round it now. We also make sure ALIGNMENT is at least
BIGGEST_ALIGNMENT. */ BIGGEST_ALIGNMENT. */
if (mode == BLKmode && align < BIGGEST_ALIGNMENT) gcc_assert (mode != BLKmode || align == BIGGEST_ALIGNMENT);
abort ();
p->slot = assign_stack_local (mode, p->slot = assign_stack_local (mode,
(mode == BLKmode (mode == BLKmode
? CEIL_ROUND (size, (int) align / BITS_PER_UNIT) ? CEIL_ROUND (size, (int) align / BITS_PER_UNIT)
...@@ -1434,13 +1431,9 @@ instantiate_new_reg (rtx x, HOST_WIDE_INT *poffset) ...@@ -1434,13 +1431,9 @@ instantiate_new_reg (rtx x, HOST_WIDE_INT *poffset)
static void static void
instantiate_virtual_regs_lossage (rtx insn) instantiate_virtual_regs_lossage (rtx insn)
{ {
if (asm_noperands (PATTERN (insn)) >= 0) gcc_assert (asm_noperands (PATTERN (insn)) >= 0);
{ error_for_asm (insn, "impossible constraint in `asm'");
error_for_asm (insn, "impossible constraint in `asm'"); delete_insn (insn);
delete_insn (insn);
}
else
abort ();
} }
/* Given a pointer to a piece of rtx and an optional pointer to the /* Given a pointer to a piece of rtx and an optional pointer to the
containing object, instantiate any virtual registers present in it. containing object, instantiate any virtual registers present in it.
...@@ -1862,7 +1855,7 @@ aggregate_value_p (tree exp, tree fntype) ...@@ -1862,7 +1855,7 @@ aggregate_value_p (tree exp, tree fntype)
break; break;
default: default:
/* We don't expect other rtl types here. */ /* We don't expect other rtl types here. */
abort(); gcc_unreachable ();
} }
if (TREE_CODE (type) == VOID_TYPE) if (TREE_CODE (type) == VOID_TYPE)
...@@ -2309,8 +2302,7 @@ assign_parm_find_entry_rtl (struct assign_parm_data_all *all, ...@@ -2309,8 +2302,7 @@ assign_parm_find_entry_rtl (struct assign_parm_data_all *all,
/* We assume at most one partial arg, and it must be the first /* We assume at most one partial arg, and it must be the first
argument on the stack. */ argument on the stack. */
if (all->extra_pretend_bytes || all->pretend_args_size) gcc_assert (!all->extra_pretend_bytes && !all->pretend_args_size);
abort ();
pretend_bytes = partial * UNITS_PER_WORD; pretend_bytes = partial * UNITS_PER_WORD;
all->pretend_args_size = CEIL_ROUND (pretend_bytes, STACK_BYTES); all->pretend_args_size = CEIL_ROUND (pretend_bytes, STACK_BYTES);
...@@ -2567,8 +2559,8 @@ assign_parm_setup_block (tree parm, struct assign_parm_data_one *data) ...@@ -2567,8 +2559,8 @@ assign_parm_setup_block (tree parm, struct assign_parm_data_one *data)
} }
else if (GET_CODE (entry_parm) == PARALLEL) else if (GET_CODE (entry_parm) == PARALLEL)
; ;
else if (size != 0 && PARM_BOUNDARY % BITS_PER_WORD != 0) else
abort (); gcc_assert (!size || !(PARM_BOUNDARY % BITS_PER_WORD));
mem = validize_mem (stack_parm); mem = validize_mem (stack_parm);
...@@ -4029,10 +4021,11 @@ expand_function_start (tree subr) ...@@ -4029,10 +4021,11 @@ expand_function_start (tree subr)
so we may see a PARALLEL or a REG. */ so we may see a PARALLEL or a REG. */
if (REG_P (hard_reg)) if (REG_P (hard_reg))
SET_DECL_RTL (DECL_RESULT (subr), gen_reg_rtx (GET_MODE (hard_reg))); SET_DECL_RTL (DECL_RESULT (subr), gen_reg_rtx (GET_MODE (hard_reg)));
else if (GET_CODE (hard_reg) == PARALLEL)
SET_DECL_RTL (DECL_RESULT (subr), gen_group_rtx (hard_reg));
else else
abort (); {
gcc_assert (GET_CODE (hard_reg) == PARALLEL);
SET_DECL_RTL (DECL_RESULT (subr), gen_group_rtx (hard_reg));
}
/* Set DECL_REGISTER flag so that expand_function_end will copy the /* Set DECL_REGISTER flag so that expand_function_end will copy the
result to the real return register(s). */ result to the real return register(s). */
...@@ -4321,8 +4314,7 @@ expand_function_end (void) ...@@ -4321,8 +4314,7 @@ expand_function_end (void)
rtx real_decl_rtl = current_function_return_rtx; rtx real_decl_rtl = current_function_return_rtx;
/* This should be set in assign_parms. */ /* This should be set in assign_parms. */
if (! REG_FUNCTION_VALUE_P (real_decl_rtl)) gcc_assert (REG_FUNCTION_VALUE_P (real_decl_rtl));
abort ();
/* If this is a BLKmode structure being returned in registers, /* If this is a BLKmode structure being returned in registers,
then use the mode computed in expand_return. Note that if then use the mode computed in expand_return. Note that if
...@@ -4680,19 +4672,27 @@ keep_stack_depressed (rtx insns) ...@@ -4680,19 +4672,27 @@ keep_stack_depressed (rtx insns)
insn = next; insn = next;
continue; continue;
} }
else if (MEM_P (retaddr) else
&& REG_P (XEXP (retaddr, 0)))
base = gen_rtx_REG (Pmode, REGNO (XEXP (retaddr, 0))), offset = 0;
else if (MEM_P (retaddr)
&& GET_CODE (XEXP (retaddr, 0)) == PLUS
&& REG_P (XEXP (XEXP (retaddr, 0), 0))
&& GET_CODE (XEXP (XEXP (retaddr, 0), 1)) == CONST_INT)
{ {
base = gen_rtx_REG (Pmode, REGNO (XEXP (XEXP (retaddr, 0), 0))); rtx ret_ptr;
offset = INTVAL (XEXP (XEXP (retaddr, 0), 1)); gcc_assert (MEM_P (retaddr));
ret_ptr = XEXP (retaddr, 0);
if (REG_P (ret_ptr))
{
base = gen_rtx_REG (Pmode, REGNO (ret_ptr));
offset = 0;
}
else
{
gcc_assert (GET_CODE (ret_ptr) == PLUS
&& REG_P (XEXP (ret_ptr, 0))
&& GET_CODE (XEXP (ret_ptr, 1)) == CONST_INT);
base = gen_rtx_REG (Pmode, REGNO (XEXP (ret_ptr, 0)));
offset = INTVAL (XEXP (ret_ptr, 1));
}
} }
else
abort ();
/* If the base of the location containing the return pointer /* If the base of the location containing the return pointer
is SP, we must update it with the replacement address. Otherwise, is SP, we must update it with the replacement address. Otherwise,
...@@ -4727,8 +4727,7 @@ keep_stack_depressed (rtx insns) ...@@ -4727,8 +4727,7 @@ keep_stack_depressed (rtx insns)
&& info.const_equiv[regno] == 0) && info.const_equiv[regno] == 0)
break; break;
if (regno == FIRST_PSEUDO_REGISTER) gcc_assert (regno < FIRST_PSEUDO_REGISTER);
abort ();
reg = gen_rtx_REG (Pmode, regno); reg = gen_rtx_REG (Pmode, regno);
emit_move_insn (reg, retaddr); emit_move_insn (reg, retaddr);
...@@ -4740,10 +4739,8 @@ keep_stack_depressed (rtx insns) ...@@ -4740,10 +4739,8 @@ keep_stack_depressed (rtx insns)
/* Show the SET in the above insn is a RETURN. */ /* Show the SET in the above insn is a RETURN. */
jump_set = single_set (jump_insn); jump_set = single_set (jump_insn);
if (jump_set == 0) gcc_assert (jump_set);
abort (); SET_IS_RETURN_P (jump_set) = 1;
else
SET_IS_RETURN_P (jump_set) = 1;
} }
/* If SP is not mentioned in the pattern and its equivalent register, if /* If SP is not mentioned in the pattern and its equivalent register, if
...@@ -4758,11 +4755,13 @@ keep_stack_depressed (rtx insns) ...@@ -4758,11 +4755,13 @@ keep_stack_depressed (rtx insns)
&& (info.sp_equiv_reg == stack_pointer_rtx && (info.sp_equiv_reg == stack_pointer_rtx
|| !reg_set_p (info.sp_equiv_reg, insn))) || !reg_set_p (info.sp_equiv_reg, insn)))
{ {
if (! validate_replace_rtx (stack_pointer_rtx, int changed;
plus_constant (info.sp_equiv_reg,
info.sp_offset), changed = validate_replace_rtx (stack_pointer_rtx,
insn)) plus_constant (info.sp_equiv_reg,
abort (); info.sp_offset),
insn);
gcc_assert (changed);
add_insn (insn); add_insn (insn);
} }
...@@ -4802,21 +4801,22 @@ handle_epilogue_set (rtx set, struct epi_info *p) ...@@ -4802,21 +4801,22 @@ handle_epilogue_set (rtx set, struct epi_info *p)
set from. If unknown, abort. */ set from. If unknown, abort. */
if (reg_set_p (stack_pointer_rtx, set)) if (reg_set_p (stack_pointer_rtx, set))
{ {
if (SET_DEST (set) != stack_pointer_rtx) gcc_assert (SET_DEST (set) == stack_pointer_rtx);
abort ();
if (GET_CODE (SET_SRC (set)) == PLUS) if (GET_CODE (SET_SRC (set)) == PLUS)
{ {
p->new_sp_equiv_reg = XEXP (SET_SRC (set), 0); p->new_sp_equiv_reg = XEXP (SET_SRC (set), 0);
if (GET_CODE (XEXP (SET_SRC (set), 1)) == CONST_INT) if (GET_CODE (XEXP (SET_SRC (set), 1)) == CONST_INT)
p->new_sp_offset = INTVAL (XEXP (SET_SRC (set), 1)); p->new_sp_offset = INTVAL (XEXP (SET_SRC (set), 1));
else if (REG_P (XEXP (SET_SRC (set), 1))
&& REGNO (XEXP (SET_SRC (set), 1)) < FIRST_PSEUDO_REGISTER
&& p->const_equiv[REGNO (XEXP (SET_SRC (set), 1))] != 0)
p->new_sp_offset
= INTVAL (p->const_equiv[REGNO (XEXP (SET_SRC (set), 1))]);
else else
abort (); {
gcc_assert (REG_P (XEXP (SET_SRC (set), 1))
&& (REGNO (XEXP (SET_SRC (set), 1))
< FIRST_PSEUDO_REGISTER)
&& p->const_equiv[REGNO (XEXP (SET_SRC (set), 1))]);
p->new_sp_offset
= INTVAL (p->const_equiv[REGNO (XEXP (SET_SRC (set), 1))]);
}
} }
else else
p->new_sp_equiv_reg = SET_SRC (set), p->new_sp_offset = 0; p->new_sp_equiv_reg = SET_SRC (set), p->new_sp_offset = 0;
...@@ -4828,8 +4828,7 @@ handle_epilogue_set (rtx set, struct epi_info *p) ...@@ -4828,8 +4828,7 @@ handle_epilogue_set (rtx set, struct epi_info *p)
p->new_sp_offset += p->sp_offset; p->new_sp_offset += p->sp_offset;
} }
if (p->new_sp_equiv_reg == 0 || !REG_P (p->new_sp_equiv_reg)) gcc_assert (p->new_sp_equiv_reg && REG_P (p->new_sp_equiv_reg));
abort ();
return; return;
} }
...@@ -4844,17 +4843,16 @@ handle_epilogue_set (rtx set, struct epi_info *p) ...@@ -4844,17 +4843,16 @@ handle_epilogue_set (rtx set, struct epi_info *p)
Pmode). */ Pmode). */
else if (p->new_sp_equiv_reg != 0 && reg_set_p (p->new_sp_equiv_reg, set)) else if (p->new_sp_equiv_reg != 0 && reg_set_p (p->new_sp_equiv_reg, set))
{ {
if (p->equiv_reg_src != 0 gcc_assert (!p->equiv_reg_src
|| !REG_P (p->new_sp_equiv_reg) && REG_P (p->new_sp_equiv_reg)
|| !REG_P (SET_DEST (set)) && REG_P (SET_DEST (set))
|| GET_MODE_BITSIZE (GET_MODE (SET_DEST (set))) > BITS_PER_WORD && (GET_MODE_BITSIZE (GET_MODE (SET_DEST (set)))
|| REGNO (p->new_sp_equiv_reg) != REGNO (SET_DEST (set))) <= BITS_PER_WORD)
abort (); && REGNO (p->new_sp_equiv_reg) == REGNO (SET_DEST (set)));
else p->equiv_reg_src
p->equiv_reg_src = simplify_replace_rtx (SET_SRC (set), stack_pointer_rtx,
= simplify_replace_rtx (SET_SRC (set), stack_pointer_rtx, plus_constant (p->sp_equiv_reg,
plus_constant (p->sp_equiv_reg, p->sp_offset));
p->sp_offset));
} }
/* Otherwise, replace any references to SP in the insn to its new value /* Otherwise, replace any references to SP in the insn to its new value
...@@ -4966,8 +4964,7 @@ thread_prologue_and_epilogue_insns (rtx f ATTRIBUTE_UNUSED) ...@@ -4966,8 +4964,7 @@ thread_prologue_and_epilogue_insns (rtx f ATTRIBUTE_UNUSED)
/* Can't deal with multiple successors of the entry block /* Can't deal with multiple successors of the entry block
at the moment. Function should always have at least one at the moment. Function should always have at least one
entry point. */ entry point. */
if (!ENTRY_BLOCK_PTR->succ || ENTRY_BLOCK_PTR->succ->succ_next) gcc_assert (ENTRY_BLOCK_PTR->succ && !ENTRY_BLOCK_PTR->succ->succ_next);
abort ();
insert_insn_on_edge (seq, ENTRY_BLOCK_PTR->succ); insert_insn_on_edge (seq, ENTRY_BLOCK_PTR->succ);
inserted = 1; inserted = 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment