Commit fbc848cc by Nathan Sidwell Committed by Nathan Sidwell

value-prof.c (rtl_find_values_to_profile): Use gcc_assert and gcc_unreachable.

	* value-prof.c (rtl_find_values_to_profile): Use gcc_assert and
	gcc_unreachable.
	(rtl_register_value_prof_hooks,
	tree_value_profile_transformations,
	tree_register_value_prof_hooks): Likewise.
	* var-tracking.c (stack_adjust_offset_pre_post,
	variable_htab_free, variable_union, dataflow_set_different_2,
	count_uses, variable_was_changed, set_frame_base_location,
	set_variable_part, emit_note_insn_var_location, vt_emit_notes,
	vt_add_function_parameters): Likewise.
	* varasm.c (named_section_real, named_section, make_decl_rtl,
	asm_emit_uninitialised, assemble_integer, decode_addr_const,
	const_hash_1, compare_constant, copy_constant, force_const_mem,
	output_constant_pool_2, output_constant_pool_1, output_constant,
	output_constructor, make_decl_one_only, decl_tls_model,
	default_no_named_section, default_elf_select_section_1,
	default_unique_section_1): Likewise.
	* vec.c (vec_gc_o_reserve, vec_heap_o_reserve): Likewise.
	* vmsdbgout.c (addr_const_to_string): Likewise.

