This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[assert] e*.c
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 08 Sep 2004 09:06:46 +0100
- Subject: [assert] e*.c
- Organization: Codesourcery LLC
and this is the one I've installed for e*.c files.
booted & tested on i686-pc-linux-gnu.
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk
2004-09-08 Nathan Sidwell <nathan@codesourcery.com>
* emit-rtl.c (immed_double_const): Use gcc_assert and gcc_unreachable.
(gen_rtx_SUBREG, gen_reg_rtx, mark_user_reg, subreg_hard_regno,
gen_lowpart_common, gen_highpart, gen_highpart_mode,
subreg_highpart_offset, operand_subword, operand_subword_force,
mem_expr_equal_p, set_mem_attributes_minus_bitpos,
set_mem_alias_set, change_address_1, verify_rtx_sharing,
copy_most_rtx, set_first_insn, set_last_insn, prev_cc0_setter,
try_split, add_insn_after, add_insn_before, remove_insn,
remove_unnecessary_notes, emit_insn_before, emit_jump_insn_before,
emit_call_insn_before, emit_insn_after, emit_jump_insn_after,
emit_call_insn_after, emit_insn, emit_jump_insn, emit_call_insn,
set_unique_reg_note, emit, push_to_full_sequence, copy_insn_1,
gen_const_vector_0, emit_copy_of_insn_after): Likewise.
* et-forest.c (set_prev, set_next, et_check_occ_sanity,
record_path_before_1, check_path_after_1, check_path_after): Likewise.
* except.c (gen_eh_region, resolve_one_fixup_region,
remove_unreachable_regions, convert_from_eh_region_ranges_1,
add_ehl_entry, duplicate_eh_region_1, build_post_landing_pads,
connect_post_landing_pads, sjlj_emit_function_exit,
remove_exception_handler_label, remove_eh_handler,
reachable_next_level, collect_one_action_chain,
output_function_exception_table): Likewise.
* explow.c (trunc_int_for_mode, copy_to_mode_reg,
optimize_save_area_alloca, allocate_dynamic_stack_space,
probe_stack_range, hard_function_value): Likewise.
* expmed.c (mode_for_extraction, store_bit_field,
store_fixed_bit_field, extract_bit_field, expand_shift,
expand_mult_const, expand_mult, choose_multiplier,
expand_mult_highpart, expand_divmod, emit_store_flag,
do_cmp_and_jump): Likewise.
* expr.c (convert_move, convert_modes, move_by_pieces,
move_by_pieces_ninsns, move_by_pieces_1, emit_block_move,
move_block_from_reg, gen_group_rtx, emit_group_load,
emit_group_move, emit_group_store, use_reg, use_regs,
can_store_by_pieces, store_by_pieces, store_by_pieces_1,
emit_move_insn, emit_move_insn_1, emit_push_insn,
expand_assignment, store_expr, count_type_elements,
store_constructor, store_field, safe_from_p, expand_var,
expand_expr_addr_expr, expand_expr_real_1, do_store_flag): Likewise.
Index: emit-rtl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/emit-rtl.c,v
retrieving revision 1.411
diff -c -3 -p -r1.411 emit-rtl.c
*** emit-rtl.c 6 Sep 2004 21:05:44 -0000 1.411
--- emit-rtl.c 8 Sep 2004 07:16:50 -0000
*************** immed_double_const (HOST_WIDE_INT i0, HO
*** 456,467 ****
if (mode != VOIDmode)
{
int width;
! if (GET_MODE_CLASS (mode) != MODE_INT
! && GET_MODE_CLASS (mode) != MODE_PARTIAL_INT
! /* We can get a 0 for an error mark. */
! && GET_MODE_CLASS (mode) != MODE_VECTOR_INT
! && GET_MODE_CLASS (mode) != MODE_VECTOR_FLOAT)
! abort ();
/* We clear out all bits that don't belong in MODE, unless they and
our sign bit are all one. So we get either a reasonable negative
--- 456,467 ----
if (mode != VOIDmode)
{
int width;
!
! gcc_assert (GET_MODE_CLASS (mode) == MODE_INT
! || GET_MODE_CLASS (mode) == MODE_PARTIAL_INT
! /* We can get a 0 for an error mark. */
! || GET_MODE_CLASS (mode) == MODE_VECTOR_INT
! || GET_MODE_CLASS (mode) == MODE_VECTOR_FLOAT);
/* We clear out all bits that don't belong in MODE, unless they and
our sign bit are all one. So we get either a reasonable negative
*************** immed_double_const (HOST_WIDE_INT i0, HO
*** 474,482 ****
else if (width == HOST_BITS_PER_WIDE_INT
&& ! (i1 == ~0 && i0 < 0))
i1 = 0;
! else if (width > 2 * HOST_BITS_PER_WIDE_INT)
! /* We cannot represent this value as a constant. */
! abort ();
/* If this would be an entire word for the target, but is not for
the host, then sign-extend on the host so that the number will
--- 474,482 ----
else if (width == HOST_BITS_PER_WIDE_INT
&& ! (i1 == ~0 && i0 < 0))
i1 = 0;
! else
! /* We should be able to represent this value as a constant. */
! gcc_assert (width <= 2 * HOST_BITS_PER_WIDE_INT);
/* If this would be an entire word for the target, but is not for
the host, then sign-extend on the host so that the number will
*************** gen_rtx_SUBREG (enum machine_mode mode,
*** 623,638 ****
{
/* This is the most common failure type.
Catch it early so we can see who does it. */
! if ((offset % GET_MODE_SIZE (mode)) != 0)
! abort ();
/* This check isn't usable right now because combine will
throw arbitrary crap like a CALL into a SUBREG in
gen_lowpart_for_combine so we must just eat it. */
#if 0
/* Check for this too. */
! if (offset >= GET_MODE_SIZE (GET_MODE (reg)))
! abort ();
#endif
return gen_rtx_raw_SUBREG (mode, reg, offset);
}
--- 623,636 ----
{
/* This is the most common failure type.
Catch it early so we can see who does it. */
! gcc_assert (!(offset % GET_MODE_SIZE (mode)));
/* This check isn't usable right now because combine will
throw arbitrary crap like a CALL into a SUBREG in
gen_lowpart_for_combine so we must just eat it. */
#if 0
/* Check for this too. */
! gcc_assert (offset < GET_MODE_SIZE (GET_MODE (reg)));
#endif
return gen_rtx_raw_SUBREG (mode, reg, offset);
}
*************** gen_reg_rtx (enum machine_mode mode)
*** 711,718 ****
/* Don't let anything called after initial flow analysis create new
registers. */
! if (no_new_pseudos)
! abort ();
if (generating_concat_p
&& (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT
--- 709,715 ----
/* Don't let anything called after initial flow analysis create new
registers. */
! gcc_assert (!no_new_pseudos);
if (generating_concat_p
&& (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT
*************** mark_user_reg (rtx reg)
*** 972,981 ****
REG_USERVAR_P (XEXP (reg, 0)) = 1;
REG_USERVAR_P (XEXP (reg, 1)) = 1;
}
- else if (REG_P (reg))
- REG_USERVAR_P (reg) = 1;
else
! abort ();
}
/* Identify REG as a probable pointer register and show its alignment
--- 969,979 ----
REG_USERVAR_P (XEXP (reg, 0)) = 1;
REG_USERVAR_P (XEXP (reg, 1)) = 1;
}
else
! {
! gcc_assert (REG_P (reg));
! REG_USERVAR_P (reg) = 1;
! }
}
/* Identify REG as a probable pointer register and show its alignment
*************** subreg_hard_regno (rtx x, int check_mode
*** 1044,1066 ****
/* This is where we attempt to catch illegal subregs
created by the compiler. */
! if (GET_CODE (x) != SUBREG
! || !REG_P (reg))
! abort ();
base_regno = REGNO (reg);
! if (base_regno >= FIRST_PSEUDO_REGISTER)
! abort ();
! if (check_mode && ! HARD_REGNO_MODE_OK (base_regno, GET_MODE (reg)))
! abort ();
#ifdef ENABLE_CHECKING
! if (!subreg_offset_representable_p (REGNO (reg), GET_MODE (reg),
! SUBREG_BYTE (x), mode))
! abort ();
#endif
/* Catch non-congruent offsets too. */
byte_offset = SUBREG_BYTE (x);
! if ((byte_offset % GET_MODE_SIZE (mode)) != 0)
! abort ();
final_regno = subreg_regno (x);
--- 1042,1058 ----
/* This is where we attempt to catch illegal subregs
created by the compiler. */
! gcc_assert (GET_CODE (x) == SUBREG && REG_P (reg));
base_regno = REGNO (reg);
! gcc_assert (base_regno < FIRST_PSEUDO_REGISTER);
! gcc_assert (!check_mode || HARD_REGNO_MODE_OK (base_regno, GET_MODE (reg)));
#ifdef ENABLE_CHECKING
! gcc_assert (subreg_offset_representable_p (REGNO (reg), GET_MODE (reg),
! SUBREG_BYTE (x), mode));
#endif
/* Catch non-congruent offsets too. */
byte_offset = SUBREG_BYTE (x);
! gcc_assert (!(byte_offset % GET_MODE_SIZE (mode)));
final_regno = subreg_regno (x);
*************** gen_lowpart_common (enum machine_mode mo
*** 1096,1103 ****
xsize = GET_MODE_SIZE (innermode);
! if (innermode == VOIDmode || innermode == BLKmode)
! abort ();
if (innermode == mode)
return x;
--- 1088,1094 ----
xsize = GET_MODE_SIZE (innermode);
! gcc_assert (innermode != VOIDmode && innermode != BLKmode);
if (innermode == mode)
return x;
*************** gen_highpart (enum machine_mode mode, rt
*** 1224,1244 ****
/* This case loses if X is a subreg. To catch bugs early,
complain if an invalid MODE is used even in other cases. */
! if (msize > UNITS_PER_WORD
! && msize != (unsigned int) GET_MODE_UNIT_SIZE (GET_MODE (x)))
! abort ();
result = simplify_gen_subreg (mode, x, GET_MODE (x),
subreg_highpart_offset (mode, GET_MODE (x)));
!
/* simplify_gen_subreg is not guaranteed to return a valid operand for
the target if we have a MEM. gen_highpart must return a valid operand,
emitting code if necessary to do so. */
! if (result != NULL_RTX && MEM_P (result))
! result = validize_mem (result);
!
! if (!result)
! abort ();
return result;
}
--- 1215,1236 ----
/* This case loses if X is a subreg. To catch bugs early,
complain if an invalid MODE is used even in other cases. */
! gcc_assert (msize <= UNITS_PER_WORD
! || msize == (unsigned int) GET_MODE_UNIT_SIZE (GET_MODE (x)));
result = simplify_gen_subreg (mode, x, GET_MODE (x),
subreg_highpart_offset (mode, GET_MODE (x)));
! gcc_assert (result);
!
/* simplify_gen_subreg is not guaranteed to return a valid operand for
the target if we have a MEM. gen_highpart must return a valid operand,
emitting code if necessary to do so. */
! if (MEM_P (result))
! {
! result = validize_mem (result);
! gcc_assert (result);
! }
!
return result;
}
*************** gen_highpart_mode (enum machine_mode out
*** 1249,1256 ****
{
if (GET_MODE (exp) != VOIDmode)
{
! if (GET_MODE (exp) != innermode)
! abort ();
return gen_highpart (outermode, exp);
}
return simplify_gen_subreg (outermode, exp, innermode,
--- 1241,1247 ----
{
if (GET_MODE (exp) != VOIDmode)
{
! gcc_assert (GET_MODE (exp) == innermode);
return gen_highpart (outermode, exp);
}
return simplify_gen_subreg (outermode, exp, innermode,
*************** subreg_highpart_offset (enum machine_mod
*** 1285,1292 ****
unsigned int offset = 0;
int difference = (GET_MODE_SIZE (innermode) - GET_MODE_SIZE (outermode));
! if (GET_MODE_SIZE (innermode) < GET_MODE_SIZE (outermode))
! abort ();
if (difference > 0)
{
--- 1276,1282 ----
unsigned int offset = 0;
int difference = (GET_MODE_SIZE (innermode) - GET_MODE_SIZE (outermode));
! gcc_assert (GET_MODE_SIZE (innermode) >= GET_MODE_SIZE (outermode));
if (difference > 0)
{
*************** operand_subword (rtx op, unsigned int of
*** 1346,1353 ****
if (mode == VOIDmode)
mode = GET_MODE (op);
! if (mode == VOIDmode)
! abort ();
/* If OP is narrower than a word, fail. */
if (mode != BLKmode
--- 1336,1342 ----
if (mode == VOIDmode)
mode = GET_MODE (op);
! gcc_assert (mode != VOIDmode);
/* If OP is narrower than a word, fail. */
if (mode != BLKmode
*************** operand_subword_force (rtx op, unsigned
*** 1405,1412 ****
}
result = operand_subword (op, offset, 1, mode);
! if (result == 0)
! abort ();
return result;
}
--- 1394,1400 ----
}
result = operand_subword (op, offset, 1, mode);
! gcc_assert (result);
return result;
}
*************** mem_expr_equal_p (tree expr1, tree expr2
*** 1500,1512 ****
if (TREE_CODE (expr1) == INDIRECT_REF)
return mem_expr_equal_p (TREE_OPERAND (expr1, 0),
TREE_OPERAND (expr2, 0));
-
- /* Decls with different pointers can't be equal. */
- if (DECL_P (expr1))
- return 0;
! abort(); /* ARRAY_REFs, ARRAY_RANGE_REFs and BIT_FIELD_REFs should already
have been resolved here. */
}
/* Given REF, a MEM, and T, either the type of X or the expression
--- 1488,1500 ----
if (TREE_CODE (expr1) == INDIRECT_REF)
return mem_expr_equal_p (TREE_OPERAND (expr1, 0),
TREE_OPERAND (expr2, 0));
! /* ARRAY_REFs, ARRAY_RANGE_REFs and BIT_FIELD_REFs should already
have been resolved here. */
+ gcc_assert (DECL_P (expr1));
+
+ /* Decls with different pointers can't be equal. */
+ return 0;
}
/* Given REF, a MEM, and T, either the type of X or the expression
*************** set_mem_attributes_minus_bitpos (rtx ref
*** 1540,1547 ****
wrong answer, as it assumes that DECL_RTL already has the right alias
info. Callers should not set DECL_RTL until after the call to
set_mem_attributes. */
! if (DECL_P (t) && ref == DECL_RTL_IF_SET (t))
! abort ();
/* Get the alias set from the expression or type (perhaps using a
front-end routine) and use it. */
--- 1528,1534 ----
wrong answer, as it assumes that DECL_RTL already has the right alias
info. Callers should not set DECL_RTL until after the call to
set_mem_attributes. */
! gcc_assert (!DECL_P (t) || ref != DECL_RTL_IF_SET (t));
/* Get the alias set from the expression or type (perhaps using a
front-end routine) and use it. */
*************** set_mem_alias_set (rtx mem, HOST_WIDE_IN
*** 1754,1761 ****
{
#ifdef ENABLE_CHECKING
/* If the new and old alias sets don't conflict, something is wrong. */
! if (!alias_sets_conflict_p (set, MEM_ALIAS_SET (mem)))
! abort ();
#endif
MEM_ATTRS (mem) = get_mem_attrs (set, MEM_EXPR (mem), MEM_OFFSET (mem),
--- 1741,1747 ----
{
#ifdef ENABLE_CHECKING
/* If the new and old alias sets don't conflict, something is wrong. */
! gcc_assert (alias_sets_conflict_p (set, MEM_ALIAS_SET (mem)));
#endif
MEM_ATTRS (mem) = get_mem_attrs (set, MEM_EXPR (mem), MEM_OFFSET (mem),
*************** change_address_1 (rtx memref, enum machi
*** 1814,1821 ****
{
rtx new;
! if (!MEM_P (memref))
! abort ();
if (mode == VOIDmode)
mode = GET_MODE (memref);
if (addr == 0)
--- 1800,1806 ----
{
rtx new;
! gcc_assert (MEM_P (memref));
if (mode == VOIDmode)
mode = GET_MODE (memref);
if (addr == 0)
*************** change_address_1 (rtx memref, enum machi
*** 1827,1836 ****
if (validate)
{
if (reload_in_progress || reload_completed)
! {
! if (! memory_address_p (mode, addr))
! abort ();
! }
else
addr = memory_address (mode, addr);
}
--- 1812,1818 ----
if (validate)
{
if (reload_in_progress || reload_completed)
! gcc_assert (memory_address_p (mode, addr));
else
addr = memory_address (mode, addr);
}
*************** verify_rtx_sharing (rtx orig, rtx insn)
*** 2285,2291 ****
debug_rtx (insn);
error ("Shared rtx");
debug_rtx (x);
! abort ();
}
RTX_FLAG (x, used) = 1;
--- 2267,2273 ----
debug_rtx (insn);
error ("Shared rtx");
debug_rtx (x);
! fatal_error ("Internal consistency failure");
}
RTX_FLAG (x, used) = 1;
*************** copy_most_rtx (rtx orig, rtx may_share)
*** 2490,2496 ****
break;
default:
! abort ();
}
}
return copy;
--- 2472,2478 ----
break;
default:
! gcc_unreachable ();
}
}
return copy;
*************** get_insns (void)
*** 2822,2829 ****
void
set_first_insn (rtx insn)
{
! if (PREV_INSN (insn) != 0)
! abort ();
first_insn = insn;
}
--- 2804,2810 ----
void
set_first_insn (rtx insn)
{
! gcc_assert (!PREV_INSN (insn));
first_insn = insn;
}
*************** get_last_insn (void)
*** 2840,2847 ****
void
set_last_insn (rtx insn)
{
! if (NEXT_INSN (insn) != 0)
! abort ();
last_insn = insn;
}
--- 2821,2827 ----
void
set_last_insn (rtx insn)
{
! gcc_assert (!NEXT_INSN (insn));
last_insn = insn;
}
*************** prev_cc0_setter (rtx insn)
*** 3191,3198 ****
return XEXP (note, 0);
insn = prev_nonnote_insn (insn);
! if (! sets_cc0_p (PATTERN (insn)))
! abort ();
return insn;
}
--- 3171,3177 ----
return XEXP (note, 0);
insn = prev_nonnote_insn (insn);
! gcc_assert (sets_cc0_p (PATTERN (insn)));
return insn;
}
*************** try_split (rtx pat, rtx trial, int last)
*** 3292,3299 ****
one jump is created, otherwise the machine description
is responsible for this step using
split_branch_probability variable. */
! if (njumps != 1)
! abort ();
REG_NOTES (insn)
= gen_rtx_EXPR_LIST (REG_BR_PROB,
GEN_INT (probability),
--- 3271,3277 ----
one jump is created, otherwise the machine description
is responsible for this step using
split_branch_probability variable. */
! gcc_assert (njumps == 1);
REG_NOTES (insn)
= gen_rtx_EXPR_LIST (REG_BR_PROB,
GEN_INT (probability),
*************** add_insn_after (rtx insn, rtx after)
*** 3510,3517 ****
rtx next = NEXT_INSN (after);
basic_block bb;
! if (optimize && INSN_DELETED_P (after))
! abort ();
NEXT_INSN (insn) = next;
PREV_INSN (insn) = after;
--- 3488,3494 ----
rtx next = NEXT_INSN (after);
basic_block bb;
! gcc_assert (!optimize || !INSN_DELETED_P (after));
NEXT_INSN (insn) = next;
PREV_INSN (insn) = after;
*************** add_insn_after (rtx insn, rtx after)
*** 3535,3542 ****
break;
}
! if (stack == 0)
! abort ();
}
if (!BARRIER_P (after)
--- 3512,3518 ----
break;
}
! gcc_assert (stack);
}
if (!BARRIER_P (after)
*************** add_insn_before (rtx insn, rtx before)
*** 3575,3582 ****
rtx prev = PREV_INSN (before);
basic_block bb;
! if (optimize && INSN_DELETED_P (before))
! abort ();
PREV_INSN (insn) = prev;
NEXT_INSN (insn) = before;
--- 3551,3557 ----
rtx prev = PREV_INSN (before);
basic_block bb;
! gcc_assert (!optimize || !INSN_DELETED_P (before));
PREV_INSN (insn) = prev;
NEXT_INSN (insn) = before;
*************** add_insn_before (rtx insn, rtx before)
*** 3603,3610 ****
break;
}
! if (stack == 0)
! abort ();
}
if (!BARRIER_P (before)
--- 3578,3584 ----
break;
}
! gcc_assert (stack);
}
if (!BARRIER_P (before)
*************** add_insn_before (rtx insn, rtx before)
*** 3614,3627 ****
set_block_for_insn (insn, bb);
if (INSN_P (insn))
bb->flags |= BB_DIRTY;
! /* Should not happen as first in the BB is always
! either NOTE or LABEl. */
! if (BB_HEAD (bb) == insn
! /* Avoid clobbering of structure when creating new BB. */
! && !BARRIER_P (insn)
! && (!NOTE_P (insn)
! || NOTE_LINE_NUMBER (insn) != NOTE_INSN_BASIC_BLOCK))
! abort ();
}
PREV_INSN (before) = insn;
--- 3588,3600 ----
set_block_for_insn (insn, bb);
if (INSN_P (insn))
bb->flags |= BB_DIRTY;
! /* Should not happen as first in the BB is always either NOTE or
! LABEl. */
! gcc_assert (BB_HEAD (bb) != insn
! /* Avoid clobbering of structure when creating new BB. */
! || BARRIER_P (insn)
! || (NOTE_P (insn)
! && NOTE_LINE_NUMBER (insn) == NOTE_INSN_BASIC_BLOCK));
}
PREV_INSN (before) = insn;
*************** remove_insn (rtx insn)
*** 3660,3667 ****
break;
}
! if (stack == 0)
! abort ();
}
if (next)
--- 3633,3639 ----
break;
}
! gcc_assert (stack);
}
if (next)
*************** remove_insn (rtx insn)
*** 3683,3690 ****
break;
}
! if (stack == 0)
! abort ();
}
if (!BARRIER_P (insn)
&& (bb = BLOCK_FOR_INSN (insn)))
--- 3655,3661 ----
break;
}
! gcc_assert (stack);
}
if (!BARRIER_P (insn)
&& (bb = BLOCK_FOR_INSN (insn)))
*************** remove_insn (rtx insn)
*** 3695,3702 ****
{
/* Never ever delete the basic block note without deleting whole
basic block. */
! if (NOTE_P (insn))
! abort ();
BB_HEAD (bb) = next;
}
if (BB_END (bb) == insn)
--- 3666,3672 ----
{
/* Never ever delete the basic block note without deleting whole
basic block. */
! gcc_assert (!NOTE_P (insn));
BB_HEAD (bb) = next;
}
if (BB_END (bb) == insn)
*************** remove_insn (rtx insn)
*** 3709,3716 ****
void
add_function_usage_to (rtx call_insn, rtx call_fusage)
{
! if (! call_insn || !CALL_P (call_insn))
! abort ();
/* Put the register usage information on the CALL. If there is already
some usage information, put ours at the end. */
--- 3679,3685 ----
void
add_function_usage_to (rtx call_insn, rtx call_fusage)
{
! gcc_assert (call_insn && CALL_P (call_insn));
/* Put the register usage information on the CALL. If there is already
some usage information, put ours at the end. */
*************** remove_unnecessary_notes (void)
*** 3857,3867 ****
case NOTE_INSN_EH_REGION_END:
/* Too many end notes. */
! if (eh_stack == NULL_RTX)
! abort ();
/* Mismatched nesting. */
! if (NOTE_EH_HANDLER (XEXP (eh_stack, 0)) != NOTE_EH_HANDLER (insn))
! abort ();
tmp = eh_stack;
eh_stack = XEXP (eh_stack, 1);
free_INSN_LIST_node (tmp);
--- 3826,3835 ----
case NOTE_INSN_EH_REGION_END:
/* Too many end notes. */
! gcc_assert (eh_stack);
/* Mismatched nesting. */
! gcc_assert (NOTE_EH_HANDLER (XEXP (eh_stack, 0))
! == NOTE_EH_HANDLER (insn));
tmp = eh_stack;
eh_stack = XEXP (eh_stack, 1);
free_INSN_LIST_node (tmp);
*************** remove_unnecessary_notes (void)
*** 3870,3887 ****
case NOTE_INSN_BLOCK_BEG:
/* By now, all notes indicating lexical blocks should have
NOTE_BLOCK filled in. */
! if (NOTE_BLOCK (insn) == NULL_TREE)
! abort ();
block_stack = alloc_INSN_LIST (insn, block_stack);
break;
case NOTE_INSN_BLOCK_END:
/* Too many end notes. */
! if (block_stack == NULL_RTX)
! abort ();
/* Mismatched nesting. */
! if (NOTE_BLOCK (XEXP (block_stack, 0)) != NOTE_BLOCK (insn))
! abort ();
tmp = block_stack;
block_stack = XEXP (block_stack, 1);
free_INSN_LIST_node (tmp);
--- 3838,3852 ----
case NOTE_INSN_BLOCK_BEG:
/* By now, all notes indicating lexical blocks should have
NOTE_BLOCK filled in. */
! gcc_assert (NOTE_BLOCK (insn));
block_stack = alloc_INSN_LIST (insn, block_stack);
break;
case NOTE_INSN_BLOCK_END:
/* Too many end notes. */
! gcc_assert (block_stack);
/* Mismatched nesting. */
! gcc_assert (NOTE_BLOCK (XEXP (block_stack, 0)) == NOTE_BLOCK (insn));
tmp = block_stack;
block_stack = XEXP (block_stack, 1);
free_INSN_LIST_node (tmp);
*************** remove_unnecessary_notes (void)
*** 3930,3937 ****
}
/* Too many begin notes. */
! if (block_stack || eh_stack)
! abort ();
}
--- 3895,3901 ----
}
/* Too many begin notes. */
! gcc_assert (!block_stack && !eh_stack);
}
*************** emit_insn_before (rtx x, rtx before)
*** 3968,3977 ****
rtx last = before;
rtx insn;
! #ifdef ENABLE_RTL_CHECKING
! if (before == NULL_RTX)
! abort ();
! #endif
if (x == NULL_RTX)
return last;
--- 3932,3938 ----
rtx last = before;
rtx insn;
! gcc_assert (before);
if (x == NULL_RTX)
return last;
*************** emit_insn_before (rtx x, rtx before)
*** 3996,4002 ****
#ifdef ENABLE_RTL_CHECKING
case SEQUENCE:
! abort ();
break;
#endif
--- 3957,3963 ----
#ifdef ENABLE_RTL_CHECKING
case SEQUENCE:
! gcc_unreachable ();
break;
#endif
*************** emit_jump_insn_before (rtx x, rtx before
*** 4017,4026 ****
{
rtx insn, last = NULL_RTX;
! #ifdef ENABLE_RTL_CHECKING
! if (before == NULL_RTX)
! abort ();
! #endif
switch (GET_CODE (x))
{
--- 3978,3984 ----
{
rtx insn, last = NULL_RTX;
! gcc_assert (before);
switch (GET_CODE (x))
{
*************** emit_jump_insn_before (rtx x, rtx before
*** 4042,4048 ****
#ifdef ENABLE_RTL_CHECKING
case SEQUENCE:
! abort ();
break;
#endif
--- 4000,4006 ----
#ifdef ENABLE_RTL_CHECKING
case SEQUENCE:
! gcc_unreachable ();
break;
#endif
*************** emit_call_insn_before (rtx x, rtx before
*** 4063,4072 ****
{
rtx last = NULL_RTX, insn;
! #ifdef ENABLE_RTL_CHECKING
! if (before == NULL_RTX)
! abort ();
! #endif
switch (GET_CODE (x))
{
--- 4021,4027 ----
{
rtx last = NULL_RTX, insn;
! gcc_assert (before);
switch (GET_CODE (x))
{
*************** emit_call_insn_before (rtx x, rtx before
*** 4088,4094 ****
#ifdef ENABLE_RTL_CHECKING
case SEQUENCE:
! abort ();
break;
#endif
--- 4043,4049 ----
#ifdef ENABLE_RTL_CHECKING
case SEQUENCE:
! gcc_unreachable ();
break;
#endif
*************** emit_insn_after (rtx x, rtx after)
*** 4196,4205 ****
{
rtx last = after;
! #ifdef ENABLE_RTL_CHECKING
! if (after == NULL_RTX)
! abort ();
! #endif
if (x == NULL_RTX)
return last;
--- 4151,4157 ----
{
rtx last = after;
! gcc_assert (after);
if (x == NULL_RTX)
return last;
*************** emit_insn_after (rtx x, rtx after)
*** 4217,4223 ****
#ifdef ENABLE_RTL_CHECKING
case SEQUENCE:
! abort ();
break;
#endif
--- 4169,4175 ----
#ifdef ENABLE_RTL_CHECKING
case SEQUENCE:
! gcc_unreachable ();
break;
#endif
*************** emit_jump_insn_after (rtx x, rtx after)
*** 4255,4264 ****
{
rtx last;
! #ifdef ENABLE_RTL_CHECKING
! if (after == NULL_RTX)
! abort ();
! #endif
switch (GET_CODE (x))
{
--- 4207,4213 ----
{
rtx last;
! gcc_assert (after);
switch (GET_CODE (x))
{
*************** emit_jump_insn_after (rtx x, rtx after)
*** 4273,4279 ****
#ifdef ENABLE_RTL_CHECKING
case SEQUENCE:
! abort ();
break;
#endif
--- 4222,4228 ----
#ifdef ENABLE_RTL_CHECKING
case SEQUENCE:
! gcc_unreachable ();
break;
#endif
*************** emit_call_insn_after (rtx x, rtx after)
*** 4294,4303 ****
{
rtx last;
! #ifdef ENABLE_RTL_CHECKING
! if (after == NULL_RTX)
! abort ();
! #endif
switch (GET_CODE (x))
{
--- 4243,4249 ----
{
rtx last;
! gcc_assert (after);
switch (GET_CODE (x))
{
*************** emit_call_insn_after (rtx x, rtx after)
*** 4312,4318 ****
#ifdef ENABLE_RTL_CHECKING
case SEQUENCE:
! abort ();
break;
#endif
--- 4258,4264 ----
#ifdef ENABLE_RTL_CHECKING
case SEQUENCE:
! gcc_unreachable ();
break;
#endif
*************** emit_insn (rtx x)
*** 4513,4519 ****
#ifdef ENABLE_RTL_CHECKING
case SEQUENCE:
! abort ();
break;
#endif
--- 4459,4465 ----
#ifdef ENABLE_RTL_CHECKING
case SEQUENCE:
! gcc_unreachable ();
break;
#endif
*************** emit_jump_insn (rtx x)
*** 4554,4560 ****
#ifdef ENABLE_RTL_CHECKING
case SEQUENCE:
! abort ();
break;
#endif
--- 4500,4506 ----
#ifdef ENABLE_RTL_CHECKING
case SEQUENCE:
! gcc_unreachable ();
break;
#endif
*************** emit_call_insn (rtx x)
*** 4588,4594 ****
#ifdef ENABLE_RTL_CHECKING
case SEQUENCE:
! abort ();
break;
#endif
--- 4534,4540 ----
#ifdef ENABLE_RTL_CHECKING
case SEQUENCE:
! gcc_unreachable ();
break;
#endif
*************** set_unique_reg_note (rtx insn, enum reg_
*** 4737,4744 ****
means the insn only has one * useful * set). */
if (GET_CODE (PATTERN (insn)) == PARALLEL && multiple_sets (insn))
{
! if (note)
! abort ();
return NULL_RTX;
}
--- 4683,4689 ----
means the insn only has one * useful * set). */
if (GET_CODE (PATTERN (insn)) == PARALLEL && multiple_sets (insn))
{
! gcc_assert (!note);
return NULL_RTX;
}
*************** emit (rtx x)
*** 4807,4827 ****
{
enum rtx_code code = classify_insn (x);
! if (code == CODE_LABEL)
! return emit_label (x);
! else if (code == INSN)
! return emit_insn (x);
! else if (code == JUMP_INSN)
! {
! rtx insn = emit_jump_insn (x);
! if (any_uncondjump_p (insn) || GET_CODE (x) == RETURN)
! return emit_barrier ();
! return insn;
}
- else if (code == CALL_INSN)
- return emit_call_insn (x);
- else
- abort ();
}
/* Space for free sequence stack entries. */
--- 4752,4775 ----
{
enum rtx_code code = classify_insn (x);
! switch (code)
! {
! case CODE_LABEL:
! return emit_label (x);
! case INSN:
! return emit_insn (x);
! case JUMP_INSN:
! {
! rtx insn = emit_jump_insn (x);
! if (any_uncondjump_p (insn) || GET_CODE (x) == RETURN)
! return emit_barrier ();
! return insn;
! }
! case CALL_INSN:
! return emit_call_insn (x);
! default:
! gcc_unreachable ();
}
}
/* Space for free sequence stack entries. */
*************** push_to_full_sequence (rtx first, rtx la
*** 4883,4890 ****
first_insn = first;
last_insn = last;
/* We really should have the end of the insn chain here. */
! if (last && NEXT_INSN (last))
! abort ();
}
/* Set up the outer-level insn chain
--- 4831,4837 ----
first_insn = first;
last_insn = last;
/* We really should have the end of the insn chain here. */
! gcc_assert (!last || !NEXT_INSN (last));
}
/* Set up the outer-level insn chain
*************** copy_insn_1 (rtx orig)
*** 5104,5118 ****
break;
default:
! abort ();
}
}
if (code == SCRATCH)
{
i = copy_insn_n_scratches++;
! if (i >= MAX_RECOG_OPERANDS)
! abort ();
copy_insn_scratch_in[i] = orig;
copy_insn_scratch_out[i] = copy;
}
--- 5051,5064 ----
break;
default:
! gcc_unreachable ();
}
}
if (code == SCRATCH)
{
i = copy_insn_n_scratches++;
! gcc_assert (i < MAX_RECOG_OPERANDS);
copy_insn_scratch_in[i] = orig;
copy_insn_scratch_out[i] = copy;
}
*************** gen_const_vector_0 (enum machine_mode mo
*** 5227,5234 ****
v = rtvec_alloc (units);
/* We need to call this function after we to set CONST0_RTX first. */
! if (!CONST0_RTX (inner))
! abort ();
for (i = 0; i < units; ++i)
RTVEC_ELT (v, i) = CONST0_RTX (inner);
--- 5173,5179 ----
v = rtvec_alloc (units);
/* We need to call this function after we to set CONST0_RTX first. */
! gcc_assert (CONST0_RTX (inner));
for (i = 0; i < units; ++i)
RTVEC_ELT (v, i) = CONST0_RTX (inner);
*************** emit_copy_of_insn_after (rtx insn, rtx a
*** 5477,5483 ****
break;
default:
! abort ();
}
/* Update LABEL_NUSES. */
--- 5422,5428 ----
break;
default:
! gcc_unreachable ();
}
/* Update LABEL_NUSES. */
Index: et-forest.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/et-forest.c,v
retrieving revision 1.15
diff -c -3 -p -r1.15 et-forest.c
*** et-forest.c 5 Sep 2004 15:24:11 -0000 1.15
--- et-forest.c 8 Sep 2004 07:16:50 -0000
*************** static inline void
*** 88,95 ****
set_prev (struct et_occ *occ, struct et_occ *t)
{
#ifdef DEBUG_ET
! if (occ == t)
! abort ();
#endif
occ->prev = t;
--- 88,94 ----
set_prev (struct et_occ *occ, struct et_occ *t)
{
#ifdef DEBUG_ET
! gcc_assert (occ != t);
#endif
occ->prev = t;
*************** static inline void
*** 103,110 ****
set_next (struct et_occ *occ, struct et_occ *t)
{
#ifdef DEBUG_ET
! if (occ == t)
! abort ();
#endif
occ->next = t;
--- 102,108 ----
set_next (struct et_occ *occ, struct et_occ *t)
{
#ifdef DEBUG_ET
! gcc_assert (occ != t);
#endif
occ->next = t;
*************** et_check_occ_sanity (struct et_occ *occ)
*** 145,184 ****
if (!occ)
return;
! if (occ->parent == occ)
! abort ();
!
! if (occ->prev == occ)
! abort ();
!
! if (occ->next == occ)
! abort ();
!
! if (occ->next && occ->next == occ->prev)
! abort ();
if (occ->next)
{
! if (occ->next == occ->parent)
! abort ();
!
! if (occ->next->parent != occ)
! abort ();
}
if (occ->prev)
{
! if (occ->prev == occ->parent)
! abort ();
!
! if (occ->prev->parent != occ)
! abort ();
}
! if (occ->parent
! && occ->parent->prev != occ
! && occ->parent->next != occ)
! abort ();
}
/* Checks whether tree rooted at OCC is sane. */
--- 143,168 ----
if (!occ)
return;
! gcc_assert (occ->parent != occ);
! gcc_assert (occ->prev != occ);
! gcc_assert (occ->next != occ);
! gcc_assert (!occ->next || occ->next != occ->prev);
if (occ->next)
{
! gcc_assert (occ->next != occ->parent);
! gcc_assert (occ->next->parent == occ);
}
if (occ->prev)
{
! gcc_assert (occ->prev != occ->parent);
! gcc_assert (occ->prev->parent == occ);
}
! gcc_assert (!occ->parent
! || occ->parent->prev == occ
! || occ->parent->next == occ);
}
/* Checks whether tree rooted at OCC is sane. */
*************** record_path_before_1 (struct et_occ *occ
*** 233,240 ****
fprintf (stderr, "%d (%d); ", ((basic_block) occ->of->data)->index, depth);
! if (len >= MAX_NODES)
! abort ();
depths[len] = depth;
datas[len] = occ->of;
--- 217,223 ----
fprintf (stderr, "%d (%d); ", ((basic_block) occ->of->data)->index, depth);
! gcc_assert (len < MAX_NODES);
depths[len] = depth;
datas[len] = occ->of;
*************** record_path_before_1 (struct et_occ *occ
*** 247,254 ****
mn = m;
}
! if (mn != occ->min + depth - occ->depth)
! abort ();
return mn;
}
--- 230,236 ----
mn = m;
}
! gcc_assert (mn == occ->min + depth - occ->depth);
return mn;
}
*************** check_path_after_1 (struct et_occ *occ,
*** 285,293 ****
}
len--;
! if (depths[len] != depth
! || datas[len] != occ->of)
! abort ();
if (occ->prev)
{
--- 267,273 ----
}
len--;
! gcc_assert (depths[len] == depth && datas[len] == occ->of);
if (occ->prev)
{
*************** check_path_after_1 (struct et_occ *occ,
*** 296,303 ****
mn = m;
}
! if (mn != occ->min + depth - occ->depth)
! abort ();
return mn;
}
--- 276,282 ----
mn = m;
}
! gcc_assert (mn == occ->min + depth - occ->depth);
return mn;
}
*************** check_path_after (struct et_occ *occ)
*** 312,319 ****
occ = occ->parent;
check_path_after_1 (occ, 0);
! if (len != 0)
! abort ();
}
#endif
--- 291,297 ----
occ = occ->parent;
check_path_after_1 (occ, 0);
! gcc_assert (!len);
}
#endif
Index: except.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/except.c,v
retrieving revision 1.284
diff -c -3 -p -r1.284 except.c
*** except.c 25 Aug 2004 09:51:21 -0000 1.284
--- except.c 8 Sep 2004 07:16:57 -0000
*************** gen_eh_region (enum eh_region_type type,
*** 460,467 ****
struct eh_region *new;
#ifdef ENABLE_CHECKING
! if (! doing_eh (0))
! abort ();
#endif
/* Insert a new blank region as a leaf in the tree. */
--- 460,466 ----
struct eh_region *new;
#ifdef ENABLE_CHECKING
! gcc_assert (doing_eh (0));
#endif
/* Insert a new blank region as a leaf in the tree. */
*************** resolve_one_fixup_region (struct eh_regi
*** 688,695 ****
&& cleanup->u.cleanup.exp == fixup->u.fixup.cleanup_exp)
break;
}
! if (j > n)
! abort ();
real = cleanup->outer;
if (real && real->type == ERT_FIXUP)
--- 687,693 ----
&& cleanup->u.cleanup.exp == fixup->u.fixup.cleanup_exp)
break;
}
! gcc_assert (j <= n);
real = cleanup->outer;
if (real && real->type == ERT_FIXUP)
*************** remove_unreachable_regions (rtx insns)
*** 811,824 ****
if (r->resume)
{
! if (uid_region_num[INSN_UID (r->resume)])
! abort ();
uid_region_num[INSN_UID (r->resume)] = i;
}
if (r->label)
{
! if (uid_region_num[INSN_UID (r->label)])
! abort ();
uid_region_num[INSN_UID (r->label)] = i;
}
}
--- 809,820 ----
if (r->resume)
{
! gcc_assert (!uid_region_num[INSN_UID (r->resume)]);
uid_region_num[INSN_UID (r->resume)] = i;
}
if (r->label)
{
! gcc_assert (!uid_region_num[INSN_UID (r->label)]);
uid_region_num[INSN_UID (r->label)] = i;
}
}
*************** convert_from_eh_region_ranges_1 (rtx *pi
*** 942,949 ****
}
}
! if (sp != orig_sp)
! abort ();
}
static void
--- 938,944 ----
}
}
! gcc_assert (sp == orig_sp);
}
static void
*************** add_ehl_entry (rtx label, struct eh_regi
*** 1006,1013 ****
label. After landing pad creation, the exception handlers may
share landing pads. This is ok, since maybe_remove_eh_handler
only requires the 1-1 mapping before landing pad creation. */
! if (*slot && !cfun->eh->built_landing_pads)
! abort ();
*slot = entry;
}
--- 1001,1007 ----
label. After landing pad creation, the exception handlers may
share landing pads. This is ok, since maybe_remove_eh_handler
only requires the 1-1 mapping before landing pad creation. */
! gcc_assert (!*slot || cfun->eh->built_landing_pads);
*slot = entry;
}
*************** duplicate_eh_region_1 (struct eh_region
*** 1104,1110 ****
n->u.throw.type = o->u.throw.type;
default:
! abort ();
}
if (o->label)
--- 1098,1104 ----
n->u.throw.type = o->u.throw.type;
default:
! gcc_unreachable ();
}
if (o->label)
*************** duplicate_eh_region_1 (struct eh_region
*** 1112,1119 ****
if (o->resume)
{
n->resume = map->insn_map[INSN_UID (o->resume)];
! if (n->resume == NULL)
! abort ();
}
return n;
--- 1106,1112 ----
if (o->resume)
{
n->resume = map->insn_map[INSN_UID (o->resume)];
! gcc_assert (n->resume);
}
return n;
*************** build_post_landing_pads (void)
*** 1586,1592 ****
break;
default:
! abort ();
}
}
}
--- 1579,1585 ----
break;
default:
! gcc_unreachable ();
}
}
}
*************** connect_post_landing_pads (void)
*** 1657,1664 ****
end_sequence ();
barrier = emit_insn_before (seq, region->resume);
/* Avoid duplicate barrier. */
! if (!BARRIER_P (barrier))
! abort ();
delete_insn (barrier);
delete_insn (region->resume);
--- 1650,1656 ----
end_sequence ();
barrier = emit_insn_before (seq, region->resume);
/* Avoid duplicate barrier. */
! gcc_assert (BARRIER_P (barrier));
delete_insn (barrier);
delete_insn (region->resume);
*************** sjlj_emit_function_exit (void)
*** 2049,2056 ****
/* Figure out whether the place we are supposed to insert libcall
is inside the last basic block or after it. In the other case
we need to emit to edge. */
! if (e->src->next_bb != EXIT_BLOCK_PTR)
! abort ();
for (insn = NEXT_INSN (BB_END (e->src)); insn; insn = NEXT_INSN (insn))
if (insn == cfun->eh->sjlj_exit_after)
break;
--- 2041,2047 ----
/* Figure out whether the place we are supposed to insert libcall
is inside the last basic block or after it. In the other case
we need to emit to edge. */
! gcc_assert (e->src->next_bb == EXIT_BLOCK_PTR);
for (insn = NEXT_INSN (BB_END (e->src)); insn; insn = NEXT_INSN (insn))
if (insn == cfun->eh->sjlj_exit_after)
break;
*************** remove_exception_handler_label (rtx labe
*** 2258,2265 ****
tmp.label = label;
slot = (struct ehl_map_entry **)
htab_find_slot (cfun->eh->exception_handler_label_map, &tmp, NO_INSERT);
! if (! slot)
! abort ();
htab_clear_slot (cfun->eh->exception_handler_label_map, (void **) slot);
}
--- 2249,2255 ----
tmp.label = label;
slot = (struct ehl_map_entry **)
htab_find_slot (cfun->eh->exception_handler_label_map, &tmp, NO_INSERT);
! gcc_assert (slot);
htab_clear_slot (cfun->eh->exception_handler_label_map, (void **) slot);
}
*************** remove_eh_handler (struct eh_region *reg
*** 2330,2337 ****
try->type == ERT_CATCH;
try = try->next_peer)
continue;
! if (try->type != ERT_TRY)
! abort ();
next = region->u.catch.next_catch;
prev = region->u.catch.prev_catch;
--- 2320,2326 ----
try->type == ERT_CATCH;
try = try->next_peer)
continue;
! gcc_assert (try->type == ERT_TRY);
next = region->u.catch.next_catch;
prev = region->u.catch.prev_catch;
*************** reachable_next_level (struct eh_region *
*** 2642,2651 ****
case ERT_FIXUP:
case ERT_UNKNOWN:
/* Shouldn't see these here. */
break;
}
-
- abort ();
}
/* Invoke CALLBACK on each region reachable from REGION_NUMBER. */
--- 2631,2641 ----
case ERT_FIXUP:
case ERT_UNKNOWN:
/* Shouldn't see these here. */
+ gcc_unreachable ();
break;
+ default:
+ gcc_unreachable ();
}
}
/* Invoke CALLBACK on each region reachable from REGION_NUMBER. */
*************** collect_one_action_chain (htab_t ar_hash
*** 3259,3265 ****
return collect_one_action_chain (ar_hash, region->outer);
default:
! abort ();
}
}
--- 3249,3255 ----
return collect_one_action_chain (ar_hash, region->outer);
default:
! gcc_unreachable ();
}
}
*************** output_function_exception_table (void)
*** 3763,3770 ****
cgraph_varpool_mark_needed_node (node);
}
}
! else if (TREE_CODE (type) != INTEGER_CST)
! abort ();
}
if (tt_format == DW_EH_PE_absptr || tt_format == DW_EH_PE_aligned)
--- 3753,3760 ----
cgraph_varpool_mark_needed_node (node);
}
}
! else
! gcc_assert (TREE_CODE (type) == INTEGER_CST);
}
if (tt_format == DW_EH_PE_absptr || tt_format == DW_EH_PE_aligned)
Index: explow.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/explow.c,v
retrieving revision 1.138
diff -c -3 -p -r1.138 explow.c
*** explow.c 18 Aug 2004 08:23:42 -0000 1.138
--- explow.c 8 Sep 2004 07:17:01 -0000
*************** trunc_int_for_mode (HOST_WIDE_INT c, enu
*** 50,57 ****
int width = GET_MODE_BITSIZE (mode);
/* You want to truncate to a _what_? */
! if (! SCALAR_INT_MODE_P (mode))
! abort ();
/* Canonicalize BImode to 0 and STORE_FLAG_VALUE. */
if (mode == BImode)
--- 50,56 ----
int width = GET_MODE_BITSIZE (mode);
/* You want to truncate to a _what_? */
! gcc_assert (SCALAR_INT_MODE_P (mode));
/* Canonicalize BImode to 0 and STORE_FLAG_VALUE. */
if (mode == BImode)
*************** copy_to_mode_reg (enum machine_mode mode
*** 633,640 ****
if (! general_operand (x, VOIDmode))
x = force_operand (x, temp);
! if (GET_MODE (x) != mode && GET_MODE (x) != VOIDmode)
! abort ();
if (x != temp)
emit_move_insn (temp, x);
return temp;
--- 632,638 ----
if (! general_operand (x, VOIDmode))
x = force_operand (x, temp);
! gcc_assert (GET_MODE (x) == mode || GET_MODE (x) == VOIDmode);
if (x != temp)
emit_move_insn (temp, x);
return temp;
*************** optimize_save_area_alloca (void)
*** 1106,1116 ****
Right now only supported port with stack that grow upward
is the HPPA and it does not define SETJMP_VIA_SAVE_AREA. */
! if (GET_CODE (pat) != SET
! || SET_DEST (pat) != stack_pointer_rtx
! || GET_CODE (SET_SRC (pat)) != MINUS
! || XEXP (SET_SRC (pat), 0) != stack_pointer_rtx)
! abort ();
/* This will now be transformed into a (set REG REG)
so we can just blow away all the other notes. */
--- 1104,1113 ----
Right now only supported port with stack that grow upward
is the HPPA and it does not define SETJMP_VIA_SAVE_AREA. */
! gcc_assert (GET_CODE (pat) == SET
! && SET_DEST (pat) == stack_pointer_rtx
! && GET_CODE (SET_SRC (pat)) == MINUS
! && XEXP (SET_SRC (pat), 0) == stack_pointer_rtx);
/* This will now be transformed into a (set REG REG)
so we can just blow away all the other notes. */
*************** optimize_save_area_alloca (void)
*** 1134,1141 ****
if (XEXP (srch, 1) == note)
break;
! if (srch == NULL_RTX)
! abort ();
XEXP (srch, 1) = XEXP (note, 1);
}
--- 1131,1137 ----
if (XEXP (srch, 1) == note)
break;
! gcc_assert (srch);
XEXP (srch, 1) = XEXP (note, 1);
}
*************** allocate_dynamic_stack_space (rtx size,
*** 1229,1236 ****
/* ??? Code below assumes that the save area needs maximal
alignment. This constraint may be too strong. */
! if (PREFERRED_STACK_BOUNDARY != BIGGEST_ALIGNMENT)
! abort ();
if (GET_CODE (size) == CONST_INT)
{
--- 1225,1231 ----
/* ??? Code below assumes that the save area needs maximal
alignment. This constraint may be too strong. */
! gcc_assert (PREFERRED_STACK_BOUNDARY == BIGGEST_ALIGNMENT);
if (GET_CODE (size) == CONST_INT)
{
*************** allocate_dynamic_stack_space (rtx size,
*** 1287,1294 ****
/* We ought to be called always on the toplevel and stack ought to be aligned
properly. */
! if (stack_pointer_delta % (PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT))
! abort ();
/* If needed, check that we have the required amount of stack. Take into
account what has already been checked. */
--- 1282,1289 ----
/* We ought to be called always on the toplevel and stack ought to be aligned
properly. */
! gcc_assert (!(stack_pointer_delta
! % (PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT)));
/* If needed, check that we have the required amount of stack. Take into
account what has already been checked. */
*************** probe_stack_range (HOST_WIDE_INT first,
*** 1539,1546 ****
1, OPTAB_WIDEN);
#endif
! if (temp != test_addr)
! abort ();
emit_label (test_lab);
emit_cmp_and_jump_insns (test_addr, last_addr, CMP_OPCODE,
--- 1534,1540 ----
1, OPTAB_WIDEN);
#endif
! gcc_assert (temp == test_addr);
emit_label (test_lab);
emit_cmp_and_jump_insns (test_addr, last_addr, CMP_OPCODE,
*************** hard_function_value (tree valtype, tree
*** 1594,1601 ****
}
/* No suitable mode found. */
! if (tmpmode == VOIDmode)
! abort ();
PUT_MODE (val, tmpmode);
}
--- 1588,1594 ----
}
/* No suitable mode found. */
! gcc_assert (tmpmode != VOIDmode);
PUT_MODE (val, tmpmode);
}
Index: expmed.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/expmed.c,v
retrieving revision 1.194
diff -c -3 -p -r1.194 expmed.c
*** expmed.c 2 Sep 2004 02:00:55 -0000 1.194
--- expmed.c 8 Sep 2004 07:17:12 -0000
*************** mode_for_extraction (enum extraction_pat
*** 298,304 ****
return MAX_MACHINE_MODE;
default:
! abort ();
}
if (opno == -1)
--- 298,304 ----
return MAX_MACHINE_MODE;
default:
! gcc_unreachable ();
}
if (opno == -1)
*************** store_bit_field (rtx str_rtx, unsigned H
*** 386,395 ****
/* We could handle this, but we should always be called with a pseudo
for our targets and all insns should take them as outputs. */
! if (! (*insn_data[icode].operand[0].predicate) (dest, mode0)
! || ! (*insn_data[icode].operand[1].predicate) (src, mode1)
! || ! (*insn_data[icode].operand[2].predicate) (rtxpos, mode2))
! abort ();
pat = GEN_FCN (icode) (dest, src, rtxpos);
seq = get_insns ();
end_sequence ();
--- 386,394 ----
/* We could handle this, but we should always be called with a pseudo
for our targets and all insns should take them as outputs. */
! gcc_assert ((*insn_data[icode].operand[0].predicate) (dest, mode0)
! && (*insn_data[icode].operand[1].predicate) (src, mode1)
! && (*insn_data[icode].operand[2].predicate) (rtxpos, mode2));
pat = GEN_FCN (icode) (dest, src, rtxpos);
seq = get_insns ();
end_sequence ();
*************** store_bit_field (rtx str_rtx, unsigned H
*** 433,447 ****
{
if (GET_CODE (op0) == SUBREG)
{
! if (GET_MODE (SUBREG_REG (op0)) == fieldmode
! || GET_MODE_CLASS (fieldmode) == MODE_INT
! || GET_MODE_CLASS (fieldmode) == MODE_PARTIAL_INT)
! op0 = SUBREG_REG (op0);
! else
! /* Else we've got some float mode source being extracted into
! a different float mode destination -- this combination of
! subregs results in Severe Tire Damage. */
! abort ();
}
if (REG_P (op0))
op0 = gen_rtx_SUBREG (fieldmode, op0, byte_offset);
--- 432,445 ----
{
if (GET_CODE (op0) == SUBREG)
{
! /* Else we've got some float mode source being extracted
! into a different float mode destination -- this
! combination of subregs results in Severe Tire
! Damage. */
! gcc_assert (GET_MODE (SUBREG_REG (op0)) == fieldmode
! || GET_MODE_CLASS (fieldmode) == MODE_INT
! || GET_MODE_CLASS (fieldmode) == MODE_PARTIAL_INT);
! op0 = SUBREG_REG (op0);
}
if (REG_P (op0))
op0 = gen_rtx_SUBREG (fieldmode, op0, byte_offset);
*************** store_bit_field (rtx str_rtx, unsigned H
*** 462,471 ****
{
if (MEM_P (op0))
op0 = adjust_address (op0, imode, 0);
- else if (imode != BLKmode)
- op0 = gen_lowpart (imode, op0);
else
! abort ();
}
}
--- 460,470 ----
{
if (MEM_P (op0))
op0 = adjust_address (op0, imode, 0);
else
! {
! gcc_assert (imode != BLKmode);
! op0 = gen_lowpart (imode, op0);
! }
}
}
*************** store_bit_field (rtx str_rtx, unsigned H
*** 510,524 ****
if (GET_CODE (op0) == SUBREG)
{
! if (GET_MODE (SUBREG_REG (op0)) == fieldmode
! || GET_MODE_CLASS (fieldmode) == MODE_INT
! || GET_MODE_CLASS (fieldmode) == MODE_PARTIAL_INT)
! op0 = SUBREG_REG (op0);
! else
! /* Else we've got some float mode source being extracted into
! a different float mode destination -- this combination of
! subregs results in Severe Tire Damage. */
! abort ();
}
emit_insn (GEN_FCN (icode)
--- 509,521 ----
if (GET_CODE (op0) == SUBREG)
{
! /* Else we've got some float mode source being extracted into
! a different float mode destination -- this combination of
! subregs results in Severe Tire Damage. */
! gcc_assert (GET_MODE (SUBREG_REG (op0)) == fieldmode
! || GET_MODE_CLASS (fieldmode) == MODE_INT
! || GET_MODE_CLASS (fieldmode) == MODE_PARTIAL_INT);
! op0 = SUBREG_REG (op0);
}
emit_insn (GEN_FCN (icode)
*************** store_bit_field (rtx str_rtx, unsigned H
*** 589,600 ****
pseudo. We can trivially remove a SUBREG that does not
change the size of the operand. Such a SUBREG may have been
added above. Otherwise, abort. */
! if (GET_CODE (op0) == SUBREG
! && (GET_MODE_SIZE (GET_MODE (op0))
! == GET_MODE_SIZE (GET_MODE (SUBREG_REG (op0)))))
! op0 = SUBREG_REG (op0);
! else
! abort ();
}
op0 = gen_rtx_SUBREG (mode_for_size (BITS_PER_WORD, MODE_INT, 0),
op0, (offset * UNITS_PER_WORD));
--- 586,595 ----
pseudo. We can trivially remove a SUBREG that does not
change the size of the operand. Such a SUBREG may have been
added above. Otherwise, abort. */
! gcc_assert (GET_CODE (op0) == SUBREG
! && (GET_MODE_SIZE (GET_MODE (op0))
! == GET_MODE_SIZE (GET_MODE (SUBREG_REG (op0)))));
! op0 = SUBREG_REG (op0);
}
op0 = gen_rtx_SUBREG (mode_for_size (BITS_PER_WORD, MODE_INT, 0),
op0, (offset * UNITS_PER_WORD));
*************** store_bit_field (rtx str_rtx, unsigned H
*** 731,742 ****
}
else if (GET_CODE (value) == CONST_INT)
value1 = gen_int_mode (INTVAL (value), maxmode);
! else if (!CONSTANT_P (value))
/* Parse phase is supposed to make VALUE's data type
match that of the component reference, which is a type
at least as wide as the field; so VALUE should have
a mode that corresponds to that type. */
! abort ();
}
/* If this machine's insv insists on a register,
--- 726,737 ----
}
else if (GET_CODE (value) == CONST_INT)
value1 = gen_int_mode (INTVAL (value), maxmode);
! else
/* Parse phase is supposed to make VALUE's data type
match that of the component reference, which is a type
at least as wide as the field; so VALUE should have
a mode that corresponds to that type. */
! gcc_assert (CONSTANT_P (value));
}
/* If this machine's insv insists on a register,
*************** store_fixed_bit_field (rtx op0, unsigned
*** 790,797 ****
if (REG_P (op0) || GET_CODE (op0) == SUBREG)
{
! if (offset != 0)
! abort ();
/* Special treatment for a bit field split across two registers. */
if (bitsize + bitpos > BITS_PER_WORD)
{
--- 785,791 ----
if (REG_P (op0) || GET_CODE (op0) == SUBREG)
{
! gcc_assert (!offset);
/* Special treatment for a bit field split across two registers. */
if (bitsize + bitpos > BITS_PER_WORD)
{
*************** extract_bit_field (rtx str_rtx, unsigned
*** 1146,1155 ****
/* We could handle this, but we should always be called with a pseudo
for our targets and all insns should take them as outputs. */
! if (! (*insn_data[icode].operand[0].predicate) (dest, mode0)
! || ! (*insn_data[icode].operand[1].predicate) (src, mode1)
! || ! (*insn_data[icode].operand[2].predicate) (rtxpos, mode2))
! abort ();
pat = GEN_FCN (icode) (dest, src, rtxpos);
seq = get_insns ();
--- 1140,1148 ----
/* We could handle this, but we should always be called with a pseudo
for our targets and all insns should take them as outputs. */
! gcc_assert ((*insn_data[icode].operand[0].predicate) (dest, mode0)
! && (*insn_data[icode].operand[1].predicate) (src, mode1)
! && (*insn_data[icode].operand[2].predicate) (rtxpos, mode2));
pat = GEN_FCN (icode) (dest, src, rtxpos);
seq = get_insns ();
*************** extract_bit_field (rtx str_rtx, unsigned
*** 1170,1179 ****
{
if (MEM_P (op0))
op0 = adjust_address (op0, imode, 0);
- else if (imode != BLKmode)
- op0 = gen_lowpart (imode, op0);
else
! abort ();
}
}
--- 1163,1173 ----
{
if (MEM_P (op0))
op0 = adjust_address (op0, imode, 0);
else
! {
! gcc_assert (imode != BLKmode);
! op0 = gen_lowpart (imode, op0);
! }
}
}
*************** extract_bit_field (rtx str_rtx, unsigned
*** 1299,1306 ****
bitnum + bit_offset, 1, target_part, mode,
word_mode);
! if (target_part == 0)
! abort ();
if (result_part != target_part)
emit_move_insn (target_part, result_part);
--- 1293,1299 ----
bitnum + bit_offset, 1, target_part, mode,
word_mode);
! gcc_assert (target_part);
if (result_part != target_part)
emit_move_insn (target_part, result_part);
*************** extract_bit_field (rtx str_rtx, unsigned
*** 1346,1358 ****
int_mode = int_mode_for_mode (tmode);
if (int_mode == BLKmode)
int_mode = int_mode_for_mode (mode);
! if (int_mode == BLKmode)
! abort (); /* Should probably push op0 out to memory and then
! do a load. */
/* OFFSET is the number of words or bytes (UNIT says which)
from STR_RTX to the first word or byte containing part of the field. */
-
if (!MEM_P (op0))
{
if (offset != 0
--- 1339,1349 ----
int_mode = int_mode_for_mode (tmode);
if (int_mode == BLKmode)
int_mode = int_mode_for_mode (mode);
! /* Should probably push op0 out to memory and then do a load. */
! gcc_assert (int_mode != BLKmode);
/* OFFSET is the number of words or bytes (UNIT says which)
from STR_RTX to the first word or byte containing part of the field. */
if (!MEM_P (op0))
{
if (offset != 0
*************** expand_shift (enum tree_code code, enum
*** 2145,2152 ****
define_expand for lshrsi3 was added to vax.md. */
}
! if (temp == 0)
! abort ();
return temp;
}
--- 2136,2142 ----
define_expand for lshrsi3 was added to vax.md. */
}
! gcc_assert (temp);
return temp;
}
*************** expand_mult_const (enum machine_mode mod
*** 2649,2655 ****
val_so_far = 1;
}
else
! abort ();
for (opno = 1; opno < alg->ops; opno++)
{
--- 2639,2645 ----
val_so_far = 1;
}
else
! gcc_unreachable ();
for (opno = 1; opno < alg->ops; opno++)
{
*************** expand_mult_const (enum machine_mode mod
*** 2727,2733 ****
break;
default:
! abort ();
}
/* Write a REG_EQUAL note on the last insn so that we can cse
--- 2717,2723 ----
break;
default:
! gcc_unreachable ();
}
/* Write a REG_EQUAL note on the last insn so that we can cse
*************** expand_mult_const (enum machine_mode mod
*** 2762,2769 ****
in the result mode, to avoid sign-/zero-extension confusion. */
val &= GET_MODE_MASK (mode);
val_so_far &= GET_MODE_MASK (mode);
! if (val != val_so_far)
! abort ();
return accum;
}
--- 2752,2758 ----
in the result mode, to avoid sign-/zero-extension confusion. */
val &= GET_MODE_MASK (mode);
val_so_far &= GET_MODE_MASK (mode);
! gcc_assert (val == val_so_far);
return accum;
}
*************** expand_mult (enum machine_mode mode, rtx
*** 2848,2855 ****
&& flag_trapv && (GET_MODE_CLASS(mode) == MODE_INT)
? smulv_optab : smul_optab,
op0, op1, target, unsignedp, OPTAB_LIB_WIDEN);
! if (op0 == 0)
! abort ();
return op0;
}
--- 2837,2843 ----
&& flag_trapv && (GET_MODE_CLASS(mode) == MODE_INT)
? smulv_optab : smul_optab,
op0, op1, target, unsignedp, OPTAB_LIB_WIDEN);
! gcc_assert (op0);
return op0;
}
*************** choose_multiplier (unsigned HOST_WIDE_IN
*** 2893,2910 ****
/* lgup = ceil(log2(divisor)); */
lgup = ceil_log2 (d);
! if (lgup > n)
! abort ();
pow = n + lgup;
pow2 = n + lgup - precision;
! if (pow == 2 * HOST_BITS_PER_WIDE_INT)
! {
! /* We could handle this with some effort, but this case is much better
! handled directly with a scc insn, so rely on caller using that. */
! abort ();
! }
/* mlow = 2^(N + lgup)/d */
if (pow >= HOST_BITS_PER_WIDE_INT)
--- 2881,2895 ----
/* lgup = ceil(log2(divisor)); */
lgup = ceil_log2 (d);
! gcc_assert (lgup <= n);
pow = n + lgup;
pow2 = n + lgup - precision;
! /* We could handle this with some effort, but this case is much
! better handled directly with a scc insn, so rely on caller using
! that. */
! gcc_assert (pow != 2 * HOST_BITS_PER_WIDE_INT);
/* mlow = 2^(N + lgup)/d */
if (pow >= HOST_BITS_PER_WIDE_INT)
*************** choose_multiplier (unsigned HOST_WIDE_IN
*** 2928,2940 ****
div_and_round_double (TRUNC_DIV_EXPR, 1, nl, nh, d, (HOST_WIDE_INT) 0,
&mhigh_lo, &mhigh_hi, &dummy1, &dummy2);
! if (mhigh_hi && nh - d >= d)
! abort ();
! if (mhigh_hi > 1 || mlow_hi > 1)
! abort ();
/* Assert that mlow < mhigh. */
! if (! (mlow_hi < mhigh_hi || (mlow_hi == mhigh_hi && mlow_lo < mhigh_lo)))
! abort ();
/* If precision == N, then mlow, mhigh exceed 2^N
(but they do not exceed 2^(N+1)). */
--- 2913,2923 ----
div_and_round_double (TRUNC_DIV_EXPR, 1, nl, nh, d, (HOST_WIDE_INT) 0,
&mhigh_lo, &mhigh_hi, &dummy1, &dummy2);
! gcc_assert (!mhigh_hi || nh - d < d);
! gcc_assert (mhigh_hi <= 1 && mlow_hi <= 1);
/* Assert that mlow < mhigh. */
! gcc_assert (mlow_hi < mhigh_hi
! || (mlow_hi == mhigh_hi && mlow_lo < mhigh_lo));
/* If precision == N, then mlow, mhigh exceed 2^N
(but they do not exceed 2^(N+1)). */
*************** expand_mult_highpart (enum machine_mode
*** 3156,3163 ****
rtx op1, tem;
/* We can't support modes wider than HOST_BITS_PER_INT. */
! if (GET_MODE_BITSIZE (mode) > HOST_BITS_PER_WIDE_INT)
! abort ();
op1 = gen_int_mode (cnst1, wider_mode);
cnst1 &= GET_MODE_MASK (mode);
--- 3139,3145 ----
rtx op1, tem;
/* We can't support modes wider than HOST_BITS_PER_INT. */
! gcc_assert (GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT);
op1 = gen_int_mode (cnst1, wider_mode);
cnst1 &= GET_MODE_MASK (mode);
*************** expand_divmod (int rem_flag, enum tree_c
*** 3662,3669 ****
mh = choose_multiplier (d >> pre_shift, size,
size - pre_shift,
&ml, &post_shift, &dummy);
! if (mh)
! abort ();
}
else
pre_shift = 0;
--- 3644,3650 ----
mh = choose_multiplier (d >> pre_shift, size,
size - pre_shift,
&ml, &post_shift, &dummy);
! gcc_assert (!mh);
}
else
pre_shift = 0;
*************** expand_divmod (int rem_flag, enum tree_c
*** 3939,3946 ****
mh = choose_multiplier (d, size, size - 1,
&ml, &post_shift, &lgup);
! if (mh)
! abort ();
if (post_shift < BITS_PER_WORD
&& size - 1 < BITS_PER_WORD)
--- 3920,3926 ----
mh = choose_multiplier (d, size, size - 1,
&ml, &post_shift, &lgup);
! gcc_assert (!mh);
if (post_shift < BITS_PER_WORD
&& size - 1 < BITS_PER_WORD)
*************** expand_divmod (int rem_flag, enum tree_c
*** 4398,4404 ****
return gen_lowpart (mode, rem_flag ? remainder : quotient);
default:
! abort ();
}
if (quotient == 0)
--- 4378,4384 ----
return gen_lowpart (mode, rem_flag ? remainder : quotient);
default:
! gcc_unreachable ();
}
if (quotient == 0)
*************** emit_store_flag (rtx target, enum rtx_co
*** 4899,4918 ****
= compare_from_rtx (op0, op1, code, unsignedp, mode, NULL_RTX);
if (CONSTANT_P (comparison))
{
! if (GET_CODE (comparison) == CONST_INT)
{
if (comparison == const0_rtx)
return const0_rtx;
! }
#ifdef FLOAT_STORE_FLAG_VALUE
! else if (GET_CODE (comparison) == CONST_DOUBLE)
! {
if (comparison == CONST0_RTX (GET_MODE (comparison)))
return const0_rtx;
! }
#endif
! else
! abort ();
if (normalizep == 1)
return const1_rtx;
if (normalizep == -1)
--- 4879,4901 ----
= compare_from_rtx (op0, op1, code, unsignedp, mode, NULL_RTX);
if (CONSTANT_P (comparison))
{
! switch (GET_CODE (comparison))
{
+ case CONST_INT:
if (comparison == const0_rtx)
return const0_rtx;
! break;
!
#ifdef FLOAT_STORE_FLAG_VALUE
! case CONST_DOUBLE:
if (comparison == CONST0_RTX (GET_MODE (comparison)))
return const0_rtx;
! break;
#endif
! default:
! gcc_unreachable ();
! }
!
if (normalizep == 1)
return const1_rtx;
if (normalizep == -1)
*************** emit_store_flag (rtx target, enum rtx_co
*** 4987,5000 ****
op0 = expand_shift (RSHIFT_EXPR, compare_mode, op0,
size_int (GET_MODE_BITSIZE (compare_mode) - 1),
subtarget, normalizep == 1);
! else if (STORE_FLAG_VALUE & 1)
{
op0 = expand_and (compare_mode, op0, const1_rtx, subtarget);
if (normalizep == -1)
op0 = expand_unop (compare_mode, neg_optab, op0, op0, 0);
}
- else
- abort ();
/* If we were converting to a smaller mode, do the
conversion now. */
--- 4970,4983 ----
op0 = expand_shift (RSHIFT_EXPR, compare_mode, op0,
size_int (GET_MODE_BITSIZE (compare_mode) - 1),
subtarget, normalizep == 1);
! else
{
+ gcc_assert (STORE_FLAG_VALUE & 1);
+
op0 = expand_and (compare_mode, op0, const1_rtx, subtarget);
if (normalizep == -1)
op0 = expand_unop (compare_mode, neg_optab, op0, op0, 0);
}
/* If we were converting to a smaller mode, do the
conversion now. */
*************** do_cmp_and_jump (rtx arg1, rtx arg2, enu
*** 5262,5280 ****
/* do_jump_by_parts_equality_rtx compares with zero. Luckily
that's the only equality operations we do */
case EQ:
! if (arg2 != const0_rtx || mode != GET_MODE(arg1))
! abort ();
do_jump_by_parts_equality_rtx (arg1, label2, label);
break;
case NE:
! if (arg2 != const0_rtx || mode != GET_MODE(arg1))
! abort ();
do_jump_by_parts_equality_rtx (arg1, label, label2);
break;
default:
! abort ();
}
emit_label (label2);
--- 5245,5261 ----
/* do_jump_by_parts_equality_rtx compares with zero. Luckily
that's the only equality operations we do */
case EQ:
! gcc_assert (arg2 == const0_rtx && mode == GET_MODE(arg1));
do_jump_by_parts_equality_rtx (arg1, label2, label);
break;
case NE:
! gcc_assert (arg2 == const0_rtx && mode == GET_MODE(arg1));
do_jump_by_parts_equality_rtx (arg1, label, label2);
break;
default:
! gcc_unreachable ();
}
emit_label (label2);
Index: expr.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/expr.c,v
retrieving revision 1.717
diff -c -3 -p -r1.717 expr.c
*** expr.c 7 Sep 2004 10:22:40 -0000 1.717
--- expr.c 8 Sep 2004 07:17:30 -0000
*************** convert_move (rtx to, rtx from, int unsi
*** 335,342 ****
: (unsignedp ? ZERO_EXTEND : SIGN_EXTEND));
! if (to_real != from_real)
! abort ();
/* If the source and destination are already the same, then there's
nothing to do. */
--- 335,341 ----
: (unsignedp ? ZERO_EXTEND : SIGN_EXTEND));
! gcc_assert (to_real == from_real);
/* If the source and destination are already the same, then there's
nothing to do. */
*************** convert_move (rtx to, rtx from, int unsi
*** 353,360 ****
&& SUBREG_PROMOTED_UNSIGNED_P (from) == unsignedp)
from = gen_lowpart (to_mode, from), from_mode = to_mode;
! if (GET_CODE (to) == SUBREG && SUBREG_PROMOTED_VAR_P (to))
! abort ();
if (to_mode == from_mode
|| (from_mode == VOIDmode && CONSTANT_P (from)))
--- 352,358 ----
&& SUBREG_PROMOTED_UNSIGNED_P (from) == unsignedp)
from = gen_lowpart (to_mode, from), from_mode = to_mode;
! gcc_assert (GET_CODE (to) != SUBREG || !SUBREG_PROMOTED_VAR_P (to));
if (to_mode == from_mode
|| (from_mode == VOIDmode && CONSTANT_P (from)))
*************** convert_move (rtx to, rtx from, int unsi
*** 365,372 ****
if (VECTOR_MODE_P (to_mode) || VECTOR_MODE_P (from_mode))
{
! if (GET_MODE_BITSIZE (from_mode) != GET_MODE_BITSIZE (to_mode))
! abort ();
if (VECTOR_MODE_P (to_mode))
from = simplify_gen_subreg (to_mode, from, GET_MODE (from), 0);
--- 363,369 ----
if (VECTOR_MODE_P (to_mode) || VECTOR_MODE_P (from_mode))
{
! gcc_assert (GET_MODE_BITSIZE (from_mode) == GET_MODE_BITSIZE (to_mode));
if (VECTOR_MODE_P (to_mode))
from = simplify_gen_subreg (to_mode, from, GET_MODE (from), 0);
*************** convert_move (rtx to, rtx from, int unsi
*** 389,400 ****
rtx value, insns;
convert_optab tab;
if (GET_MODE_PRECISION (from_mode) < GET_MODE_PRECISION (to_mode))
tab = sext_optab;
- else if (GET_MODE_PRECISION (from_mode) > GET_MODE_PRECISION (to_mode))
- tab = trunc_optab;
else
! abort ();
/* Try converting directly if the insn is supported. */
--- 386,398 ----
rtx value, insns;
convert_optab tab;
+ gcc_assert (GET_MODE_PRECISION (from_mode)
+ != GET_MODE_PRECISION (to_mode));
+
if (GET_MODE_PRECISION (from_mode) < GET_MODE_PRECISION (to_mode))
tab = sext_optab;
else
! tab = trunc_optab;
/* Try converting directly if the insn is supported. */
*************** convert_move (rtx to, rtx from, int unsi
*** 409,417 ****
/* Otherwise use a libcall. */
libcall = tab->handlers[to_mode][from_mode].libfunc;
! if (!libcall)
! /* This conversion is not implemented yet. */
! abort ();
start_sequence ();
value = emit_library_call_value (libcall, NULL_RTX, LCT_CONST, to_mode,
--- 407,414 ----
/* Otherwise use a libcall. */
libcall = tab->handlers[to_mode][from_mode].libfunc;
! /* Is this conversion implemented yet? */
! gcc_assert (libcall);
start_sequence ();
value = emit_library_call_value (libcall, NULL_RTX, LCT_CONST, to_mode,
*************** convert_move (rtx to, rtx from, int unsi
*** 433,441 ****
enum machine_mode full_mode
= smallest_mode_for_size (GET_MODE_BITSIZE (to_mode), MODE_INT);
! if (trunc_optab->handlers[to_mode][full_mode].insn_code
! == CODE_FOR_nothing)
! abort ();
if (full_mode != from_mode)
from = convert_to_mode (full_mode, from, unsignedp);
--- 430,437 ----
enum machine_mode full_mode
= smallest_mode_for_size (GET_MODE_BITSIZE (to_mode), MODE_INT);
! gcc_assert (trunc_optab->handlers[to_mode][full_mode].insn_code
! != CODE_FOR_nothing);
if (full_mode != from_mode)
from = convert_to_mode (full_mode, from, unsignedp);
*************** convert_move (rtx to, rtx from, int unsi
*** 448,456 ****
enum machine_mode full_mode
= smallest_mode_for_size (GET_MODE_BITSIZE (from_mode), MODE_INT);
! if (sext_optab->handlers[full_mode][from_mode].insn_code
! == CODE_FOR_nothing)
! abort ();
emit_unop_insn (sext_optab->handlers[full_mode][from_mode].insn_code,
to, from, UNKNOWN);
--- 444,451 ----
enum machine_mode full_mode
= smallest_mode_for_size (GET_MODE_BITSIZE (from_mode), MODE_INT);
! gcc_assert (sext_optab->handlers[full_mode][from_mode].insn_code
! != CODE_FOR_nothing);
emit_unop_insn (sext_optab->handlers[full_mode][from_mode].insn_code,
to, from, UNKNOWN);
*************** convert_move (rtx to, rtx from, int unsi
*** 557,564 ****
int index = (WORDS_BIG_ENDIAN ? nwords - i - 1 : i);
rtx subword = operand_subword (to, index, 1, to_mode);
! if (subword == 0)
! abort ();
if (fill_value != subword)
emit_move_insn (subword, fill_value);
--- 552,558 ----
int index = (WORDS_BIG_ENDIAN ? nwords - i - 1 : i);
rtx subword = operand_subword (to, index, 1, to_mode);
! gcc_assert (subword);
if (fill_value != subword)
emit_move_insn (subword, fill_value);
*************** convert_move (rtx to, rtx from, int unsi
*** 683,689 ****
}
/* Mode combination is not recognized. */
! abort ();
}
/* Return an rtx for a value that would result
--- 677,683 ----
}
/* Mode combination is not recognized. */
! gcc_unreachable ();
}
/* Return an rtx for a value that would result
*************** convert_modes (enum machine_mode mode, e
*** 797,804 ****
subreg operation. */
if (VECTOR_MODE_P (mode) && GET_MODE (x) == VOIDmode)
{
! if (GET_MODE_BITSIZE (mode) != GET_MODE_BITSIZE (oldmode))
! abort ();
return simplify_gen_subreg (mode, x, oldmode, 0);
}
--- 791,797 ----
subreg operation. */
if (VECTOR_MODE_P (mode) && GET_MODE (x) == VOIDmode)
{
! gcc_assert (GET_MODE_BITSIZE (mode) == GET_MODE_BITSIZE (oldmode));
return simplify_gen_subreg (mode, x, oldmode, 0);
}
*************** move_by_pieces (rtx to, rtx from, unsign
*** 964,978 ****
}
/* The code above should have handled everything. */
! if (data.len > 0)
! abort ();
if (endp)
{
rtx to1;
! if (data.reverse)
! abort ();
if (data.autinc_to)
{
if (endp == 2)
--- 957,969 ----
}
/* The code above should have handled everything. */
! gcc_assert (!data.len);
if (endp)
{
rtx to1;
! gcc_assert (!data.reverse);
if (data.autinc_to)
{
if (endp == 2)
*************** move_by_pieces_ninsns (unsigned HOST_WID
*** 1045,1052 ****
max_size = GET_MODE_SIZE (mode);
}
! if (l)
! abort ();
return n_insns;
}
--- 1036,1042 ----
max_size = GET_MODE_SIZE (mode);
}
! gcc_assert (!l);
return n_insns;
}
*************** move_by_pieces_1 (rtx (*genfun) (rtx, ..
*** 1095,1101 ****
#ifdef PUSH_ROUNDING
emit_single_push_insn (mode, from1, NULL);
#else
! abort ();
#endif
}
--- 1085,1091 ----
#ifdef PUSH_ROUNDING
emit_single_push_insn (mode, from1, NULL);
#else
! gcc_unreachable ();
#endif
}
*************** emit_block_move (rtx x, rtx y, rtx size,
*** 1149,1165 ****
break;
default:
! abort ();
}
align = MIN (MEM_ALIGN (x), MEM_ALIGN (y));
! if (!MEM_P (x))
! abort ();
! if (!MEM_P (y))
! abort ();
! if (size == 0)
! abort ();
/* Make sure we've got BLKmode addresses; store_one_arg can decide that
block copy is more efficient for other large modes, e.g. DCmode. */
--- 1139,1152 ----
break;
default:
! gcc_unreachable ();
}
align = MIN (MEM_ALIGN (x), MEM_ALIGN (y));
! gcc_assert (MEM_P (x));
! gcc_assert (MEM_P (y));
! gcc_assert (size);
/* Make sure we've got BLKmode addresses; store_one_arg can decide that
block copy is more efficient for other large modes, e.g. DCmode. */
*************** move_block_from_reg (int regno, rtx x, i
*** 1530,1537 ****
{
rtx tem = operand_subword (x, i, 1, BLKmode);
! if (tem == 0)
! abort ();
emit_move_insn (tem, gen_rtx_REG (word_mode, regno + i));
}
--- 1517,1523 ----
{
rtx tem = operand_subword (x, i, 1, BLKmode);
! gcc_assert (tem);
emit_move_insn (tem, gen_rtx_REG (word_mode, regno + i));
}
*************** gen_group_rtx (rtx orig)
*** 1549,1556 ****
int i, length;
rtx *tmps;
! if (GET_CODE (orig) != PARALLEL)
! abort ();
length = XVECLEN (orig, 0);
tmps = alloca (sizeof (rtx) * length);
--- 1535,1541 ----
int i, length;
rtx *tmps;
! gcc_assert (GET_CODE (orig) == PARALLEL);
length = XVECLEN (orig, 0);
tmps = alloca (sizeof (rtx) * length);
*************** emit_group_load (rtx dst, rtx orig_src,
*** 1583,1590 ****
rtx *tmps, src;
int start, i;
! if (GET_CODE (dst) != PARALLEL)
! abort ();
/* Check for a NULL entry, used to indicate that the parameter goes
both on the stack and in registers. */
--- 1568,1574 ----
rtx *tmps, src;
int start, i;
! gcc_assert (GET_CODE (dst) == PARALLEL);
/* Check for a NULL entry, used to indicate that the parameter goes
both on the stack and in registers. */
*************** emit_group_load (rtx dst, rtx orig_src,
*** 1618,1625 ****
)
shift = (bytelen - (ssize - bytepos)) * BITS_PER_UNIT;
bytelen = ssize - bytepos;
! if (bytelen <= 0)
! abort ();
}
/* If we won't be loading directly from memory, protect the real source
--- 1602,1608 ----
)
shift = (bytelen - (ssize - bytepos)) * BITS_PER_UNIT;
bytelen = ssize - bytepos;
! gcc_assert (bytelen > 0);
}
/* If we won't be loading directly from memory, protect the real source
*************** emit_group_load (rtx dst, rtx orig_src,
*** 1668,1681 ****
(bytepos % slen0) * BITS_PER_UNIT,
1, NULL_RTX, mode, mode);
}
! else if (bytepos == 0)
{
! rtx mem = assign_stack_temp (GET_MODE (src), slen, 0);
emit_move_insn (mem, src);
tmps[i] = adjust_address (mem, mode, 0);
}
- else
- abort ();
}
/* FIXME: A SIMD parallel will eventually lead to a subreg of a
SIMD register, which is currently broken. While we get GCC
--- 1651,1665 ----
(bytepos % slen0) * BITS_PER_UNIT,
1, NULL_RTX, mode, mode);
}
! else
{
! rtx mem;
!
! gcc_assert (!bytepos);
! mem = assign_stack_temp (GET_MODE (src), slen, 0);
emit_move_insn (mem, src);
tmps[i] = adjust_address (mem, mode, 0);
}
}
/* FIXME: A SIMD parallel will eventually lead to a subreg of a
SIMD register, which is currently broken. While we get GCC
*************** emit_group_move (rtx dst, rtx src)
*** 1719,1728 ****
{
int i;
! if (GET_CODE (src) != PARALLEL
! || GET_CODE (dst) != PARALLEL
! || XVECLEN (src, 0) != XVECLEN (dst, 0))
! abort ();
/* Skip first entry if NULL. */
for (i = XEXP (XVECEXP (src, 0, 0), 0) ? 0 : 1; i < XVECLEN (src, 0); i++)
--- 1703,1711 ----
{
int i;
! gcc_assert (GET_CODE (src) == PARALLEL
! && GET_CODE (dst) == PARALLEL
! && XVECLEN (src, 0) == XVECLEN (dst, 0));
/* Skip first entry if NULL. */
for (i = XEXP (XVECEXP (src, 0, 0), 0) ? 0 : 1; i < XVECLEN (src, 0); i++)
*************** emit_group_store (rtx orig_dst, rtx src,
*** 1741,1748 ****
rtx *tmps, dst;
int start, i;
! if (GET_CODE (src) != PARALLEL)
! abort ();
/* Check for a NULL entry, used to indicate that the parameter goes
both on the stack and in registers. */
--- 1724,1730 ----
rtx *tmps, dst;
int start, i;
! gcc_assert (GET_CODE (src) == PARALLEL);
/* Check for a NULL entry, used to indicate that the parameter goes
both on the stack and in registers. */
*************** emit_group_store (rtx orig_dst, rtx src,
*** 1829,1836 ****
bytepos -= GET_MODE_SIZE (GET_MODE (XEXP (dst, 0)));
dest = XEXP (dst, 1);
}
! else if (bytepos == 0 && XVECLEN (src, 0))
{
dest = assign_stack_temp (GET_MODE (dest),
GET_MODE_SIZE (GET_MODE (dest)), 0);
emit_move_insn (adjust_address (dest, GET_MODE (tmps[i]), bytepos),
--- 1811,1819 ----
bytepos -= GET_MODE_SIZE (GET_MODE (XEXP (dst, 0)));
dest = XEXP (dst, 1);
}
! else
{
+ gcc_assert (bytepos == 0 && XVECLEN (src, 0));
dest = assign_stack_temp (GET_MODE (dest),
GET_MODE_SIZE (GET_MODE (dest)), 0);
emit_move_insn (adjust_address (dest, GET_MODE (tmps[i]), bytepos),
*************** emit_group_store (rtx orig_dst, rtx src,
*** 1838,1845 ****
dst = dest;
break;
}
- else
- abort ();
}
/* Optimize the access just a bit. */
--- 1821,1826 ----
*************** copy_blkmode_from_reg (rtx tgtblk, rtx s
*** 1947,1956 ****
void
use_reg (rtx *call_fusage, rtx reg)
{
! if (!REG_P (reg)
! || REGNO (reg) >= FIRST_PSEUDO_REGISTER)
! abort ();
!
*call_fusage
= gen_rtx_EXPR_LIST (VOIDmode,
gen_rtx_USE (VOIDmode, reg), *call_fusage);
--- 1928,1935 ----
void
use_reg (rtx *call_fusage, rtx reg)
{
! gcc_assert (REG_P (reg) && REGNO (reg) < FIRST_PSEUDO_REGISTER);
!
*call_fusage
= gen_rtx_EXPR_LIST (VOIDmode,
gen_rtx_USE (VOIDmode, reg), *call_fusage);
*************** use_regs (rtx *call_fusage, int regno, i
*** 1964,1971 ****
{
int i;
! if (regno + nregs > FIRST_PSEUDO_REGISTER)
! abort ();
for (i = 0; i < nregs; i++)
use_reg (call_fusage, regno_reg_rtx[regno + i]);
--- 1943,1949 ----
{
int i;
! gcc_assert (regno + nregs <= FIRST_PSEUDO_REGISTER);
for (i = 0; i < nregs; i++)
use_reg (call_fusage, regno_reg_rtx[regno + i]);
*************** can_store_by_pieces (unsigned HOST_WIDE_
*** 2081,2088 ****
}
/* The code above should have handled everything. */
! if (l != 0)
! abort ();
}
return 1;
--- 2059,2065 ----
}
/* The code above should have handled everything. */
! gcc_assert (!l);
}
return 1;
*************** store_by_pieces (rtx to, unsigned HOST_W
*** 2105,2117 ****
if (len == 0)
{
! if (endp == 2)
! abort ();
return to;
}
! if (! STORE_BY_PIECES_P (len, align))
! abort ();
data.constfun = constfun;
data.constfundata = constfundata;
data.len = len;
--- 2082,2092 ----
if (len == 0)
{
! gcc_assert (endp != 2);
return to;
}
! gcc_assert (STORE_BY_PIECES_P (len, align));
data.constfun = constfun;
data.constfundata = constfundata;
data.len = len;
*************** store_by_pieces (rtx to, unsigned HOST_W
*** 2121,2128 ****
{
rtx to1;
! if (data.reverse)
! abort ();
if (data.autinc_to)
{
if (endp == 2)
--- 2096,2102 ----
{
rtx to1;
! gcc_assert (!data.reverse);
if (data.autinc_to)
{
if (endp == 2)
*************** store_by_pieces_1 (struct store_by_piece
*** 2271,2278 ****
}
/* The code above should have handled everything. */
! if (data->len != 0)
! abort ();
}
/* Subroutine of store_by_pieces_1. Store as many bytes as appropriate
--- 2245,2251 ----
}
/* The code above should have handled everything. */
! gcc_assert (!data->len);
}
/* Subroutine of store_by_pieces_1. Store as many bytes as appropriate
*************** emit_move_insn (rtx x, rtx y)
*** 2508,2515 ****
rtx y_cst = NULL_RTX;
rtx last_insn, set;
! if (mode == BLKmode || (GET_MODE (y) != mode && GET_MODE (y) != VOIDmode))
! abort ();
if (CONSTANT_P (y))
{
--- 2481,2488 ----
rtx y_cst = NULL_RTX;
rtx last_insn, set;
! gcc_assert (mode != BLKmode
! && (GET_MODE (y) == mode || GET_MODE (y) == VOIDmode));
if (CONSTANT_P (y))
{
*************** emit_move_insn (rtx x, rtx y)
*** 2547,2554 ****
&& CONSTANT_ADDRESS_P (XEXP (y, 0)))))
y = validize_mem (y);
! if (mode == BLKmode)
! abort ();
last_insn = emit_move_insn_1 (x, y);
--- 2520,2526 ----
&& CONSTANT_ADDRESS_P (XEXP (y, 0)))))
y = validize_mem (y);
! gcc_assert (mode != BLKmode);
last_insn = emit_move_insn_1 (x, y);
*************** emit_move_insn_1 (rtx x, rtx y)
*** 2572,2579 ****
enum machine_mode submode;
enum mode_class class = GET_MODE_CLASS (mode);
! if ((unsigned int) mode >= (unsigned int) MAX_MACHINE_MODE)
! abort ();
if (mov_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
return
--- 2544,2550 ----
enum machine_mode submode;
enum mode_class class = GET_MODE_CLASS (mode);
! gcc_assert ((unsigned int) mode < (unsigned int) MAX_MACHINE_MODE);
if (mov_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
return
*************** emit_move_insn_1 (rtx x, rtx y)
*** 2753,2760 ****
if (GET_MODE_SIZE (tmode) == GET_MODE_SIZE (mode))
break;
! if (tmode == VOIDmode)
! abort ();
/* Get X and Y in TMODE. We can't use gen_lowpart here because it
may call change_address which is not appropriate if we were
--- 2724,2730 ----
if (GET_MODE_SIZE (tmode) == GET_MODE_SIZE (mode))
break;
! gcc_assert (tmode != VOIDmode);
/* Get X and Y in TMODE. We can't use gen_lowpart here because it
may call change_address which is not appropriate if we were
*************** emit_move_insn_1 (rtx x, rtx y)
*** 2803,2815 ****
/* This will handle any multi-word or full-word mode that lacks a move_insn
pattern. However, you will get better code if you define such patterns,
even if they must turn into multiple assembler instructions. */
! else if (GET_MODE_SIZE (mode) >= UNITS_PER_WORD)
{
rtx last_insn = 0;
rtx seq, inner;
int need_clobber;
int i;
!
#ifdef PUSH_ROUNDING
/* If X is a push on the stack, do the push now and replace
--- 2773,2787 ----
/* This will handle any multi-word or full-word mode that lacks a move_insn
pattern. However, you will get better code if you define such patterns,
even if they must turn into multiple assembler instructions. */
! else
{
rtx last_insn = 0;
rtx seq, inner;
int need_clobber;
int i;
!
! gcc_assert (GET_MODE_SIZE (mode) >= UNITS_PER_WORD);
!
#ifdef PUSH_ROUNDING
/* If X is a push on the stack, do the push now and replace
*************** emit_move_insn_1 (rtx x, rtx y)
*** 2883,2890 ****
else if (ypart == 0)
ypart = operand_subword_force (y, i, mode);
! if (xpart == 0 || ypart == 0)
! abort ();
need_clobber |= (GET_CODE (xpart) == SUBREG);
--- 2855,2861 ----
else if (ypart == 0)
ypart = operand_subword_force (y, i, mode);
! gcc_assert (xpart && ypart);
need_clobber |= (GET_CODE (xpart) == SUBREG);
*************** emit_move_insn_1 (rtx x, rtx y)
*** 2907,2914 ****
return last_insn;
}
- else
- abort ();
}
/* If Y is representable exactly in a narrower mode, and the target can
--- 2878,2883 ----
*************** emit_push_insn (rtx x, enum machine_mode
*** 3192,3199 ****
else
offset = used % (PARM_BOUNDARY / BITS_PER_UNIT);
! if (size == 0)
! abort ();
used -= offset;
--- 3161,3167 ----
else
offset = used % (PARM_BOUNDARY / BITS_PER_UNIT);
! gcc_assert (size);
used -= offset;
*************** expand_assignment (tree to, tree from, i
*** 3490,3497 ****
{
rtx offset_rtx = expand_expr (offset, NULL_RTX, VOIDmode, EXPAND_SUM);
! if (!MEM_P (to_rtx))
! abort ();
#ifdef POINTERS_EXTEND_UNSIGNED
if (GET_MODE (offset_rtx) != Pmode)
--- 3458,3464 ----
{
rtx offset_rtx = expand_expr (offset, NULL_RTX, VOIDmode, EXPAND_SUM);
! gcc_assert (MEM_P (to_rtx));
#ifdef POINTERS_EXTEND_UNSIGNED
if (GET_MODE (offset_rtx) != Pmode)
*************** store_expr (tree exp, rtx target, int wa
*** 3821,3828 ****
/* C++ can generate ?: expressions with a throw expression in one
branch and an rvalue in the other. Here, we resolve attempts to
store the throw expression's nonexistent result. */
! if (want_value)
! abort ();
expand_expr (exp, const0_rtx, VOIDmode, 0);
return NULL_RTX;
}
--- 3788,3794 ----
/* C++ can generate ?: expressions with a throw expression in one
branch and an rvalue in the other. Here, we resolve attempts to
store the throw expression's nonexistent result. */
! gcc_assert (!want_value);
expand_expr (exp, const0_rtx, VOIDmode, 0);
return NULL_RTX;
}
*************** count_type_elements (tree type)
*** 4304,4310 ****
case FUNCTION_TYPE:
case LANG_TYPE:
default:
! abort ();
}
}
--- 4270,4276 ----
case FUNCTION_TYPE:
case LANG_TYPE:
default:
! gcc_unreachable ();
}
}
*************** store_constructor (tree exp, rtx target,
*** 4397,5117 ****
HOST_WIDE_INT exp_size = int_size_in_bytes (type);
#endif
! if (TREE_CODE (type) == RECORD_TYPE || TREE_CODE (type) == UNION_TYPE
! || TREE_CODE (type) == QUAL_UNION_TYPE)
{
! tree elt;
!
! /* If size is zero or the target is already cleared, do nothing. */
! if (size == 0 || cleared)
! cleared = 1;
! /* We either clear the aggregate or indicate the value is dead. */
! else if ((TREE_CODE (type) == UNION_TYPE
! || TREE_CODE (type) == QUAL_UNION_TYPE)
! && ! CONSTRUCTOR_ELTS (exp))
! /* If the constructor is empty, clear the union. */
! {
! clear_storage (target, expr_size (exp));
! cleared = 1;
! }
!
! /* If we are building a static constructor into a register,
! set the initial value as zero so we can fold the value into
! a constant. But if more than one register is involved,
! this probably loses. */
! else if (REG_P (target) && TREE_STATIC (exp)
! && GET_MODE_SIZE (GET_MODE (target)) <= UNITS_PER_WORD)
! {
! emit_move_insn (target, CONST0_RTX (GET_MODE (target)));
! cleared = 1;
! }
! /* If the constructor has fewer fields than the structure
! or if we are initializing the structure to mostly zeros,
! clear the whole structure first. Don't do this if TARGET is a
! register whose mode size isn't equal to SIZE since clear_storage
! can't handle this case. */
! else if (size > 0
! && ((list_length (CONSTRUCTOR_ELTS (exp)) != fields_length (type))
! || mostly_zeros_p (exp))
! && (!REG_P (target)
! || ((HOST_WIDE_INT) GET_MODE_SIZE (GET_MODE (target))
! == size)))
! {
! clear_storage (target, GEN_INT (size));
cleared = 1;
! }
!
! if (! cleared)
! emit_insn (gen_rtx_CLOBBER (VOIDmode, target));
!
! /* Store each element of the constructor into
! the corresponding field of TARGET. */
!
! for (elt = CONSTRUCTOR_ELTS (exp); elt; elt = TREE_CHAIN (elt))
! {
! tree field = TREE_PURPOSE (elt);
! tree value = TREE_VALUE (elt);
! enum machine_mode mode;
! HOST_WIDE_INT bitsize;
! HOST_WIDE_INT bitpos = 0;
! tree offset;
! rtx to_rtx = target;
!
! /* Just ignore missing fields.
! We cleared the whole structure, above,
! if any fields are missing. */
! if (field == 0)
! continue;
!
! if (cleared && initializer_zerop (value))
! continue;
!
! if (host_integerp (DECL_SIZE (field), 1))
! bitsize = tree_low_cst (DECL_SIZE (field), 1);
! else
! bitsize = -1;
! mode = DECL_MODE (field);
! if (DECL_BIT_FIELD (field))
! mode = VOIDmode;
!
! offset = DECL_FIELD_OFFSET (field);
! if (host_integerp (offset, 0)
! && host_integerp (bit_position (field), 0))
! {
! bitpos = int_bit_position (field);
! offset = 0;
! }
! else
! bitpos = tree_low_cst (DECL_FIELD_BIT_OFFSET (field), 0);
! if (offset)
! {
! rtx offset_rtx;
! offset
! = SUBSTITUTE_PLACEHOLDER_IN_EXPR (offset,
! make_tree (TREE_TYPE (exp),
! target));
! offset_rtx = expand_expr (offset, NULL_RTX, VOIDmode, 0);
! if (!MEM_P (to_rtx))
! abort ();
#ifdef POINTERS_EXTEND_UNSIGNED
! if (GET_MODE (offset_rtx) != Pmode)
! offset_rtx = convert_to_mode (Pmode, offset_rtx, 0);
#else
! if (GET_MODE (offset_rtx) != ptr_mode)
! offset_rtx = convert_to_mode (ptr_mode, offset_rtx, 0);
#endif
! to_rtx = offset_address (to_rtx, offset_rtx,
! highest_pow2_factor (offset));
! }
#ifdef WORD_REGISTER_OPERATIONS
! /* If this initializes a field that is smaller than a word, at the
! start of a word, try to widen it to a full word.
! This special case allows us to output C++ member function
! initializations in a form that the optimizers can understand. */
! if (REG_P (target)
! && bitsize < BITS_PER_WORD
! && bitpos % BITS_PER_WORD == 0
! && GET_MODE_CLASS (mode) == MODE_INT
! && TREE_CODE (value) == INTEGER_CST
! && exp_size >= 0
! && bitpos + BITS_PER_WORD <= exp_size * BITS_PER_UNIT)
! {
! tree type = TREE_TYPE (value);
!
! if (TYPE_PRECISION (type) < BITS_PER_WORD)
! {
! type = lang_hooks.types.type_for_size
! (BITS_PER_WORD, TYPE_UNSIGNED (type));
! value = convert (type, value);
! }
!
! if (BYTES_BIG_ENDIAN)
! value
! = fold (build2 (LSHIFT_EXPR, type, value,
! build_int_cst (NULL_TREE,
! BITS_PER_WORD - bitsize)));
! bitsize = BITS_PER_WORD;
! mode = word_mode;
! }
#endif
! if (MEM_P (to_rtx) && !MEM_KEEP_ALIAS_SET_P (to_rtx)
! && DECL_NONADDRESSABLE_P (field))
! {
! to_rtx = copy_rtx (to_rtx);
! MEM_KEEP_ALIAS_SET_P (to_rtx) = 1;
! }
!
! store_constructor_field (to_rtx, bitsize, bitpos, mode,
! value, type, cleared,
! get_alias_set (TREE_TYPE (field)));
! }
! }
!
! else if (TREE_CODE (type) == ARRAY_TYPE)
! {
! tree elt;
! int i;
! int need_to_clear;
! tree domain;
! tree elttype = TREE_TYPE (type);
! int const_bounds_p;
! HOST_WIDE_INT minelt = 0;
! HOST_WIDE_INT maxelt = 0;
!
! domain = TYPE_DOMAIN (type);
! const_bounds_p = (TYPE_MIN_VALUE (domain)
! && TYPE_MAX_VALUE (domain)
! && host_integerp (TYPE_MIN_VALUE (domain), 0)
! && host_integerp (TYPE_MAX_VALUE (domain), 0));
!
! /* If we have constant bounds for the range of the type, get them. */
! if (const_bounds_p)
! {
! minelt = tree_low_cst (TYPE_MIN_VALUE (domain), 0);
! maxelt = tree_low_cst (TYPE_MAX_VALUE (domain), 0);
! }
!
! /* If the constructor has fewer elements than the array,
! clear the whole array first. Similarly if this is
! static constructor of a non-BLKmode object. */
! if (cleared)
! need_to_clear = 0;
! else if (REG_P (target) && TREE_STATIC (exp))
! need_to_clear = 1;
! else
! {
! HOST_WIDE_INT count = 0, zero_count = 0;
! need_to_clear = ! const_bounds_p;
!
! /* This loop is a more accurate version of the loop in
! mostly_zeros_p (it handles RANGE_EXPR in an index).
! It is also needed to check for missing elements. */
! for (elt = CONSTRUCTOR_ELTS (exp);
! elt != NULL_TREE && ! need_to_clear;
! elt = TREE_CHAIN (elt))
! {
! tree index = TREE_PURPOSE (elt);
! HOST_WIDE_INT this_node_count;
!
! if (index != NULL_TREE && TREE_CODE (index) == RANGE_EXPR)
! {
! tree lo_index = TREE_OPERAND (index, 0);
! tree hi_index = TREE_OPERAND (index, 1);
!
! if (! host_integerp (lo_index, 1)
! || ! host_integerp (hi_index, 1))
! {
! need_to_clear = 1;
! break;
! }
!
! this_node_count = (tree_low_cst (hi_index, 1)
! - tree_low_cst (lo_index, 1) + 1);
! }
! else
! this_node_count = 1;
!
! count += this_node_count;
! if (mostly_zeros_p (TREE_VALUE (elt)))
! zero_count += this_node_count;
! }
!
! /* Clear the entire array first if there are any missing elements,
! or if the incidence of zero elements is >= 75%. */
! if (! need_to_clear
! && (count < maxelt - minelt + 1 || 4 * zero_count >= 3 * count))
! need_to_clear = 1;
! }
!
! if (need_to_clear && size > 0)
! {
! if (REG_P (target))
! emit_move_insn (target, CONST0_RTX (GET_MODE (target)));
! else
! clear_storage (target, GEN_INT (size));
! cleared = 1;
! }
!
! if (!cleared && REG_P (target))
! /* Inform later passes that the old value is dead. */
! emit_insn (gen_rtx_CLOBBER (VOIDmode, target));
!
! /* Store each element of the constructor into
! the corresponding element of TARGET, determined
! by counting the elements. */
! for (elt = CONSTRUCTOR_ELTS (exp), i = 0;
! elt;
! elt = TREE_CHAIN (elt), i++)
! {
! enum machine_mode mode;
! HOST_WIDE_INT bitsize;
! HOST_WIDE_INT bitpos;
! int unsignedp;
! tree value = TREE_VALUE (elt);
! tree index = TREE_PURPOSE (elt);
! rtx xtarget = target;
!
! if (cleared && initializer_zerop (value))
! continue;
!
! unsignedp = TYPE_UNSIGNED (elttype);
! mode = TYPE_MODE (elttype);
! if (mode == BLKmode)
! bitsize = (host_integerp (TYPE_SIZE (elttype), 1)
! ? tree_low_cst (TYPE_SIZE (elttype), 1)
! : -1);
! else
! bitsize = GET_MODE_BITSIZE (mode);
!
! if (index != NULL_TREE && TREE_CODE (index) == RANGE_EXPR)
! {
! tree lo_index = TREE_OPERAND (index, 0);
! tree hi_index = TREE_OPERAND (index, 1);
! rtx index_r, pos_rtx;
! HOST_WIDE_INT lo, hi, count;
! tree position;
!
! /* If the range is constant and "small", unroll the loop. */
! if (const_bounds_p
! && host_integerp (lo_index, 0)
! && host_integerp (hi_index, 0)
! && (lo = tree_low_cst (lo_index, 0),
! hi = tree_low_cst (hi_index, 0),
! count = hi - lo + 1,
! (!MEM_P (target)
! || count <= 2
! || (host_integerp (TYPE_SIZE (elttype), 1)
! && (tree_low_cst (TYPE_SIZE (elttype), 1) * count
! <= 40 * 8)))))
! {
! lo -= minelt; hi -= minelt;
! for (; lo <= hi; lo++)
! {
! bitpos = lo * tree_low_cst (TYPE_SIZE (elttype), 0);
!
! if (MEM_P (target)
! && !MEM_KEEP_ALIAS_SET_P (target)
! && TREE_CODE (type) == ARRAY_TYPE
! && TYPE_NONALIASED_COMPONENT (type))
! {
! target = copy_rtx (target);
! MEM_KEEP_ALIAS_SET_P (target) = 1;
! }
!
! store_constructor_field
! (target, bitsize, bitpos, mode, value, type, cleared,
! get_alias_set (elttype));
! }
! }
! else
! {
! rtx loop_start = gen_label_rtx ();
! rtx loop_end = gen_label_rtx ();
! tree exit_cond;
!
! expand_expr (hi_index, NULL_RTX, VOIDmode, 0);
! unsignedp = TYPE_UNSIGNED (domain);
!
! index = build_decl (VAR_DECL, NULL_TREE, domain);
!
! index_r
! = gen_reg_rtx (promote_mode (domain, DECL_MODE (index),
! &unsignedp, 0));
! SET_DECL_RTL (index, index_r);
! store_expr (lo_index, index_r, 0);
!
! /* Build the head of the loop. */
! do_pending_stack_adjust ();
! emit_label (loop_start);
!
! /* Assign value to element index. */
! position
! = convert (ssizetype,
! fold (build2 (MINUS_EXPR, TREE_TYPE (index),
! index, TYPE_MIN_VALUE (domain))));
! position = size_binop (MULT_EXPR, position,
! convert (ssizetype,
! TYPE_SIZE_UNIT (elttype)));
!
! pos_rtx = expand_expr (position, 0, VOIDmode, 0);
! xtarget = offset_address (target, pos_rtx,
! highest_pow2_factor (position));
! xtarget = adjust_address (xtarget, mode, 0);
! if (TREE_CODE (value) == CONSTRUCTOR)
! store_constructor (value, xtarget, cleared,
! bitsize / BITS_PER_UNIT);
! else
! store_expr (value, xtarget, 0);
!
! /* Generate a conditional jump to exit the loop. */
! exit_cond = build2 (LT_EXPR, integer_type_node,
! index, hi_index);
! jumpif (exit_cond, loop_end);
!
! /* Update the loop counter, and jump to the head of
! the loop. */
! expand_assignment (index,
! build2 (PLUS_EXPR, TREE_TYPE (index),
! index, integer_one_node), 0);
!
! emit_jump (loop_start);
!
! /* Build the end of the loop. */
! emit_label (loop_end);
! }
! }
! else if ((index != 0 && ! host_integerp (index, 0))
! || ! host_integerp (TYPE_SIZE (elttype), 1))
! {
! tree position;
!
! if (index == 0)
! index = ssize_int (1);
!
! if (minelt)
! index = fold_convert (ssizetype,
! fold (build2 (MINUS_EXPR,
! TREE_TYPE (index),
! index,
! TYPE_MIN_VALUE (domain))));
!
! position = size_binop (MULT_EXPR, index,
! convert (ssizetype,
! TYPE_SIZE_UNIT (elttype)));
! xtarget = offset_address (target,
! expand_expr (position, 0, VOIDmode, 0),
! highest_pow2_factor (position));
! xtarget = adjust_address (xtarget, mode, 0);
! store_expr (value, xtarget, 0);
! }
! else
! {
! if (index != 0)
! bitpos = ((tree_low_cst (index, 0) - minelt)
! * tree_low_cst (TYPE_SIZE (elttype), 1));
! else
! bitpos = (i * tree_low_cst (TYPE_SIZE (elttype), 1));
!
! if (MEM_P (target) && !MEM_KEEP_ALIAS_SET_P (target)
! && TREE_CODE (type) == ARRAY_TYPE
! && TYPE_NONALIASED_COMPONENT (type))
! {
! target = copy_rtx (target);
! MEM_KEEP_ALIAS_SET_P (target) = 1;
! }
! store_constructor_field (target, bitsize, bitpos, mode, value,
! type, cleared, get_alias_set (elttype));
! }
! }
! }
!
! else if (TREE_CODE (type) == VECTOR_TYPE)
! {
! tree elt;
! int i;
! int need_to_clear;
! int icode = 0;
! tree elttype = TREE_TYPE (type);
! int elt_size = tree_low_cst (TYPE_SIZE (elttype), 1);
! enum machine_mode eltmode = TYPE_MODE (elttype);
! HOST_WIDE_INT bitsize;
! HOST_WIDE_INT bitpos;
! rtx *vector = NULL;
! unsigned n_elts;
!
! if (eltmode == BLKmode)
! abort ();
!
! n_elts = TYPE_VECTOR_SUBPARTS (type);
! if (REG_P (target) && VECTOR_MODE_P (GET_MODE (target)))
! {
! enum machine_mode mode = GET_MODE (target);
!
! icode = (int) vec_init_optab->handlers[mode].insn_code;
! if (icode != CODE_FOR_nothing)
! {
! unsigned int i;
!
! vector = alloca (n_elts);
! for (i = 0; i < n_elts; i++)
! vector [i] = CONST0_RTX (GET_MODE_INNER (mode));
! }
! }
!
! /* If the constructor has fewer elements than the vector,
! clear the whole array first. Similarly if this is
! static constructor of a non-BLKmode object. */
! if (cleared)
! need_to_clear = 0;
! else if (REG_P (target) && TREE_STATIC (exp))
! need_to_clear = 1;
! else
! {
! unsigned HOST_WIDE_INT count = 0, zero_count = 0;
!
! for (elt = CONSTRUCTOR_ELTS (exp);
! elt != NULL_TREE;
! elt = TREE_CHAIN (elt))
! {
! int n_elts_here =
! tree_low_cst (
! int_const_binop (TRUNC_DIV_EXPR,
! TYPE_SIZE (TREE_TYPE (TREE_VALUE (elt))),
! TYPE_SIZE (elttype), 0), 1);
!
! count += n_elts_here;
! if (mostly_zeros_p (TREE_VALUE (elt)))
! zero_count += n_elts_here;
! }
! /* Clear the entire vector first if there are any missing elements,
! or if the incidence of zero elements is >= 75%. */
! need_to_clear = (count < n_elts || 4 * zero_count >= 3 * count);
! }
! if (need_to_clear && size > 0 && !vector)
! {
! if (REG_P (target))
! emit_move_insn (target, CONST0_RTX (GET_MODE (target)));
! else
! clear_storage (target, GEN_INT (size));
! cleared = 1;
! }
! if (!cleared && REG_P (target))
! /* Inform later passes that the old value is dead. */
! emit_insn (gen_rtx_CLOBBER (VOIDmode, target));
!
! /* Store each element of the constructor into the corresponding
! element of TARGET, determined by counting the elements. */
! for (elt = CONSTRUCTOR_ELTS (exp), i = 0;
! elt;
! elt = TREE_CHAIN (elt), i += bitsize / elt_size)
! {
! tree value = TREE_VALUE (elt);
! tree index = TREE_PURPOSE (elt);
! HOST_WIDE_INT eltpos;
! bitsize = tree_low_cst (TYPE_SIZE (TREE_TYPE (value)), 1);
! if (cleared && initializer_zerop (value))
! continue;
! if (index != 0)
! eltpos = tree_low_cst (index, 1);
! else
! eltpos = i;
! if (vector)
! {
! /* Vector CONSTRUCTORs should only be built from smaller
! vectors in the case of BLKmode vectors. */
! if (TREE_CODE (TREE_TYPE (value)) == VECTOR_TYPE)
! abort ();
! vector[eltpos] = expand_expr (value, NULL_RTX, VOIDmode, 0);
! }
! else
! {
! enum machine_mode value_mode =
! TREE_CODE (TREE_TYPE (value)) == VECTOR_TYPE
? TYPE_MODE (TREE_TYPE (value))
: eltmode;
! bitpos = eltpos * elt_size;
! store_constructor_field (target, bitsize, bitpos, value_mode, value,
! type, cleared, get_alias_set (elttype));
! }
! }
!
! if (vector)
! emit_insn (GEN_FCN (icode) (target,
! gen_rtx_PARALLEL (GET_MODE (target),
! gen_rtvec_v (n_elts, vector))));
! }
!
! /* Set constructor assignments. */
! else if (TREE_CODE (type) == SET_TYPE)
! {
! tree elt = CONSTRUCTOR_ELTS (exp);
! unsigned HOST_WIDE_INT nbytes = int_size_in_bytes (type), nbits;
! tree domain = TYPE_DOMAIN (type);
! tree domain_min, domain_max, bitlength;
!
! /* The default implementation strategy is to extract the constant
! parts of the constructor, use that to initialize the target,
! and then "or" in whatever non-constant ranges we need in addition.
!
! If a large set is all zero or all ones, it is
! probably better to set it using memset.
! Also, if a large set has just a single range, it may also be
! better to first clear all the first clear the set (using
! memset), and set the bits we want. */
!
! /* Check for all zeros. */
! if (elt == NULL_TREE && size > 0)
! {
! if (!cleared)
! clear_storage (target, GEN_INT (size));
! return;
! }
!
! domain_min = convert (sizetype, TYPE_MIN_VALUE (domain));
! domain_max = convert (sizetype, TYPE_MAX_VALUE (domain));
! bitlength = size_binop (PLUS_EXPR,
! size_diffop (domain_max, domain_min),
! ssize_int (1));
!
! nbits = tree_low_cst (bitlength, 1);
!
! /* For "small" sets, or "medium-sized" (up to 32 bytes) sets that
! are "complicated" (more than one range), initialize (the
! constant parts) by copying from a constant. */
! if (GET_MODE (target) != BLKmode || nbits <= 2 * BITS_PER_WORD
! || (nbytes <= 32 && TREE_CHAIN (elt) != NULL_TREE))
! {
! unsigned int set_word_size = TYPE_ALIGN (TREE_TYPE (exp));
! enum machine_mode mode = mode_for_size (set_word_size, MODE_INT, 1);
! char *bit_buffer = alloca (nbits);
! HOST_WIDE_INT word = 0;
! unsigned int bit_pos = 0;
! unsigned int ibit = 0;
! unsigned int offset = 0; /* In bytes from beginning of set. */
!
! elt = get_set_constructor_bits (exp, bit_buffer, nbits);
! for (;;)
! {
! if (bit_buffer[ibit])
! {
! if (BYTES_BIG_ENDIAN)
! word |= (1 << (set_word_size - 1 - bit_pos));
! else
! word |= 1 << bit_pos;
! }
!
! bit_pos++; ibit++;
! if (bit_pos >= set_word_size || ibit == nbits)
! {
! if (word != 0 || ! cleared)
! {
! rtx datum = gen_int_mode (word, mode);
! rtx to_rtx;
! /* The assumption here is that it is safe to use
! XEXP if the set is multi-word, but not if
! it's single-word. */
! if (MEM_P (target))
! to_rtx = adjust_address (target, mode, offset);
! else if (offset == 0)
! to_rtx = target;
! else
! abort ();
! emit_move_insn (to_rtx, datum);
! }
! if (ibit == nbits)
! break;
! word = 0;
! bit_pos = 0;
! offset += set_word_size / BITS_PER_UNIT;
! }
! }
! }
! else if (!cleared)
! /* Don't bother clearing storage if the set is all ones. */
! if (TREE_CHAIN (elt) != NULL_TREE
! || (TREE_PURPOSE (elt) == NULL_TREE
! ? nbits != 1
! : ( ! host_integerp (TREE_VALUE (elt), 0)
! || ! host_integerp (TREE_PURPOSE (elt), 0)
! || (tree_low_cst (TREE_VALUE (elt), 0)
! - tree_low_cst (TREE_PURPOSE (elt), 0) + 1
! != (HOST_WIDE_INT) nbits))))
! clear_storage (target, expr_size (exp));
!
! for (; elt != NULL_TREE; elt = TREE_CHAIN (elt))
! {
! /* Start of range of element or NULL. */
! tree startbit = TREE_PURPOSE (elt);
! /* End of range of element, or element value. */
! tree endbit = TREE_VALUE (elt);
! HOST_WIDE_INT startb, endb;
! rtx bitlength_rtx, startbit_rtx, endbit_rtx, targetx;
!
! bitlength_rtx = expand_expr (bitlength,
! NULL_RTX, MEM, EXPAND_CONST_ADDRESS);
!
! /* Handle non-range tuple element like [ expr ]. */
! if (startbit == NULL_TREE)
! {
! startbit = save_expr (endbit);
! endbit = startbit;
! }
!
! startbit = convert (sizetype, startbit);
! endbit = convert (sizetype, endbit);
! if (! integer_zerop (domain_min))
! {
! startbit = size_binop (MINUS_EXPR, startbit, domain_min);
! endbit = size_binop (MINUS_EXPR, endbit, domain_min);
! }
! startbit_rtx = expand_expr (startbit, NULL_RTX, MEM,
EXPAND_CONST_ADDRESS);
! endbit_rtx = expand_expr (endbit, NULL_RTX, MEM,
! EXPAND_CONST_ADDRESS);
!
! if (REG_P (target))
! {
! targetx
! = assign_temp
((build_qualified_type (lang_hooks.types.type_for_mode
(GET_MODE (target), 0),
TYPE_QUAL_CONST)),
0, 1, 1);
! emit_move_insn (targetx, target);
! }
!
! else if (MEM_P (target))
! targetx = target;
! else
! abort ();
!
! /* Optimization: If startbit and endbit are constants divisible
! by BITS_PER_UNIT, call memset instead. */
! if (TREE_CODE (startbit) == INTEGER_CST
! && TREE_CODE (endbit) == INTEGER_CST
! && (startb = TREE_INT_CST_LOW (startbit)) % BITS_PER_UNIT == 0
! && (endb = TREE_INT_CST_LOW (endbit) + 1) % BITS_PER_UNIT == 0)
! {
! emit_library_call (memset_libfunc, LCT_NORMAL,
! VOIDmode, 3,
! plus_constant (XEXP (targetx, 0),
! startb / BITS_PER_UNIT),
! Pmode,
! constm1_rtx, TYPE_MODE (integer_type_node),
! GEN_INT ((endb - startb) / BITS_PER_UNIT),
! TYPE_MODE (sizetype));
! }
! else
! emit_library_call (setbits_libfunc, LCT_NORMAL,
! VOIDmode, 4, XEXP (targetx, 0),
! Pmode, bitlength_rtx, TYPE_MODE (sizetype),
! startbit_rtx, TYPE_MODE (sizetype),
! endbit_rtx, TYPE_MODE (sizetype));
! if (REG_P (target))
! emit_move_insn (target, targetx);
! }
}
-
- else
- abort ();
}
/* Store the value of EXP (an expression tree)
--- 4363,5093 ----
HOST_WIDE_INT exp_size = int_size_in_bytes (type);
#endif
! switch (TREE_CODE (type))
{
! case RECORD_TYPE:
! case UNION_TYPE:
! case QUAL_UNION_TYPE:
! {
! tree elt;
! /* If size is zero or the target is already cleared, do nothing. */
! if (size == 0 || cleared)
cleared = 1;
! /* We either clear the aggregate or indicate the value is dead. */
! else if ((TREE_CODE (type) == UNION_TYPE
! || TREE_CODE (type) == QUAL_UNION_TYPE)
! && ! CONSTRUCTOR_ELTS (exp))
! /* If the constructor is empty, clear the union. */
! {
! clear_storage (target, expr_size (exp));
! cleared = 1;
! }
! /* If we are building a static constructor into a register,
! set the initial value as zero so we can fold the value into
! a constant. But if more than one register is involved,
! this probably loses. */
! else if (REG_P (target) && TREE_STATIC (exp)
! && GET_MODE_SIZE (GET_MODE (target)) <= UNITS_PER_WORD)
! {
! emit_move_insn (target, CONST0_RTX (GET_MODE (target)));
! cleared = 1;
! }
! /* If the constructor has fewer fields than the structure or
! if we are initializing the structure to mostly zeros, clear
! the whole structure first. Don't do this if TARGET is a
! register whose mode size isn't equal to SIZE since
! clear_storage can't handle this case. */
! else if (size > 0
! && ((list_length (CONSTRUCTOR_ELTS (exp))
! != fields_length (type))
! || mostly_zeros_p (exp))
! && (!REG_P (target)
! || ((HOST_WIDE_INT) GET_MODE_SIZE (GET_MODE (target))
! == size)))
! {
! clear_storage (target, GEN_INT (size));
! cleared = 1;
! }
! if (! cleared)
! emit_insn (gen_rtx_CLOBBER (VOIDmode, target));
! /* Store each element of the constructor into the
! corresponding field of TARGET. */
+ for (elt = CONSTRUCTOR_ELTS (exp); elt; elt = TREE_CHAIN (elt))
+ {
+ tree field = TREE_PURPOSE (elt);
+ tree value = TREE_VALUE (elt);
+ enum machine_mode mode;
+ HOST_WIDE_INT bitsize;
+ HOST_WIDE_INT bitpos = 0;
+ tree offset;
+ rtx to_rtx = target;
+
+ /* Just ignore missing fields. We cleared the whole
+ structure, above, if any fields are missing. */
+ if (field == 0)
+ continue;
+
+ if (cleared && initializer_zerop (value))
+ continue;
+
+ if (host_integerp (DECL_SIZE (field), 1))
+ bitsize = tree_low_cst (DECL_SIZE (field), 1);
+ else
+ bitsize = -1;
+
+ mode = DECL_MODE (field);
+ if (DECL_BIT_FIELD (field))
+ mode = VOIDmode;
+
+ offset = DECL_FIELD_OFFSET (field);
+ if (host_integerp (offset, 0)
+ && host_integerp (bit_position (field), 0))
+ {
+ bitpos = int_bit_position (field);
+ offset = 0;
+ }
+ else
+ bitpos = tree_low_cst (DECL_FIELD_BIT_OFFSET (field), 0);
+
+ if (offset)
+ {
+ rtx offset_rtx;
+
+ offset
+ = SUBSTITUTE_PLACEHOLDER_IN_EXPR (offset,
+ make_tree (TREE_TYPE (exp),
+ target));
+
+ offset_rtx = expand_expr (offset, NULL_RTX, VOIDmode, 0);
+ gcc_assert (MEM_P (to_rtx));
+
#ifdef POINTERS_EXTEND_UNSIGNED
! if (GET_MODE (offset_rtx) != Pmode)
! offset_rtx = convert_to_mode (Pmode, offset_rtx, 0);
#else
! if (GET_MODE (offset_rtx) != ptr_mode)
! offset_rtx = convert_to_mode (ptr_mode, offset_rtx, 0);
#endif
! to_rtx = offset_address (to_rtx, offset_rtx,
! highest_pow2_factor (offset));
! }
#ifdef WORD_REGISTER_OPERATIONS
! /* If this initializes a field that is smaller than a
! word, at the start of a word, try to widen it to a full
! word. This special case allows us to output C++ member
! function initializations in a form that the optimizers
! can understand. */
! if (REG_P (target)
! && bitsize < BITS_PER_WORD
! && bitpos % BITS_PER_WORD == 0
! && GET_MODE_CLASS (mode) == MODE_INT
! && TREE_CODE (value) == INTEGER_CST
! && exp_size >= 0
! && bitpos + BITS_PER_WORD <= exp_size * BITS_PER_UNIT)
! {
! tree type = TREE_TYPE (value);
!
! if (TYPE_PRECISION (type) < BITS_PER_WORD)
! {
! type = lang_hooks.types.type_for_size
! (BITS_PER_WORD, TYPE_UNSIGNED (type));
! value = convert (type, value);
! }
!
! if (BYTES_BIG_ENDIAN)
! value
! = fold (build2 (LSHIFT_EXPR, type, value,
! build_int_cst (NULL_TREE,
! BITS_PER_WORD - bitsize)));
! bitsize = BITS_PER_WORD;
! mode = word_mode;
! }
#endif
! if (MEM_P (to_rtx) && !MEM_KEEP_ALIAS_SET_P (to_rtx)
! && DECL_NONADDRESSABLE_P (field))
! {
! to_rtx = copy_rtx (to_rtx);
! MEM_KEEP_ALIAS_SET_P (to_rtx) = 1;
! }
!
! store_constructor_field (to_rtx, bitsize, bitpos, mode,
! value, type, cleared,
! get_alias_set (TREE_TYPE (field)));
! }
! break;
! }
! case ARRAY_TYPE:
! {
! tree elt;
! int i;
! int need_to_clear;
! tree domain;
! tree elttype = TREE_TYPE (type);
! int const_bounds_p;
! HOST_WIDE_INT minelt = 0;
! HOST_WIDE_INT maxelt = 0;
!
! domain = TYPE_DOMAIN (type);
! const_bounds_p = (TYPE_MIN_VALUE (domain)
! && TYPE_MAX_VALUE (domain)
! && host_integerp (TYPE_MIN_VALUE (domain), 0)
! && host_integerp (TYPE_MAX_VALUE (domain), 0));
! /* If we have constant bounds for the range of the type, get them. */
! if (const_bounds_p)
! {
! minelt = tree_low_cst (TYPE_MIN_VALUE (domain), 0);
! maxelt = tree_low_cst (TYPE_MAX_VALUE (domain), 0);
! }
! /* If the constructor has fewer elements than the array, clear
! the whole array first. Similarly if this is static
! constructor of a non-BLKmode object. */
! if (cleared)
! need_to_clear = 0;
! else if (REG_P (target) && TREE_STATIC (exp))
! need_to_clear = 1;
! else
! {
! HOST_WIDE_INT count = 0, zero_count = 0;
! need_to_clear = ! const_bounds_p;
!
! /* This loop is a more accurate version of the loop in
! mostly_zeros_p (it handles RANGE_EXPR in an index). It
! is also needed to check for missing elements. */
! for (elt = CONSTRUCTOR_ELTS (exp);
! elt != NULL_TREE && ! need_to_clear;
! elt = TREE_CHAIN (elt))
! {
! tree index = TREE_PURPOSE (elt);
! HOST_WIDE_INT this_node_count;
!
! if (index != NULL_TREE && TREE_CODE (index) == RANGE_EXPR)
! {
! tree lo_index = TREE_OPERAND (index, 0);
! tree hi_index = TREE_OPERAND (index, 1);
!
! if (! host_integerp (lo_index, 1)
! || ! host_integerp (hi_index, 1))
! {
! need_to_clear = 1;
! break;
! }
!
! this_node_count = (tree_low_cst (hi_index, 1)
! - tree_low_cst (lo_index, 1) + 1);
! }
! else
! this_node_count = 1;
!
! count += this_node_count;
! if (mostly_zeros_p (TREE_VALUE (elt)))
! zero_count += this_node_count;
! }
!
! /* Clear the entire array first if there are any missing
! elements, or if the incidence of zero elements is >=
! 75%. */
! if (! need_to_clear
! && (count < maxelt - minelt + 1
! || 4 * zero_count >= 3 * count))
! need_to_clear = 1;
! }
!
! if (need_to_clear && size > 0)
! {
! if (REG_P (target))
! emit_move_insn (target, CONST0_RTX (GET_MODE (target)));
! else
! clear_storage (target, GEN_INT (size));
! cleared = 1;
! }
! if (!cleared && REG_P (target))
! /* Inform later passes that the old value is dead. */
! emit_insn (gen_rtx_CLOBBER (VOIDmode, target));
!
! /* Store each element of the constructor into the
! corresponding element of TARGET, determined by counting the
! elements. */
! for (elt = CONSTRUCTOR_ELTS (exp), i = 0;
! elt;
! elt = TREE_CHAIN (elt), i++)
! {
! enum machine_mode mode;
! HOST_WIDE_INT bitsize;
! HOST_WIDE_INT bitpos;
! int unsignedp;
! tree value = TREE_VALUE (elt);
! tree index = TREE_PURPOSE (elt);
! rtx xtarget = target;
!
! if (cleared && initializer_zerop (value))
! continue;
!
! unsignedp = TYPE_UNSIGNED (elttype);
! mode = TYPE_MODE (elttype);
! if (mode == BLKmode)
! bitsize = (host_integerp (TYPE_SIZE (elttype), 1)
! ? tree_low_cst (TYPE_SIZE (elttype), 1)
! : -1);
! else
! bitsize = GET_MODE_BITSIZE (mode);
!
! if (index != NULL_TREE && TREE_CODE (index) == RANGE_EXPR)
! {
! tree lo_index = TREE_OPERAND (index, 0);
! tree hi_index = TREE_OPERAND (index, 1);
! rtx index_r, pos_rtx;
! HOST_WIDE_INT lo, hi, count;
! tree position;
!
! /* If the range is constant and "small", unroll the loop. */
! if (const_bounds_p
! && host_integerp (lo_index, 0)
! && host_integerp (hi_index, 0)
! && (lo = tree_low_cst (lo_index, 0),
! hi = tree_low_cst (hi_index, 0),
! count = hi - lo + 1,
! (!MEM_P (target)
! || count <= 2
! || (host_integerp (TYPE_SIZE (elttype), 1)
! && (tree_low_cst (TYPE_SIZE (elttype), 1) * count
! <= 40 * 8)))))
! {
! lo -= minelt; hi -= minelt;
! for (; lo <= hi; lo++)
! {
! bitpos = lo * tree_low_cst (TYPE_SIZE (elttype), 0);
!
! if (MEM_P (target)
! && !MEM_KEEP_ALIAS_SET_P (target)
! && TREE_CODE (type) == ARRAY_TYPE
! && TYPE_NONALIASED_COMPONENT (type))
! {
! target = copy_rtx (target);
! MEM_KEEP_ALIAS_SET_P (target) = 1;
! }
!
! store_constructor_field
! (target, bitsize, bitpos, mode, value, type, cleared,
! get_alias_set (elttype));
! }
! }
! else
! {
! rtx loop_start = gen_label_rtx ();
! rtx loop_end = gen_label_rtx ();
! tree exit_cond;
!
! expand_expr (hi_index, NULL_RTX, VOIDmode, 0);
! unsignedp = TYPE_UNSIGNED (domain);
!
! index = build_decl (VAR_DECL, NULL_TREE, domain);
!
! index_r
! = gen_reg_rtx (promote_mode (domain, DECL_MODE (index),
! &unsignedp, 0));
! SET_DECL_RTL (index, index_r);
! store_expr (lo_index, index_r, 0);
!
! /* Build the head of the loop. */
! do_pending_stack_adjust ();
! emit_label (loop_start);
!
! /* Assign value to element index. */
! position
! = convert (ssizetype,
! fold (build2 (MINUS_EXPR, TREE_TYPE (index),
! index, TYPE_MIN_VALUE (domain))));
! position = size_binop (MULT_EXPR, position,
! convert (ssizetype,
! TYPE_SIZE_UNIT (elttype)));
!
! pos_rtx = expand_expr (position, 0, VOIDmode, 0);
! xtarget = offset_address (target, pos_rtx,
! highest_pow2_factor (position));
! xtarget = adjust_address (xtarget, mode, 0);
! if (TREE_CODE (value) == CONSTRUCTOR)
! store_constructor (value, xtarget, cleared,
! bitsize / BITS_PER_UNIT);
! else
! store_expr (value, xtarget, 0);
! /* Generate a conditional jump to exit the loop. */
! exit_cond = build2 (LT_EXPR, integer_type_node,
! index, hi_index);
! jumpif (exit_cond, loop_end);
!
! /* Update the loop counter, and jump to the head of
! the loop. */
! expand_assignment (index,
! build2 (PLUS_EXPR, TREE_TYPE (index),
! index, integer_one_node), 0);
!
! emit_jump (loop_start);
!
! /* Build the end of the loop. */
! emit_label (loop_end);
! }
! }
! else if ((index != 0 && ! host_integerp (index, 0))
! || ! host_integerp (TYPE_SIZE (elttype), 1))
! {
! tree position;
!
! if (index == 0)
! index = ssize_int (1);
!
! if (minelt)
! index = fold_convert (ssizetype,
! fold (build2 (MINUS_EXPR,
! TREE_TYPE (index),
! index,
! TYPE_MIN_VALUE (domain))));
!
! position = size_binop (MULT_EXPR, index,
! convert (ssizetype,
! TYPE_SIZE_UNIT (elttype)));
! xtarget = offset_address (target,
! expand_expr (position, 0, VOIDmode, 0),
! highest_pow2_factor (position));
! xtarget = adjust_address (xtarget, mode, 0);
! store_expr (value, xtarget, 0);
! }
! else
! {
! if (index != 0)
! bitpos = ((tree_low_cst (index, 0) - minelt)
! * tree_low_cst (TYPE_SIZE (elttype), 1));
! else
! bitpos = (i * tree_low_cst (TYPE_SIZE (elttype), 1));
!
! if (MEM_P (target) && !MEM_KEEP_ALIAS_SET_P (target)
! && TREE_CODE (type) == ARRAY_TYPE
! && TYPE_NONALIASED_COMPONENT (type))
! {
! target = copy_rtx (target);
! MEM_KEEP_ALIAS_SET_P (target) = 1;
! }
! store_constructor_field (target, bitsize, bitpos, mode, value,
! type, cleared, get_alias_set (elttype));
! }
! }
! break;
! }
! case VECTOR_TYPE:
! {
! tree elt;
! int i;
! int need_to_clear;
! int icode = 0;
! tree elttype = TREE_TYPE (type);
! int elt_size = tree_low_cst (TYPE_SIZE (elttype), 1);
! enum machine_mode eltmode = TYPE_MODE (elttype);
! HOST_WIDE_INT bitsize;
! HOST_WIDE_INT bitpos;
! rtx *vector = NULL;
! unsigned n_elts;
!
! gcc_assert (eltmode != BLKmode);
!
! n_elts = TYPE_VECTOR_SUBPARTS (type);
! if (REG_P (target) && VECTOR_MODE_P (GET_MODE (target)))
! {
! enum machine_mode mode = GET_MODE (target);
!
! icode = (int) vec_init_optab->handlers[mode].insn_code;
! if (icode != CODE_FOR_nothing)
! {
! unsigned int i;
!
! vector = alloca (n_elts);
! for (i = 0; i < n_elts; i++)
! vector [i] = CONST0_RTX (GET_MODE_INNER (mode));
! }
! }
!
! /* If the constructor has fewer elements than the vector,
! clear the whole array first. Similarly if this is static
! constructor of a non-BLKmode object. */
! if (cleared)
! need_to_clear = 0;
! else if (REG_P (target) && TREE_STATIC (exp))
! need_to_clear = 1;
! else
! {
! unsigned HOST_WIDE_INT count = 0, zero_count = 0;
!
! for (elt = CONSTRUCTOR_ELTS (exp);
! elt != NULL_TREE;
! elt = TREE_CHAIN (elt))
! {
! int n_elts_here = tree_low_cst
! (int_const_binop (TRUNC_DIV_EXPR,
! TYPE_SIZE (TREE_TYPE (TREE_VALUE (elt))),
! TYPE_SIZE (elttype), 0), 1);
!
! count += n_elts_here;
! if (mostly_zeros_p (TREE_VALUE (elt)))
! zero_count += n_elts_here;
! }
! /* Clear the entire vector first if there are any missing elements,
! or if the incidence of zero elements is >= 75%. */
! need_to_clear = (count < n_elts || 4 * zero_count >= 3 * count);
! }
!
! if (need_to_clear && size > 0 && !vector)
! {
! if (REG_P (target))
! emit_move_insn (target, CONST0_RTX (GET_MODE (target)));
! else
! clear_storage (target, GEN_INT (size));
! cleared = 1;
! }
!
! if (!cleared && REG_P (target))
! /* Inform later passes that the old value is dead. */
! emit_insn (gen_rtx_CLOBBER (VOIDmode, target));
!
! /* Store each element of the constructor into the corresponding
! element of TARGET, determined by counting the elements. */
! for (elt = CONSTRUCTOR_ELTS (exp), i = 0;
! elt;
! elt = TREE_CHAIN (elt), i += bitsize / elt_size)
! {
! tree value = TREE_VALUE (elt);
! tree index = TREE_PURPOSE (elt);
! HOST_WIDE_INT eltpos;
!
! bitsize = tree_low_cst (TYPE_SIZE (TREE_TYPE (value)), 1);
! if (cleared && initializer_zerop (value))
! continue;
!
! if (index != 0)
! eltpos = tree_low_cst (index, 1);
! else
! eltpos = i;
!
! if (vector)
! {
! /* Vector CONSTRUCTORs should only be built from smaller
! vectors in the case of BLKmode vectors. */
! gcc_assert (TREE_CODE (TREE_TYPE (value)) != VECTOR_TYPE);
! vector[eltpos] = expand_expr (value, NULL_RTX, VOIDmode, 0);
! }
! else
! {
! enum machine_mode value_mode =
! TREE_CODE (TREE_TYPE (value)) == VECTOR_TYPE
? TYPE_MODE (TREE_TYPE (value))
: eltmode;
! bitpos = eltpos * elt_size;
! store_constructor_field (target, bitsize, bitpos,
! value_mode, value, type,
! cleared, get_alias_set (elttype));
! }
! }
!
! if (vector)
! emit_insn (GEN_FCN (icode)
! (target,
! gen_rtx_PARALLEL (GET_MODE (target),
! gen_rtvec_v (n_elts, vector))));
! break;
! }
! /* Set constructor assignments. */
! case SET_TYPE:
! {
! tree elt = CONSTRUCTOR_ELTS (exp);
! unsigned HOST_WIDE_INT nbytes = int_size_in_bytes (type), nbits;
! tree domain = TYPE_DOMAIN (type);
! tree domain_min, domain_max, bitlength;
!
! /* The default implementation strategy is to extract the
! constant parts of the constructor, use that to initialize
! the target, and then "or" in whatever non-constant ranges
! we need in addition.
!
! If a large set is all zero or all ones, it is probably
! better to set it using memset. Also, if a large set has
! just a single range, it may also be better to first clear
! all the first clear the set (using memset), and set the
! bits we want. */
! /* Check for all zeros. */
! if (elt == NULL_TREE && size > 0)
! {
! if (!cleared)
! clear_storage (target, GEN_INT (size));
! return;
! }
!
! domain_min = convert (sizetype, TYPE_MIN_VALUE (domain));
! domain_max = convert (sizetype, TYPE_MAX_VALUE (domain));
! bitlength = size_binop (PLUS_EXPR,
! size_diffop (domain_max, domain_min),
! ssize_int (1));
!
! nbits = tree_low_cst (bitlength, 1);
!
! /* For "small" sets, or "medium-sized" (up to 32 bytes) sets
! that are "complicated" (more than one range), initialize
! (the constant parts) by copying from a constant. */
! if (GET_MODE (target) != BLKmode || nbits <= 2 * BITS_PER_WORD
! || (nbytes <= 32 && TREE_CHAIN (elt) != NULL_TREE))
! {
! unsigned int set_word_size = TYPE_ALIGN (TREE_TYPE (exp));
! enum machine_mode mode = mode_for_size (set_word_size, MODE_INT, 1);
! char *bit_buffer = alloca (nbits);
! HOST_WIDE_INT word = 0;
! unsigned int bit_pos = 0;
! unsigned int ibit = 0;
! unsigned int offset = 0; /* In bytes from beginning of set. */
!
! elt = get_set_constructor_bits (exp, bit_buffer, nbits);
! for (;;)
! {
! if (bit_buffer[ibit])
! {
! if (BYTES_BIG_ENDIAN)
! word |= (1 << (set_word_size - 1 - bit_pos));
! else
! word |= 1 << bit_pos;
! }
!
! bit_pos++; ibit++;
! if (bit_pos >= set_word_size || ibit == nbits)
! {
! if (word != 0 || ! cleared)
! {
! rtx datum = gen_int_mode (word, mode);
! rtx to_rtx;
!
! /* The assumption here is that it is safe to
! use XEXP if the set is multi-word, but not
! if it's single-word. */
! if (MEM_P (target))
! to_rtx = adjust_address (target, mode, offset);
! else
! {
! gcc_assert (!offset);
! to_rtx = target;
! }
! emit_move_insn (to_rtx, datum);
! }
!
! if (ibit == nbits)
! break;
! word = 0;
! bit_pos = 0;
! offset += set_word_size / BITS_PER_UNIT;
! }
! }
! }
! else if (!cleared)
! /* Don't bother clearing storage if the set is all ones. */
! if (TREE_CHAIN (elt) != NULL_TREE
! || (TREE_PURPOSE (elt) == NULL_TREE
! ? nbits != 1
! : ( ! host_integerp (TREE_VALUE (elt), 0)
! || ! host_integerp (TREE_PURPOSE (elt), 0)
! || (tree_low_cst (TREE_VALUE (elt), 0)
! - tree_low_cst (TREE_PURPOSE (elt), 0) + 1
! != (HOST_WIDE_INT) nbits))))
! clear_storage (target, expr_size (exp));
!
! for (; elt != NULL_TREE; elt = TREE_CHAIN (elt))
! {
! /* Start of range of element or NULL. */
! tree startbit = TREE_PURPOSE (elt);
! /* End of range of element, or element value. */
! tree endbit = TREE_VALUE (elt);
! HOST_WIDE_INT startb, endb;
! rtx bitlength_rtx, startbit_rtx, endbit_rtx, targetx;
!
! bitlength_rtx = expand_expr (bitlength,
! NULL_RTX, MEM, EXPAND_CONST_ADDRESS);
!
! /* Handle non-range tuple element like [ expr ]. */
! if (startbit == NULL_TREE)
! {
! startbit = save_expr (endbit);
! endbit = startbit;
! }
!
! startbit = convert (sizetype, startbit);
! endbit = convert (sizetype, endbit);
! if (! integer_zerop (domain_min))
! {
! startbit = size_binop (MINUS_EXPR, startbit, domain_min);
! endbit = size_binop (MINUS_EXPR, endbit, domain_min);
! }
! startbit_rtx = expand_expr (startbit, NULL_RTX, MEM,
! EXPAND_CONST_ADDRESS);
! endbit_rtx = expand_expr (endbit, NULL_RTX, MEM,
EXPAND_CONST_ADDRESS);
!
! if (REG_P (target))
! {
! targetx
! = assign_temp
((build_qualified_type (lang_hooks.types.type_for_mode
(GET_MODE (target), 0),
TYPE_QUAL_CONST)),
0, 1, 1);
! emit_move_insn (targetx, target);
! }
!
! else
! {
! gcc_assert (MEM_P (target));
! targetx = target;
! }
! /* Optimization: If startbit and endbit are constants divisible
! by BITS_PER_UNIT, call memset instead. */
! if (TREE_CODE (startbit) == INTEGER_CST
! && TREE_CODE (endbit) == INTEGER_CST
! && (startb = TREE_INT_CST_LOW (startbit)) % BITS_PER_UNIT == 0
! && (endb = TREE_INT_CST_LOW (endbit) + 1) % BITS_PER_UNIT == 0)
! {
! emit_library_call (memset_libfunc, LCT_NORMAL,
! VOIDmode, 3,
! plus_constant (XEXP (targetx, 0),
! startb / BITS_PER_UNIT),
! Pmode,
! constm1_rtx, TYPE_MODE (integer_type_node),
! GEN_INT ((endb - startb) / BITS_PER_UNIT),
! TYPE_MODE (sizetype));
! }
! else
! emit_library_call (setbits_libfunc, LCT_NORMAL,
! VOIDmode, 4, XEXP (targetx, 0),
! Pmode, bitlength_rtx, TYPE_MODE (sizetype),
! startbit_rtx, TYPE_MODE (sizetype),
! endbit_rtx, TYPE_MODE (sizetype));
!
! if (REG_P (target))
! emit_move_insn (target, targetx);
! }
! break;
! }
! default:
! gcc_unreachable ();
}
}
/* Store the value of EXP (an expression tree)
*************** store_field (rtx target, HOST_WIDE_INT b
*** 5183,5190 ****
{
/* We're storing into a struct containing a single __complex. */
! if (bitpos != 0)
! abort ();
return store_expr (exp, target, value_mode != VOIDmode);
}
--- 5159,5165 ----
{
/* We're storing into a struct containing a single __complex. */
! gcc_assert (!bitpos);
return store_expr (exp, target, value_mode != VOIDmode);
}
*************** store_field (rtx target, HOST_WIDE_INT b
*** 5237,5245 ****
boundary. If so, we simply do a block copy. */
if (GET_MODE (target) == BLKmode && GET_MODE (temp) == BLKmode)
{
! if (!MEM_P (target) || !MEM_P (temp)
! || bitpos % BITS_PER_UNIT != 0)
! abort ();
target = adjust_address (target, VOIDmode, bitpos / BITS_PER_UNIT);
emit_block_move (target, temp,
--- 5212,5219 ----
boundary. If so, we simply do a block copy. */
if (GET_MODE (target) == BLKmode && GET_MODE (temp) == BLKmode)
{
! gcc_assert (MEM_P (target) && MEM_P (temp)
! && !(bitpos % BITS_PER_UNIT));
target = adjust_address (target, VOIDmode, bitpos / BITS_PER_UNIT);
emit_block_move (target, temp,
*************** safe_from_p (rtx x, tree exp, int top_p)
*** 5873,5879 ****
case WITH_CLEANUP_EXPR:
case CLEANUP_POINT_EXPR:
/* Lowered by gimplify.c. */
! abort ();
case SAVE_EXPR:
return safe_from_p (x, TREE_OPERAND (exp, 0), 0);
--- 5847,5853 ----
case WITH_CLEANUP_EXPR:
case CLEANUP_POINT_EXPR:
/* Lowered by gimplify.c. */
! gcc_unreachable ();
case SAVE_EXPR:
return safe_from_p (x, TREE_OPERAND (exp, 0), 0);
*************** expand_var (tree var)
*** 6037,6049 ****
expand_decl (var);
else if (TREE_CODE (var) == VAR_DECL && TREE_STATIC (var))
rest_of_decl_compilation (var, 0, 0);
- else if (TREE_CODE (var) == TYPE_DECL
- || TREE_CODE (var) == CONST_DECL
- || TREE_CODE (var) == FUNCTION_DECL
- || TREE_CODE (var) == LABEL_DECL)
- /* No expansion needed. */;
else
! abort ();
}
}
--- 6011,6022 ----
expand_decl (var);
else if (TREE_CODE (var) == VAR_DECL && TREE_STATIC (var))
rest_of_decl_compilation (var, 0, 0);
else
! /* No expansion needed. */
! gcc_assert (TREE_CODE (var) == TYPE_DECL
! || TREE_CODE (var) == CONST_DECL
! || TREE_CODE (var) == FUNCTION_DECL
! || TREE_CODE (var) == LABEL_DECL);
}
}
*************** expand_expr_addr_expr (tree exp, rtx tar
*** 6142,6149 ****
/* If the DECL isn't in memory, then the DECL wasn't properly
marked TREE_ADDRESSABLE, which will be either a front-end
or a tree optimizer bug. */
! if (GET_CODE (result) != MEM)
! abort ();
result = XEXP (result, 0);
/* ??? Is this needed anymore? */
--- 6115,6121 ----
/* If the DECL isn't in memory, then the DECL wasn't properly
marked TREE_ADDRESSABLE, which will be either a front-end
or a tree optimizer bug. */
! gcc_assert (GET_CODE (result) == MEM);
result = XEXP (result, 0);
/* ??? Is this needed anymore? */
*************** expand_expr_addr_expr (tree exp, rtx tar
*** 6165,6172 ****
}
/* We must have made progress. */
! if (inner == exp)
! abort ();
subtarget = offset || bitpos ? NULL_RTX : target;
result = expand_expr_addr_expr (inner, subtarget, tmode, modifier);
--- 6137,6143 ----
}
/* We must have made progress. */
! gcc_assert (inner != exp);
subtarget = offset || bitpos ? NULL_RTX : target;
result = expand_expr_addr_expr (inner, subtarget, tmode, modifier);
*************** expand_expr_addr_expr (tree exp, rtx tar
*** 6200,6207 ****
{
/* Someone beforehand should have rejected taking the address
of such an object. */
! if (bitpos % BITS_PER_UNIT != 0)
! abort ();
result = plus_constant (result, bitpos / BITS_PER_UNIT);
if (modifier < EXPAND_SUM)
--- 6171,6177 ----
{
/* Someone beforehand should have rejected taking the address
of such an object. */
! gcc_assert (!(bitpos % BITS_PER_UNIT));
result = plus_constant (result, bitpos / BITS_PER_UNIT);
if (modifier < EXPAND_SUM)
*************** expand_expr_real_1 (tree exp, rtx target
*** 6479,6486 ****
case FUNCTION_DECL:
case RESULT_DECL:
! if (DECL_RTL (exp) == 0)
! abort ();
/* Ensure variable marked as used even if it doesn't go through
a parser. If it hasn't be used yet, write out an external
--- 6449,6455 ----
case FUNCTION_DECL:
case RESULT_DECL:
! gcc_assert (DECL_RTL (exp));
/* Ensure variable marked as used even if it doesn't go through
a parser. If it hasn't be used yet, write out an external
*************** expand_expr_real_1 (tree exp, rtx target
*** 6497,6514 ****
/* Variables inherited from containing functions should have
been lowered by this point. */
context = decl_function_context (exp);
! if (context != 0
! && context != current_function_decl
! && !TREE_STATIC (exp)
! /* ??? C++ creates functions that are not TREE_STATIC. */
! && TREE_CODE (exp) != FUNCTION_DECL)
! abort ();
/* This is the case of an array whose size is to be determined
from its initializer, while the initializer is still being parsed.
See expand_decl. */
! else if (MEM_P (DECL_RTL (exp))
&& REG_P (XEXP (DECL_RTL (exp), 0)))
temp = validize_mem (DECL_RTL (exp));
--- 6466,6482 ----
/* Variables inherited from containing functions should have
been lowered by this point. */
context = decl_function_context (exp);
! gcc_assert (!context
! || context == current_function_decl
! || TREE_STATIC (exp)
! /* ??? C++ creates functions that are not TREE_STATIC. */
! || TREE_CODE (exp) == FUNCTION_DECL);
/* This is the case of an array whose size is to be determined
from its initializer, while the initializer is still being parsed.
See expand_decl. */
! if (MEM_P (DECL_RTL (exp))
&& REG_P (XEXP (DECL_RTL (exp), 0)))
temp = validize_mem (DECL_RTL (exp));
*************** expand_expr_real_1 (tree exp, rtx target
*** 6548,6559 ****
if (REG_P (DECL_RTL (exp))
&& GET_MODE (DECL_RTL (exp)) != DECL_MODE (exp))
{
/* Get the signedness used for this variable. Ensure we get the
same mode we got when the variable was declared. */
! if (GET_MODE (DECL_RTL (exp))
! != promote_mode (type, DECL_MODE (exp), &unsignedp,
! (TREE_CODE (exp) == RESULT_DECL ? 1 : 0)))
! abort ();
temp = gen_lowpart_SUBREG (mode, DECL_RTL (exp));
SUBREG_PROMOTED_VAR_P (temp) = 1;
--- 6516,6528 ----
if (REG_P (DECL_RTL (exp))
&& GET_MODE (DECL_RTL (exp)) != DECL_MODE (exp))
{
+ enum machine_mode pmode;
+
/* Get the signedness used for this variable. Ensure we get the
same mode we got when the variable was declared. */
! pmode = promote_mode (type, DECL_MODE (exp), &unsignedp,
! (TREE_CODE (exp) == RESULT_DECL ? 1 : 0));
! gcc_assert (GET_MODE (DECL_RTL (exp)) == pmode);
temp = gen_lowpart_SUBREG (mode, DECL_RTL (exp));
SUBREG_PROMOTED_VAR_P (temp) = 1;
*************** expand_expr_real_1 (tree exp, rtx target
*** 6654,6661 ****
expanders calling save_expr immediately before expanding
something. Assume this means that we only have to deal
with non-BLKmode values. */
! if (GET_MODE (ret) == BLKmode)
! abort ();
val = build_decl (VAR_DECL, NULL, TREE_TYPE (exp));
DECL_ARTIFICIAL (val) = 1;
--- 6623,6629 ----
expanders calling save_expr immediately before expanding
something. Assume this means that we only have to deal
with non-BLKmode values. */
! gcc_assert (GET_MODE (ret) != BLKmode);
val = build_decl (VAR_DECL, NULL, TREE_TYPE (exp));
DECL_ARTIFICIAL (val) = 1;
*************** expand_expr_real_1 (tree exp, rtx target
*** 6772,6788 ****
case ARRAY_REF:
- #ifdef ENABLE_CHECKING
- if (TREE_CODE (TREE_TYPE (TREE_OPERAND (exp, 0))) != ARRAY_TYPE)
- abort ();
- #endif
-
{
tree array = TREE_OPERAND (exp, 0);
tree low_bound = array_ref_low_bound (exp);
tree index = convert (sizetype, TREE_OPERAND (exp, 1));
HOST_WIDE_INT i;
/* Optimize the special-case of a zero lower bound.
We convert the low_bound to sizetype to avoid some problems
--- 6740,6753 ----
case ARRAY_REF:
{
tree array = TREE_OPERAND (exp, 0);
tree low_bound = array_ref_low_bound (exp);
tree index = convert (sizetype, TREE_OPERAND (exp, 1));
HOST_WIDE_INT i;
+ gcc_assert (TREE_CODE (TREE_TYPE (array)) == ARRAY_TYPE);
+
/* Optimize the special-case of a zero lower bound.
We convert the low_bound to sizetype to avoid some problems
*************** expand_expr_real_1 (tree exp, rtx target
*** 6952,6959 ****
/* If we got back the original object, something is wrong. Perhaps
we are evaluating an expression too early. In any event, don't
infinitely recurse. */
! if (tem == exp)
! abort ();
/* If TEM's type is a union of variable size, pass TARGET to the inner
computation, since it will need a temporary and TARGET is known
--- 6917,6923 ----
/* If we got back the original object, something is wrong. Perhaps
we are evaluating an expression too early. In any event, don't
infinitely recurse. */
! gcc_assert (tem != exp);
/* If TEM's type is a union of variable size, pass TARGET to the inner
computation, since it will need a temporary and TARGET is known
*************** expand_expr_real_1 (tree exp, rtx target
*** 7007,7014 ****
rtx offset_rtx = expand_expr (offset, NULL_RTX, VOIDmode,
EXPAND_SUM);
! if (!MEM_P (op0))
! abort ();
#ifdef POINTERS_EXTEND_UNSIGNED
if (GET_MODE (offset_rtx) != Pmode)
--- 6971,6977 ----
rtx offset_rtx = expand_expr (offset, NULL_RTX, VOIDmode,
EXPAND_SUM);
! gcc_assert (MEM_P (op0));
#ifdef POINTERS_EXTEND_UNSIGNED
if (GET_MODE (offset_rtx) != Pmode)
*************** expand_expr_real_1 (tree exp, rtx target
*** 7055,7062 ****
one element arrays having the same mode as its element. */
if (GET_CODE (op0) == CONCAT)
{
! if (bitpos != 0 || bitsize != GET_MODE_BITSIZE (GET_MODE (op0)))
! abort ();
return op0;
}
--- 7018,7025 ----
one element arrays having the same mode as its element. */
if (GET_CODE (op0) == CONCAT)
{
! gcc_assert (bitpos == 0
! && bitsize == GET_MODE_BITSIZE (GET_MODE (op0)));
return op0;
}
*************** expand_expr_real_1 (tree exp, rtx target
*** 7113,7122 ****
/* In this case, BITPOS must start at a byte boundary and
TARGET, if specified, must be a MEM. */
! if (!MEM_P (op0)
! || (target != 0 && !MEM_P (target))
! || bitpos % BITS_PER_UNIT != 0)
! abort ();
emit_block_move (target,
adjust_address (op0, VOIDmode,
--- 7076,7084 ----
/* In this case, BITPOS must start at a byte boundary and
TARGET, if specified, must be a MEM. */
! gcc_assert (MEM_P (op0)
! && (!target || MEM_P (target))
! && !(bitpos % BITS_PER_UNIT));
emit_block_move (target,
adjust_address (op0, VOIDmode,
*************** expand_expr_real_1 (tree exp, rtx target
*** 7261,7277 ****
adjust_address (target, TYPE_MODE (valtype), 0),
modifier == EXPAND_STACK_PARM ? 2 : 0);
- else if (REG_P (target))
- /* Store this field into a union of the proper type. */
- store_field (target,
- MIN ((int_size_in_bytes (TREE_TYPE
- (TREE_OPERAND (exp, 0)))
- * BITS_PER_UNIT),
- (HOST_WIDE_INT) GET_MODE_BITSIZE (mode)),
- 0, TYPE_MODE (valtype), TREE_OPERAND (exp, 0),
- VOIDmode, 0, type, 0);
else
! abort ();
/* Return the entire union. */
return target;
--- 7223,7241 ----
adjust_address (target, TYPE_MODE (valtype), 0),
modifier == EXPAND_STACK_PARM ? 2 : 0);
else
! {
! gcc_assert (REG_P (target));
!
! /* Store this field into a union of the proper type. */
! store_field (target,
! MIN ((int_size_in_bytes (TREE_TYPE
! (TREE_OPERAND (exp, 0)))
! * BITS_PER_UNIT),
! (HOST_WIDE_INT) GET_MODE_BITSIZE (mode)),
! 0, TYPE_MODE (valtype), TREE_OPERAND (exp, 0),
! VOIDmode, 0, type, 0);
! }
/* Return the entire union. */
return target;
*************** expand_expr_real_1 (tree exp, rtx target
*** 7347,7354 ****
constants to change mode. */
tree inner_type = TREE_TYPE (TREE_OPERAND (exp, 0));
! if (TREE_ADDRESSABLE (exp))
! abort ();
if (target == 0 || GET_MODE (target) != TYPE_MODE (inner_type))
target
--- 7311,7317 ----
constants to change mode. */
tree inner_type = TREE_TYPE (TREE_OPERAND (exp, 0));
! gcc_assert (!TREE_ADDRESSABLE (exp));
if (target == 0 || GET_MODE (target) != TYPE_MODE (inner_type))
target
*************** expand_expr_real_1 (tree exp, rtx target
*** 7381,7388 ****
temp_size, 0, type);
rtx new_with_op0_mode = adjust_address (new, GET_MODE (op0), 0);
! if (TREE_ADDRESSABLE (exp))
! abort ();
if (GET_MODE (op0) == BLKmode)
emit_block_move (new_with_op0_mode, op0,
--- 7344,7350 ----
temp_size, 0, type);
rtx new_with_op0_mode = adjust_address (new, GET_MODE (op0), 0);
! gcc_assert (!TREE_ADDRESSABLE (exp));
if (GET_MODE (op0) == BLKmode)
emit_block_move (new_with_op0_mode, op0,
*************** expand_expr_real_1 (tree exp, rtx target
*** 7712,7718 ****
case FIX_ROUND_EXPR:
case FIX_FLOOR_EXPR:
case FIX_CEIL_EXPR:
! abort (); /* Not used for C. */
case FIX_TRUNC_EXPR:
op0 = expand_expr (TREE_OPERAND (exp, 0), NULL_RTX, VOIDmode, 0);
--- 7674,7680 ----
case FIX_ROUND_EXPR:
case FIX_FLOOR_EXPR:
case FIX_CEIL_EXPR:
! gcc_unreachable (); /* Not used for C. */
case FIX_TRUNC_EXPR:
op0 = expand_expr (TREE_OPERAND (exp, 0), NULL_RTX, VOIDmode, 0);
*************** expand_expr_real_1 (tree exp, rtx target
*** 7741,7748 ****
temp = expand_unop (mode,
optab_for_tree_code (NEGATE_EXPR, type),
op0, target, 0);
! if (temp == 0)
! abort ();
return REDUCE_BIT_FIELD (temp);
case ABS_EXPR:
--- 7703,7709 ----
temp = expand_unop (mode,
optab_for_tree_code (NEGATE_EXPR, type),
op0, target, 0);
! gcc_assert (temp);
return REDUCE_BIT_FIELD (temp);
case ABS_EXPR:
*************** expand_expr_real_1 (tree exp, rtx target
*** 7751,7759 ****
target = 0;
/* ABS_EXPR is not valid for complex arguments. */
! if (GET_MODE_CLASS (mode) == MODE_COMPLEX_INT
! || GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT)
! abort ();
/* Unsigned abs is simply the operand. Testing here means we don't
risk generating incorrect code below. */
--- 7712,7719 ----
target = 0;
/* ABS_EXPR is not valid for complex arguments. */
! gcc_assert (GET_MODE_CLASS (mode) != MODE_COMPLEX_INT
! && GET_MODE_CLASS (mode) != MODE_COMPLEX_FLOAT);
/* Unsigned abs is simply the operand. Testing here means we don't
risk generating incorrect code below. */
*************** expand_expr_real_1 (tree exp, rtx target
*** 7830,7837 ****
if (modifier == EXPAND_STACK_PARM)
target = 0;
temp = expand_unop (mode, one_cmpl_optab, op0, target, 1);
! if (temp == 0)
! abort ();
return temp;
/* ??? Can optimize bitwise operations with one arg constant.
--- 7790,7796 ----
if (modifier == EXPAND_STACK_PARM)
target = 0;
temp = expand_unop (mode, one_cmpl_optab, op0, target, 1);
! gcc_assert (temp);
return temp;
/* ??? Can optimize bitwise operations with one arg constant.
*************** expand_expr_real_1 (tree exp, rtx target
*** 7968,7983 ****
only with operands that are always zero or one. */
temp = expand_binop (mode, xor_optab, op0, const1_rtx,
target, 1, OPTAB_LIB_WIDEN);
! if (temp == 0)
! abort ();
return temp;
case STATEMENT_LIST:
{
tree_stmt_iterator iter;
! if (!ignore)
! abort ();
for (iter = tsi_start (exp); !tsi_end_p (iter); tsi_next (&iter))
expand_expr (tsi_stmt (iter), const0_rtx, VOIDmode, modifier);
--- 7927,7940 ----
only with operands that are always zero or one. */
temp = expand_binop (mode, xor_optab, op0, const1_rtx,
target, 1, OPTAB_LIB_WIDEN);
! gcc_assert (temp);
return temp;
case STATEMENT_LIST:
{
tree_stmt_iterator iter;
! gcc_assert (ignore);
for (iter = tsi_start (exp); !tsi_end_p (iter); tsi_next (&iter))
expand_expr (tsi_stmt (iter), const0_rtx, VOIDmode, modifier);
*************** expand_expr_real_1 (tree exp, rtx target
*** 7992,8002 ****
tree then_ = TREE_OPERAND (exp, 1);
tree else_ = TREE_OPERAND (exp, 2);
! if (TREE_CODE (then_) != GOTO_EXPR
! || TREE_CODE (GOTO_DESTINATION (then_)) != LABEL_DECL
! || TREE_CODE (else_) != GOTO_EXPR
! || TREE_CODE (GOTO_DESTINATION (else_)) != LABEL_DECL)
! abort ();
jumpif (pred, label_rtx (GOTO_DESTINATION (then_)));
return expand_expr (else_, const0_rtx, VOIDmode, 0);
--- 7949,7958 ----
tree then_ = TREE_OPERAND (exp, 1);
tree else_ = TREE_OPERAND (exp, 2);
! gcc_assert (TREE_CODE (then_) == GOTO_EXPR
! && TREE_CODE (GOTO_DESTINATION (then_)) == LABEL_DECL
! && TREE_CODE (else_) == GOTO_EXPR
! && TREE_CODE (GOTO_DESTINATION (else_)) == LABEL_DECL);
jumpif (pred, label_rtx (GOTO_DESTINATION (then_)));
return expand_expr (else_, const0_rtx, VOIDmode, 0);
*************** expand_expr_real_1 (tree exp, rtx target
*** 8007,8017 ****
a temporary variable, so that we can evaluate them here
for side effect only. If type is void, we must do likewise. */
! if (TREE_ADDRESSABLE (type)
! || ignore
! || TREE_TYPE (TREE_OPERAND (exp, 1)) == void_type_node
! || TREE_TYPE (TREE_OPERAND (exp, 2)) == void_type_node)
! abort ();
/* If we are not to produce a result, we have no target. Otherwise,
if a target was specified use it; it will not be used as an
--- 7963,7972 ----
a temporary variable, so that we can evaluate them here
for side effect only. If type is void, we must do likewise. */
! gcc_assert (!TREE_ADDRESSABLE (type)
! && !ignore
! && TREE_TYPE (TREE_OPERAND (exp, 1)) != void_type_node
! && TREE_TYPE (TREE_OPERAND (exp, 2)) != void_type_node);
/* If we are not to produce a result, we have no target. Otherwise,
if a target was specified use it; it will not be used as an
*************** expand_expr_real_1 (tree exp, rtx target
*** 8163,8169 ****
case EH_FILTER_EXPR:
case TRY_FINALLY_EXPR:
/* Lowered by tree-eh.c. */
! abort ();
case WITH_CLEANUP_EXPR:
case CLEANUP_POINT_EXPR:
--- 8118,8124 ----
case EH_FILTER_EXPR:
case TRY_FINALLY_EXPR:
/* Lowered by tree-eh.c. */
! gcc_unreachable ();
case WITH_CLEANUP_EXPR:
case CLEANUP_POINT_EXPR:
*************** expand_expr_real_1 (tree exp, rtx target
*** 8185,8191 ****
case TRUTH_ANDIF_EXPR:
case TRUTH_ORIF_EXPR:
/* Lowered by gimplify.c. */
! abort ();
case EXC_PTR_EXPR:
return get_exception_pointer (cfun);
--- 8140,8146 ----
case TRUTH_ANDIF_EXPR:
case TRUTH_ORIF_EXPR:
/* Lowered by gimplify.c. */
! gcc_unreachable ();
case EXC_PTR_EXPR:
return get_exception_pointer (cfun);
*************** expand_expr_real_1 (tree exp, rtx target
*** 8196,8202 ****
case FDESC_EXPR:
/* Function descriptors are not valid except for as
initialization constants, and should not be expanded. */
! abort ();
case SWITCH_EXPR:
expand_case (exp);
--- 8151,8157 ----
case FDESC_EXPR:
/* Function descriptors are not valid except for as
initialization constants, and should not be expanded. */
! gcc_unreachable ();
case SWITCH_EXPR:
expand_case (exp);
*************** expand_expr_real_1 (tree exp, rtx target
*** 8232,8239 ****
target = 0;
temp = expand_binop (mode, this_optab, op0, op1, target,
unsignedp, OPTAB_LIB_WIDEN);
! if (temp == 0)
! abort ();
return REDUCE_BIT_FIELD (temp);
}
#undef REDUCE_BIT_FIELD
--- 8187,8193 ----
target = 0;
temp = expand_binop (mode, this_optab, op0, op1, target,
unsignedp, OPTAB_LIB_WIDEN);
! gcc_assert (temp);
return REDUCE_BIT_FIELD (temp);
}
#undef REDUCE_BIT_FIELD
*************** do_store_flag (tree exp, rtx target, enu
*** 8499,8505 ****
break;
default:
! abort ();
}
/* Put a constant second. */
--- 8453,8459 ----
break;
default:
! gcc_unreachable ();
}
/* Put a constant second. */
*************** do_store_flag (tree exp, rtx target, enu
*** 8595,8602 ****
code = GET_CODE (result);
label = gen_label_rtx ();
! if (bcc_gen_fctn[(int) code] == 0)
! abort ();
emit_jump_insn ((*bcc_gen_fctn[(int) code]) (label));
emit_move_insn (target, invert ? const1_rtx : const0_rtx);
--- 8549,8555 ----
code = GET_CODE (result);
label = gen_label_rtx ();
! gcc_assert (bcc_gen_fctn[(int) code]);
emit_jump_insn ((*bcc_gen_fctn[(int) code]) (label));
emit_move_insn (target, invert ? const1_rtx : const0_rtx);