From-SVN: r96241
parent 4fd24a75
2005-03-10 Nathan Sidwell <nathan@codesourcery.com> 2005-03-10 Nathan Sidwell <nathan@codesourcery.com>
* value-prof.c (rtl_find_values_to_profile): Use gcc_assert and
gcc_unreachable.
(rtl_register_value_prof_hooks,
tree_value_profile_transformations,
tree_register_value_prof_hooks): Likewise.
* var-tracking.c (stack_adjust_offset_pre_post,
variable_htab_free, variable_union, dataflow_set_different_2,
count_uses, variable_was_changed, set_frame_base_location,
set_variable_part, emit_note_insn_var_location, vt_emit_notes,
vt_add_function_parameters): Likewise.
* varasm.c (named_section_real, named_section, make_decl_rtl,
asm_emit_uninitialised, assemble_integer, decode_addr_const,
const_hash_1, compare_constant, copy_constant, force_const_mem,
output_constant_pool_2, output_constant_pool_1, output_constant,
output_constructor, make_decl_one_only, decl_tls_model,
default_no_named_section, default_elf_select_section_1,
default_unique_section_1): Likewise.
* vec.c (vec_gc_o_reserve, vec_heap_o_reserve): Likewise.
* vmsdbgout.c (addr_const_to_string): Likewise.
PR c++/20375 PR c++/20375
* function.c (struct assign_parm_data_one): Remove last_named * function.c (struct assign_parm_data_one): Remove last_named
field. field.
......
...@@ -360,7 +360,7 @@ rtl_find_values_to_profile (histogram_values *values) ...@@ -360,7 +360,7 @@ rtl_find_values_to_profile (histogram_values *values)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
} }
allocate_reg_info (max_reg_num (), FALSE, FALSE); allocate_reg_info (max_reg_num (), FALSE, FALSE);
...@@ -1032,21 +1032,20 @@ void ...@@ -1032,21 +1032,20 @@ void
rtl_register_value_prof_hooks (void) rtl_register_value_prof_hooks (void)
{ {
value_prof_hooks = &rtl_value_prof_hooks; value_prof_hooks = &rtl_value_prof_hooks;
if (ir_type ()) gcc_assert (!ir_type ());
abort ();
} }
/* Tree-based versions are stubs for now. */ /* Tree-based versions are stubs for now. */
static void static void
tree_find_values_to_profile (histogram_values *values ATTRIBUTE_UNUSED) tree_find_values_to_profile (histogram_values *values ATTRIBUTE_UNUSED)
{ {
abort (); gcc_unreachable ();
} }
static bool static bool
tree_value_profile_transformations (void) tree_value_profile_transformations (void)
{ {
abort (); gcc_unreachable ();
} }
static struct value_prof_hooks tree_value_prof_hooks = { static struct value_prof_hooks tree_value_prof_hooks = {
...@@ -1058,8 +1057,7 @@ void ...@@ -1058,8 +1057,7 @@ void
tree_register_value_prof_hooks (void) tree_register_value_prof_hooks (void)
{ {
value_prof_hooks = &tree_value_prof_hooks; value_prof_hooks = &tree_value_prof_hooks;
if (!ir_type ()) gcc_assert (ir_type ());
abort ();
} }
/* IR-independent entry points. */ /* IR-independent entry points. */
......
...@@ -387,9 +387,9 @@ stack_adjust_offset_pre_post (rtx pattern, HOST_WIDE_INT *pre, ...@@ -387,9 +387,9 @@ stack_adjust_offset_pre_post (rtx pattern, HOST_WIDE_INT *pre,
{ {
rtx val = XEXP (XEXP (src, 1), 1); rtx val = XEXP (XEXP (src, 1), 1);
/* We handle only adjustments by constant amount. */ /* We handle only adjustments by constant amount. */
if (GET_CODE (XEXP (src, 1)) != PLUS || gcc_assert (GET_CODE (XEXP (src, 1)) == PLUS &&
GET_CODE (val) != CONST_INT) GET_CODE (val) == CONST_INT);
abort ();
if (code == PRE_MODIFY) if (code == PRE_MODIFY)
*pre -= INTVAL (val); *pre -= INTVAL (val);
else else
...@@ -639,10 +639,7 @@ variable_htab_free (void *elem) ...@@ -639,10 +639,7 @@ variable_htab_free (void *elem)
variable var = (variable) elem; variable var = (variable) elem;
location_chain node, next; location_chain node, next;
#ifdef ENABLE_CHECKING gcc_assert (var->refcount > 0);
if (var->refcount <= 0)
abort ();
#endif
var->refcount--; var->refcount--;
if (var->refcount > 0) if (var->refcount > 0)
...@@ -1019,22 +1016,14 @@ variable_union (void **slot, void *data) ...@@ -1019,22 +1016,14 @@ variable_union (void **slot, void *data)
a copy of the variable. */ a copy of the variable. */
for (k = 0; k < src->n_var_parts; k++) for (k = 0; k < src->n_var_parts; k++)
{ {
gcc_assert (!src->var_part[k].loc_chain
== !src->var_part[k].cur_loc);
if (src->var_part[k].loc_chain) if (src->var_part[k].loc_chain)
{ {
#ifdef ENABLE_CHECKING gcc_assert (src->var_part[k].cur_loc);
if (src->var_part[k].cur_loc == NULL)
abort ();
#endif
if (src->var_part[k].cur_loc != src->var_part[k].loc_chain->loc) if (src->var_part[k].cur_loc != src->var_part[k].loc_chain->loc)
break; break;
} }
#ifdef ENABLE_CHECKING
else
{
if (src->var_part[k].cur_loc != NULL)
abort ();
}
#endif
} }
if (k < src->n_var_parts) if (k < src->n_var_parts)
unshare_variable (set, src); unshare_variable (set, src);
...@@ -1047,10 +1036,7 @@ variable_union (void **slot, void *data) ...@@ -1047,10 +1036,7 @@ variable_union (void **slot, void *data)
else else
dst = *dstp; dst = *dstp;
#ifdef ENABLE_CHECKING gcc_assert (src->n_var_parts);
if (src->n_var_parts == 0)
abort ();
#endif
/* Count the number of location parts, result is K. */ /* Count the number of location parts, result is K. */
for (i = 0, j = 0, k = 0; for (i = 0, j = 0, k = 0;
...@@ -1068,12 +1054,10 @@ variable_union (void **slot, void *data) ...@@ -1068,12 +1054,10 @@ variable_union (void **slot, void *data)
} }
k += src->n_var_parts - i; k += src->n_var_parts - i;
k += dst->n_var_parts - j; k += dst->n_var_parts - j;
#ifdef ENABLE_CHECKING
/* We track only variables whose size is <= MAX_VAR_PARTS bytes /* We track only variables whose size is <= MAX_VAR_PARTS bytes
thus there are at most MAX_VAR_PARTS different offsets. */ thus there are at most MAX_VAR_PARTS different offsets. */
if (k > MAX_VAR_PARTS) gcc_assert (k <= MAX_VAR_PARTS);
abort ();
#endif
if (dst->refcount > 1 && dst->n_var_parts != k) if (dst->refcount > 1 && dst->n_var_parts != k)
dst = unshare_variable (set, dst); dst = unshare_variable (set, dst);
...@@ -1356,12 +1340,9 @@ dataflow_set_different_2 (void **slot, void *data) ...@@ -1356,12 +1340,9 @@ dataflow_set_different_2 (void **slot, void *data)
return 0; return 0;
} }
#ifdef ENABLE_CHECKING
/* If both variables are defined they have been already checked for /* If both variables are defined they have been already checked for
equivalence. */ equivalence. */
if (variable_different_p (var1, var2, false)) gcc_assert (!variable_different_p (var1, var2, false));
abort ();
#endif
/* Continue traversing the hash table. */ /* Continue traversing the hash table. */
return 1; return 1;
...@@ -1517,10 +1498,7 @@ count_uses (rtx *loc, void *insn) ...@@ -1517,10 +1498,7 @@ count_uses (rtx *loc, void *insn)
if (REG_P (*loc)) if (REG_P (*loc))
{ {
#ifdef ENABLE_CHECKING gcc_assert (REGNO (*loc) < FIRST_PSEUDO_REGISTER);
if (REGNO (*loc) >= FIRST_PSEUDO_REGISTER)
abort ();
#endif
VTI (bb)->n_mos++; VTI (bb)->n_mos++;
} }
else if (MEM_P (*loc) else if (MEM_P (*loc)
...@@ -1922,10 +1900,7 @@ variable_was_changed (variable var, htab_t htab) ...@@ -1922,10 +1900,7 @@ variable_was_changed (variable var, htab_t htab)
} }
else else
{ {
#ifdef ENABLE_CHECKING gcc_assert (htab);
if (!htab)
abort ();
#endif
if (var->n_var_parts == 0) if (var->n_var_parts == 0)
{ {
void **slot = htab_find_slot_with_hash (htab, var->decl, hash, void **slot = htab_find_slot_with_hash (htab, var->decl, hash,
...@@ -1947,16 +1922,10 @@ set_frame_base_location (dataflow_set *set, rtx loc) ...@@ -1947,16 +1922,10 @@ set_frame_base_location (dataflow_set *set, rtx loc)
var = htab_find_with_hash (set->vars, frame_base_decl, var = htab_find_with_hash (set->vars, frame_base_decl,
VARIABLE_HASH_VAL (frame_base_decl)); VARIABLE_HASH_VAL (frame_base_decl));
#ifdef ENABLE_CHECKING gcc_assert (var);
if (!var) gcc_assert (var->n_var_parts == 1);
abort (); gcc_assert (!var->var_part[0].offset);
if (var->n_var_parts != 1) gcc_assert (var->var_part[0].loc_chain);
abort ();
if (var->var_part[0].offset != 0)
abort ();
if (!var->var_part[0].loc_chain)
abort ();
#endif
/* If frame_base_decl is shared unshare it first. */ /* If frame_base_decl is shared unshare it first. */
if (var->refcount > 1) if (var->refcount > 1)
...@@ -2040,12 +2009,9 @@ set_variable_part (dataflow_set *set, rtx loc, tree decl, HOST_WIDE_INT offset) ...@@ -2040,12 +2009,9 @@ set_variable_part (dataflow_set *set, rtx loc, tree decl, HOST_WIDE_INT offset)
if (var->refcount > 1) if (var->refcount > 1)
var = unshare_variable (set, var); var = unshare_variable (set, var);
#ifdef ENABLE_CHECKING
/* We track only variables whose size is <= MAX_VAR_PARTS bytes /* We track only variables whose size is <= MAX_VAR_PARTS bytes
thus there are at most MAX_VAR_PARTS different offsets. */ thus there are at most MAX_VAR_PARTS different offsets. */
if (var->n_var_parts >= MAX_VAR_PARTS) gcc_assert (var->n_var_parts < MAX_VAR_PARTS);
abort ();
#endif
/* We have to move the elements of array starting at index low to the /* We have to move the elements of array starting at index low to the
next position. */ next position. */
...@@ -2207,10 +2173,7 @@ emit_note_insn_var_location (void **varp, void *data) ...@@ -2207,10 +2173,7 @@ emit_note_insn_var_location (void **varp, void *data)
HOST_WIDE_INT last_limit; HOST_WIDE_INT last_limit;
tree type_size_unit; tree type_size_unit;
#ifdef ENABLE_CHECKING gcc_assert (var->decl);
if (!var->decl)
abort ();
#endif
complete = true; complete = true;
last_limit = 0; last_limit = 0;
...@@ -2447,10 +2410,7 @@ vt_emit_notes (void) ...@@ -2447,10 +2410,7 @@ vt_emit_notes (void)
dataflow_set *last_out; dataflow_set *last_out;
dataflow_set empty; dataflow_set empty;
#ifdef ENABLE_CHECKING gcc_assert (!htab_elements (changed_variables));
if (htab_elements (changed_variables))
abort ();
#endif
/* Enable emitting notes by functions (mainly by set_variable_part and /* Enable emitting notes by functions (mainly by set_variable_part and
delete_variable_part). */ delete_variable_part). */
...@@ -2536,20 +2496,14 @@ vt_add_function_parameters (void) ...@@ -2536,20 +2496,14 @@ vt_add_function_parameters (void)
if (!decl) if (!decl)
continue; continue;
#ifdef ENABLE_CHECKING gcc_assert (parm == decl);
if (parm != decl)
abort ();
#endif
incoming = eliminate_regs (incoming, 0, NULL_RTX); incoming = eliminate_regs (incoming, 0, NULL_RTX);
out = &VTI (ENTRY_BLOCK_PTR)->out; out = &VTI (ENTRY_BLOCK_PTR)->out;
if (REG_P (incoming)) if (REG_P (incoming))
{ {
#ifdef ENABLE_CHECKING gcc_assert (REGNO (incoming) < FIRST_PSEUDO_REGISTER);
if (REGNO (incoming) >= FIRST_PSEUDO_REGISTER)
abort ();
#endif
attrs_list_insert (&out->regs[REGNO (incoming)], attrs_list_insert (&out->regs[REGNO (incoming)],
parm, offset, incoming); parm, offset, incoming);
set_variable_part (out, incoming, parm, offset); set_variable_part (out, incoming, parm, offset);
......
...@@ -423,8 +423,9 @@ named_section_real (const char *name, unsigned int flags, tree decl) ...@@ -423,8 +423,9 @@ named_section_real (const char *name, unsigned int flags, tree decl)
{ {
if (in_section != in_named || strcmp (name, in_named_name) != 0) if (in_section != in_named || strcmp (name, in_named_name) != 0)
{ {
if (! set_named_section_flags (name, flags)) bool unchanged = set_named_section_flags (name, flags);
abort ();
gcc_assert (unchanged);
targetm.asm_out.named_section (name, flags, decl); targetm.asm_out.named_section (name, flags, decl);
...@@ -448,8 +449,7 @@ named_section (tree decl, const char *name, int reloc) ...@@ -448,8 +449,7 @@ named_section (tree decl, const char *name, int reloc)
{ {
unsigned int flags; unsigned int flags;
if (decl != NULL_TREE && !DECL_P (decl)) gcc_assert (!decl || DECL_P (decl));
abort ();
if (name == NULL) if (name == NULL)
name = TREE_STRING_POINTER (DECL_SECTION_NAME (decl)); name = TREE_STRING_POINTER (DECL_SECTION_NAME (decl));
...@@ -852,19 +852,19 @@ make_decl_rtl (tree decl) ...@@ -852,19 +852,19 @@ make_decl_rtl (tree decl)
rtx x; rtx x;
/* Check that we are not being given an automatic variable. */ /* Check that we are not being given an automatic variable. */
gcc_assert (TREE_CODE (decl) != PARM_DECL
&& TREE_CODE (decl) != RESULT_DECL);
/* A weak alias has TREE_PUBLIC set but not the other bits. */ /* A weak alias has TREE_PUBLIC set but not the other bits. */
if (TREE_CODE (decl) == PARM_DECL gcc_assert (TREE_CODE (decl) != VAR_DECL
|| TREE_CODE (decl) == RESULT_DECL || TREE_STATIC (decl)
|| (TREE_CODE (decl) == VAR_DECL || TREE_PUBLIC (decl)
&& !TREE_STATIC (decl) || DECL_EXTERNAL (decl)
&& !TREE_PUBLIC (decl) || DECL_REGISTER (decl));
&& !DECL_EXTERNAL (decl)
&& !DECL_REGISTER (decl)))
abort ();
/* And that we were not given a type or a label. */ /* And that we were not given a type or a label. */
else if (TREE_CODE (decl) == TYPE_DECL gcc_assert (TREE_CODE (decl) != TYPE_DECL
|| TREE_CODE (decl) == LABEL_DECL) && TREE_CODE (decl) != LABEL_DECL);
abort ();
/* For a duplicate declaration, we can be called twice on the /* For a duplicate declaration, we can be called twice on the
same DECL node. Don't discard the RTL already made. */ same DECL node. Don't discard the RTL already made. */
...@@ -1003,8 +1003,7 @@ make_decl_rtl (tree decl) ...@@ -1003,8 +1003,7 @@ make_decl_rtl (tree decl)
void void
make_var_volatile (tree var) make_var_volatile (tree var)
{ {
if (!MEM_P (DECL_RTL (var))) gcc_assert (MEM_P (DECL_RTL (var)));
abort ();
MEM_VOLATILE_P (DECL_RTL (var)) = 1; MEM_VOLATILE_P (DECL_RTL (var)) = 1;
} }
...@@ -1487,7 +1486,7 @@ asm_emit_uninitialised (tree decl, const char *name, ...@@ -1487,7 +1486,7 @@ asm_emit_uninitialised (tree decl, const char *name,
ASM_EMIT_LOCAL (decl, name, size, rounded); ASM_EMIT_LOCAL (decl, name, size, rounded);
break; break;
default: default:
abort (); gcc_unreachable ();
} }
return true; return true;
...@@ -2122,12 +2121,10 @@ assemble_integer (rtx x, unsigned int size, unsigned int align, int force) ...@@ -2122,12 +2121,10 @@ assemble_integer (rtx x, unsigned int size, unsigned int align, int force)
/* If we've printed some of it, but not all of it, there's no going /* If we've printed some of it, but not all of it, there's no going
back now. */ back now. */
if (i > 0) gcc_assert (!i);
abort ();
} }
if (force) gcc_assert (!force);
abort ();
return false; return false;
} }
...@@ -2231,11 +2228,10 @@ decode_addr_const (tree exp, struct addr_const *value) ...@@ -2231,11 +2228,10 @@ decode_addr_const (tree exp, struct addr_const *value)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
if (!MEM_P (x)) gcc_assert (MEM_P (x));
abort ();
x = XEXP (x, 0); x = XEXP (x, 0);
value->base = x; value->base = x;
...@@ -2318,19 +2314,24 @@ const_hash_1 (const tree exp) ...@@ -2318,19 +2314,24 @@ const_hash_1 (const tree exp)
struct addr_const value; struct addr_const value;
decode_addr_const (exp, &value); decode_addr_const (exp, &value);
if (GET_CODE (value.base) == SYMBOL_REF) switch (GET_CODE (value.base))
{ {
case SYMBOL_REF:
/* Don't hash the address of the SYMBOL_REF; /* Don't hash the address of the SYMBOL_REF;
only use the offset and the symbol name. */ only use the offset and the symbol name. */
hi = value.offset; hi = value.offset;
p = XSTR (value.base, 0); p = XSTR (value.base, 0);
for (i = 0; p[i] != 0; i++) for (i = 0; p[i] != 0; i++)
hi = ((hi * 613) + (unsigned) (p[i])); hi = ((hi * 613) + (unsigned) (p[i]));
} break;
else if (GET_CODE (value.base) == LABEL_REF)
case LABEL_REF:
hi = value.offset + CODE_LABEL_NUMBER (XEXP (value.base, 0)) * 13; hi = value.offset + CODE_LABEL_NUMBER (XEXP (value.base, 0)) * 13;
else break;
abort ();
default:
gcc_unreachable ();
}
} }
return hi; return hi;
...@@ -2492,8 +2493,7 @@ compare_constant (const tree t1, const tree t2) ...@@ -2492,8 +2493,7 @@ compare_constant (const tree t1, const tree t2)
} }
} }
/* Should not get here. */ gcc_unreachable ();
abort ();
} }
/* Make a copy of the whole tree structure for a constant. This /* Make a copy of the whole tree structure for a constant. This
...@@ -2551,12 +2551,10 @@ copy_constant (tree exp) ...@@ -2551,12 +2551,10 @@ copy_constant (tree exp)
default: default:
{ {
tree t; tree t = lang_hooks.expand_constant (exp);
t = lang_hooks.expand_constant (exp);
if (t != exp) gcc_assert (t == exp);
return copy_constant (t); return copy_constant (t);
else
abort ();
} }
} }
} }
...@@ -3018,8 +3016,7 @@ force_const_mem (enum machine_mode mode, rtx x) ...@@ -3018,8 +3016,7 @@ force_const_mem (enum machine_mode mode, rtx x)
/* Insert the descriptor into the symbol cross-reference table too. */ /* Insert the descriptor into the symbol cross-reference table too. */
slot = htab_find_slot (pool->const_rtx_sym_htab, desc, INSERT); slot = htab_find_slot (pool->const_rtx_sym_htab, desc, INSERT);
if (*slot) gcc_assert (!*slot);
abort ();
*slot = desc; *slot = desc;
/* Construct the MEM. */ /* Construct the MEM. */
...@@ -3100,15 +3097,14 @@ output_constant_pool_2 (enum machine_mode mode, rtx x, unsigned int align) ...@@ -3100,15 +3097,14 @@ output_constant_pool_2 (enum machine_mode mode, rtx x, unsigned int align)
switch (GET_MODE_CLASS (mode)) switch (GET_MODE_CLASS (mode))
{ {
case MODE_FLOAT: case MODE_FLOAT:
if (GET_CODE (x) != CONST_DOUBLE)
abort ();
else
{ {
REAL_VALUE_TYPE r; REAL_VALUE_TYPE r;
gcc_assert (GET_CODE (x) == CONST_DOUBLE);
REAL_VALUE_FROM_CONST_DOUBLE (r, x); REAL_VALUE_FROM_CONST_DOUBLE (r, x);
assemble_real (r, mode, align); assemble_real (r, mode, align);
}
break; break;
}
case MODE_INT: case MODE_INT:
case MODE_PARTIAL_INT: case MODE_PARTIAL_INT:
...@@ -3122,8 +3118,7 @@ output_constant_pool_2 (enum machine_mode mode, rtx x, unsigned int align) ...@@ -3122,8 +3118,7 @@ output_constant_pool_2 (enum machine_mode mode, rtx x, unsigned int align)
enum machine_mode submode = GET_MODE_INNER (mode); enum machine_mode submode = GET_MODE_INNER (mode);
unsigned int subalign = MIN (align, GET_MODE_BITSIZE (submode)); unsigned int subalign = MIN (align, GET_MODE_BITSIZE (submode));
if (GET_CODE (x) != CONST_VECTOR) gcc_assert (GET_CODE (x) == CONST_VECTOR);
abort ();
units = CONST_VECTOR_NUNITS (x); units = CONST_VECTOR_NUNITS (x);
for (i = 0; i < units; i++) for (i = 0; i < units; i++)
...@@ -3135,7 +3130,7 @@ output_constant_pool_2 (enum machine_mode mode, rtx x, unsigned int align) ...@@ -3135,7 +3130,7 @@ output_constant_pool_2 (enum machine_mode mode, rtx x, unsigned int align)
break; break;
default: default:
abort (); gcc_unreachable ();
} }
} }
...@@ -3171,13 +3166,9 @@ output_constant_pool_1 (struct constant_descriptor_rtx *desc) ...@@ -3171,13 +3166,9 @@ output_constant_pool_1 (struct constant_descriptor_rtx *desc)
case LABEL_REF: case LABEL_REF:
tmp = XEXP (x, 0); tmp = XEXP (x, 0);
if (INSN_DELETED_P (tmp) gcc_assert (!INSN_DELETED_P (tmp));
|| (NOTE_P (tmp) gcc_assert (!NOTE_P (tmp)
&& NOTE_LINE_NUMBER (tmp) == NOTE_INSN_DELETED)) || NOTE_LINE_NUMBER (tmp) != NOTE_INSN_DELETED);
{
abort ();
x = const0_rtx;
}
break; break;
default: default:
...@@ -3743,7 +3734,7 @@ output_constant (tree exp, unsigned HOST_WIDE_INT size, unsigned int align) ...@@ -3743,7 +3734,7 @@ output_constant (tree exp, unsigned HOST_WIDE_INT size, unsigned int align)
tree decl = TREE_OPERAND (exp, 0); tree decl = TREE_OPERAND (exp, 0);
ASM_OUTPUT_FDESC (asm_out_file, decl, part); ASM_OUTPUT_FDESC (asm_out_file, decl, part);
#else #else
abort (); gcc_unreachable ();
#endif #endif
return; return;
} }
...@@ -3780,18 +3771,18 @@ output_constant (tree exp, unsigned HOST_WIDE_INT size, unsigned int align) ...@@ -3780,18 +3771,18 @@ output_constant (tree exp, unsigned HOST_WIDE_INT size, unsigned int align)
case ARRAY_TYPE: case ARRAY_TYPE:
case VECTOR_TYPE: case VECTOR_TYPE:
if (TREE_CODE (exp) == CONSTRUCTOR) switch (TREE_CODE (exp))
{ {
case CONSTRUCTOR:
output_constructor (exp, size, align); output_constructor (exp, size, align);
return; return;
} case STRING_CST:
else if (TREE_CODE (exp) == STRING_CST)
{
thissize = MIN ((unsigned HOST_WIDE_INT)TREE_STRING_LENGTH (exp), thissize = MIN ((unsigned HOST_WIDE_INT)TREE_STRING_LENGTH (exp),
size); size);
assemble_string (TREE_STRING_POINTER (exp), thissize); assemble_string (TREE_STRING_POINTER (exp), thissize);
} break;
else if (TREE_CODE (exp) == VECTOR_CST)
case VECTOR_CST:
{ {
int elt_size; int elt_size;
tree link; tree link;
...@@ -3807,24 +3798,24 @@ output_constant (tree exp, unsigned HOST_WIDE_INT size, unsigned int align) ...@@ -3807,24 +3798,24 @@ output_constant (tree exp, unsigned HOST_WIDE_INT size, unsigned int align)
output_constant (TREE_VALUE (link), elt_size, align); output_constant (TREE_VALUE (link), elt_size, align);
while ((link = TREE_CHAIN (link)) != NULL) while ((link = TREE_CHAIN (link)) != NULL)
output_constant (TREE_VALUE (link), elt_size, nalign); output_constant (TREE_VALUE (link), elt_size, nalign);
break;
}
default:
gcc_unreachable ();
} }
else
abort ();
break; break;
case RECORD_TYPE: case RECORD_TYPE:
case UNION_TYPE: case UNION_TYPE:
if (TREE_CODE (exp) == CONSTRUCTOR) gcc_assert (TREE_CODE (exp) == CONSTRUCTOR);
output_constructor (exp, size, align); output_constructor (exp, size, align);
else
abort ();
return; return;
case ERROR_MARK: case ERROR_MARK:
return; return;
default: default:
abort (); gcc_unreachable ();
} }
if (size > thissize) if (size > thissize)
...@@ -3890,8 +3881,7 @@ output_constructor (tree exp, unsigned HOST_WIDE_INT size, ...@@ -3890,8 +3881,7 @@ output_constructor (tree exp, unsigned HOST_WIDE_INT size,
int byte_buffer_in_use = 0; int byte_buffer_in_use = 0;
int byte = 0; int byte = 0;
if (HOST_BITS_PER_WIDE_INT < BITS_PER_UNIT) gcc_assert (HOST_BITS_PER_WIDE_INT >= BITS_PER_UNIT);
abort ();
if (TREE_CODE (type) == RECORD_TYPE) if (TREE_CODE (type) == RECORD_TYPE)
field = TYPE_FIELDS (type); field = TYPE_FIELDS (type);
...@@ -4012,8 +4002,7 @@ output_constructor (tree exp, unsigned HOST_WIDE_INT size, ...@@ -4012,8 +4002,7 @@ output_constructor (tree exp, unsigned HOST_WIDE_INT size,
fieldsize = array_size_for_constructor (val); fieldsize = array_size_for_constructor (val);
/* Given a non-empty initialization, this field had /* Given a non-empty initialization, this field had
better be last. */ better be last. */
if (fieldsize != 0 && TREE_CHAIN (field) != NULL_TREE) gcc_assert (!fieldsize || !TREE_CHAIN (field));
abort ();
} }
else if (DECL_SIZE_UNIT (field)) else if (DECL_SIZE_UNIT (field))
{ {
...@@ -4122,13 +4111,12 @@ output_constructor (tree exp, unsigned HOST_WIDE_INT size, ...@@ -4122,13 +4111,12 @@ output_constructor (tree exp, unsigned HOST_WIDE_INT size,
/* Now get the bits from the appropriate constant word. */ /* Now get the bits from the appropriate constant word. */
if (shift < HOST_BITS_PER_WIDE_INT) if (shift < HOST_BITS_PER_WIDE_INT)
value = TREE_INT_CST_LOW (val); value = TREE_INT_CST_LOW (val);
else if (shift < 2 * HOST_BITS_PER_WIDE_INT) else
{ {
gcc_assert (shift < 2 * HOST_BITS_PER_WIDE_INT);
value = TREE_INT_CST_HIGH (val); value = TREE_INT_CST_HIGH (val);
shift -= HOST_BITS_PER_WIDE_INT; shift -= HOST_BITS_PER_WIDE_INT;
} }
else
abort ();
/* Get the result. This works only when: /* Get the result. This works only when:
1 <= this_time <= HOST_BITS_PER_WIDE_INT. */ 1 <= this_time <= HOST_BITS_PER_WIDE_INT. */
...@@ -4155,13 +4143,12 @@ output_constructor (tree exp, unsigned HOST_WIDE_INT size, ...@@ -4155,13 +4143,12 @@ output_constructor (tree exp, unsigned HOST_WIDE_INT size,
/* Now get the bits from the appropriate constant word. */ /* Now get the bits from the appropriate constant word. */
if (shift < HOST_BITS_PER_WIDE_INT) if (shift < HOST_BITS_PER_WIDE_INT)
value = TREE_INT_CST_LOW (val); value = TREE_INT_CST_LOW (val);
else if (shift < 2 * HOST_BITS_PER_WIDE_INT) else
{ {
gcc_assert (shift < 2 * HOST_BITS_PER_WIDE_INT);
value = TREE_INT_CST_HIGH (val); value = TREE_INT_CST_HIGH (val);
shift -= HOST_BITS_PER_WIDE_INT; shift -= HOST_BITS_PER_WIDE_INT;
} }
else
abort ();
/* Get the result. This works only when: /* Get the result. This works only when:
1 <= this_time <= HOST_BITS_PER_WIDE_INT. */ 1 <= this_time <= HOST_BITS_PER_WIDE_INT. */
...@@ -4556,8 +4543,8 @@ supports_one_only (void) ...@@ -4556,8 +4543,8 @@ supports_one_only (void)
void void
make_decl_one_only (tree decl) make_decl_one_only (tree decl)
{ {
if (TREE_CODE (decl) != VAR_DECL && TREE_CODE (decl) != FUNCTION_DECL) gcc_assert (TREE_CODE (decl) == VAR_DECL
abort (); || TREE_CODE (decl) == FUNCTION_DECL);
TREE_PUBLIC (decl) = 1; TREE_PUBLIC (decl) = 1;
...@@ -4571,10 +4558,11 @@ make_decl_one_only (tree decl) ...@@ -4571,10 +4558,11 @@ make_decl_one_only (tree decl)
else if (TREE_CODE (decl) == VAR_DECL else if (TREE_CODE (decl) == VAR_DECL
&& (DECL_INITIAL (decl) == 0 || DECL_INITIAL (decl) == error_mark_node)) && (DECL_INITIAL (decl) == 0 || DECL_INITIAL (decl) == error_mark_node))
DECL_COMMON (decl) = 1; DECL_COMMON (decl) = 1;
else if (SUPPORTS_WEAK)
DECL_WEAK (decl) = 1;
else else
abort (); {
gcc_assert (SUPPORTS_WEAK);
DECL_WEAK (decl) = 1;
}
} }
void void
...@@ -4598,8 +4586,8 @@ decl_tls_model (tree decl) ...@@ -4598,8 +4586,8 @@ decl_tls_model (tree decl)
if (attr) if (attr)
{ {
attr = TREE_VALUE (TREE_VALUE (attr)); attr = TREE_VALUE (TREE_VALUE (attr));
if (TREE_CODE (attr) != STRING_CST) gcc_assert (TREE_CODE (attr) == STRING_CST);
abort ();
if (!strcmp (TREE_STRING_POINTER (attr), "local-exec")) if (!strcmp (TREE_STRING_POINTER (attr), "local-exec"))
kind = TLS_MODEL_LOCAL_EXEC; kind = TLS_MODEL_LOCAL_EXEC;
else if (!strcmp (TREE_STRING_POINTER (attr), "initial-exec")) else if (!strcmp (TREE_STRING_POINTER (attr), "initial-exec"))
...@@ -4609,7 +4597,7 @@ decl_tls_model (tree decl) ...@@ -4609,7 +4597,7 @@ decl_tls_model (tree decl)
else if (!strcmp (TREE_STRING_POINTER (attr), "global-dynamic")) else if (!strcmp (TREE_STRING_POINTER (attr), "global-dynamic"))
kind = TLS_MODEL_GLOBAL_DYNAMIC; kind = TLS_MODEL_GLOBAL_DYNAMIC;
else else
abort (); gcc_unreachable ();
return kind; return kind;
} }
...@@ -4710,7 +4698,7 @@ default_no_named_section (const char *name ATTRIBUTE_UNUSED, ...@@ -4710,7 +4698,7 @@ default_no_named_section (const char *name ATTRIBUTE_UNUSED,
{ {
/* Some object formats don't support named sections at all. The /* Some object formats don't support named sections at all. The
front-end should already have flagged this as an error. */ front-end should already have flagged this as an error. */
abort (); gcc_unreachable ();
} }
void void
...@@ -5011,7 +4999,7 @@ default_elf_select_section_1 (tree decl, int reloc, ...@@ -5011,7 +4999,7 @@ default_elf_select_section_1 (tree decl, int reloc,
{ {
case SECCAT_TEXT: case SECCAT_TEXT:
/* We're not supposed to be called on FUNCTION_DECLs. */ /* We're not supposed to be called on FUNCTION_DECLs. */
abort (); gcc_unreachable ();
case SECCAT_RODATA: case SECCAT_RODATA:
readonly_data_section (); readonly_data_section ();
return; return;
...@@ -5063,7 +5051,7 @@ default_elf_select_section_1 (tree decl, int reloc, ...@@ -5063,7 +5051,7 @@ default_elf_select_section_1 (tree decl, int reloc,
sname = ".tbss"; sname = ".tbss";
break; break;
default: default:
abort (); gcc_unreachable ();
} }
if (!DECL_P (decl)) if (!DECL_P (decl))
...@@ -5125,7 +5113,7 @@ default_unique_section_1 (tree decl, int reloc, int shlib) ...@@ -5125,7 +5113,7 @@ default_unique_section_1 (tree decl, int reloc, int shlib)
prefix = one_only ? ".gnu.linkonce.tb." : ".tbss."; prefix = one_only ? ".gnu.linkonce.tb." : ".tbss.";
break; break;
default: default:
abort (); gcc_unreachable ();
} }
plen = strlen (prefix); plen = strlen (prefix);
......
...@@ -66,8 +66,7 @@ vec_gc_o_reserve (void *vec, int reserve, size_t vec_offset, size_t elt_size ...@@ -66,8 +66,7 @@ vec_gc_o_reserve (void *vec, int reserve, size_t vec_offset, size_t elt_size
else else
alloc = 4; alloc = 4;
if (pfx && pfx->alloc >= alloc) gcc_assert (!pfx || pfx->alloc < alloc);
abort ();
vec = ggc_realloc_stat (vec, vec_offset + alloc * elt_size PASS_MEM_STAT); vec = ggc_realloc_stat (vec, vec_offset + alloc * elt_size PASS_MEM_STAT);
((struct vec_prefix *)vec)->alloc = alloc; ((struct vec_prefix *)vec)->alloc = alloc;
...@@ -117,8 +116,7 @@ vec_heap_o_reserve (void *vec, int reserve, size_t vec_offset, size_t elt_size ...@@ -117,8 +116,7 @@ vec_heap_o_reserve (void *vec, int reserve, size_t vec_offset, size_t elt_size
else else
alloc = 4; alloc = 4;
if (pfx && pfx->alloc >= alloc) gcc_assert (!pfx || pfx->alloc < alloc);
abort ();
vec = xrealloc (vec, vec_offset + alloc * elt_size); vec = xrealloc (vec, vec_offset + alloc * elt_size);
((struct vec_prefix *)vec)->alloc = alloc; ((struct vec_prefix *)vec)->alloc = alloc;
......
...@@ -427,7 +427,7 @@ addr_const_to_string (char *str, rtx x) ...@@ -427,7 +427,7 @@ addr_const_to_string (char *str, rtx x)
char buf1[256]; char buf1[256];
char buf2[256]; char buf2[256];
restart: restart:
str[0] = '\0'; str[0] = '\0';
switch (GET_CODE (x)) switch (GET_CODE (x))
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment