This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
assertify v*.c files
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 10 Mar 2005 15:38:28 +0000
- Subject: assertify v*.c files
- Organization: Codesourcery LLC
I've installed this patch which uses gcc_assert or gcc_unreachable
on the v*.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
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.
Index: value-prof.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/value-prof.c,v
retrieving revision 1.18
diff -c -3 -p -r1.18 value-prof.c
*** value-prof.c 15 Feb 2005 15:53:47 -0000 1.18
--- value-prof.c 10 Mar 2005 14:52:00 -0000
*************** rtl_find_values_to_profile (histogram_va
*** 360,366 ****
break;
default:
! abort ();
}
}
allocate_reg_info (max_reg_num (), FALSE, FALSE);
--- 360,366 ----
break;
default:
! gcc_unreachable ();
}
}
allocate_reg_info (max_reg_num (), FALSE, FALSE);
*************** void
*** 1032,1052 ****
rtl_register_value_prof_hooks (void)
{
value_prof_hooks = &rtl_value_prof_hooks;
! if (ir_type ())
! abort ();
}
/* Tree-based versions are stubs for now. */
static void
tree_find_values_to_profile (histogram_values *values ATTRIBUTE_UNUSED)
{
! abort ();
}
static bool
tree_value_profile_transformations (void)
{
! abort ();
}
static struct value_prof_hooks tree_value_prof_hooks = {
--- 1032,1051 ----
rtl_register_value_prof_hooks (void)
{
value_prof_hooks = &rtl_value_prof_hooks;
! gcc_assert (!ir_type ());
}
/* Tree-based versions are stubs for now. */
static void
tree_find_values_to_profile (histogram_values *values ATTRIBUTE_UNUSED)
{
! gcc_unreachable ();
}
static bool
tree_value_profile_transformations (void)
{
! gcc_unreachable ();
}
static struct value_prof_hooks tree_value_prof_hooks = {
*************** void
*** 1058,1065 ****
tree_register_value_prof_hooks (void)
{
value_prof_hooks = &tree_value_prof_hooks;
! if (!ir_type ())
! abort ();
}
/* IR-independent entry points. */
--- 1057,1063 ----
tree_register_value_prof_hooks (void)
{
value_prof_hooks = &tree_value_prof_hooks;
! gcc_assert (ir_type ());
}
/* IR-independent entry points. */
Index: var-tracking.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/var-tracking.c,v
retrieving revision 2.26
diff -c -3 -p -r2.26 var-tracking.c
*** var-tracking.c 27 Jan 2005 09:28:43 -0000 2.26
--- var-tracking.c 10 Mar 2005 14:52:04 -0000
*************** stack_adjust_offset_pre_post (rtx patter
*** 387,395 ****
{
rtx val = XEXP (XEXP (src, 1), 1);
/* We handle only adjustments by constant amount. */
! if (GET_CODE (XEXP (src, 1)) != PLUS ||
! GET_CODE (val) != CONST_INT)
! abort ();
if (code == PRE_MODIFY)
*pre -= INTVAL (val);
else
--- 387,395 ----
{
rtx val = XEXP (XEXP (src, 1), 1);
/* We handle only adjustments by constant amount. */
! gcc_assert (GET_CODE (XEXP (src, 1)) == PLUS &&
! GET_CODE (val) == CONST_INT);
!
if (code == PRE_MODIFY)
*pre -= INTVAL (val);
else
*************** variable_htab_free (void *elem)
*** 639,648 ****
variable var = (variable) elem;
location_chain node, next;
! #ifdef ENABLE_CHECKING
! if (var->refcount <= 0)
! abort ();
! #endif
var->refcount--;
if (var->refcount > 0)
--- 639,645 ----
variable var = (variable) elem;
location_chain node, next;
! gcc_assert (var->refcount > 0);
var->refcount--;
if (var->refcount > 0)
*************** variable_union (void **slot, void *data)
*** 1019,1040 ****
a copy of the variable. */
for (k = 0; k < src->n_var_parts; k++)
{
if (src->var_part[k].loc_chain)
{
! #ifdef ENABLE_CHECKING
! if (src->var_part[k].cur_loc == NULL)
! abort ();
! #endif
if (src->var_part[k].cur_loc != src->var_part[k].loc_chain->loc)
break;
}
- #ifdef ENABLE_CHECKING
- else
- {
- if (src->var_part[k].cur_loc != NULL)
- abort ();
- }
- #endif
}
if (k < src->n_var_parts)
unshare_variable (set, src);
--- 1016,1029 ----
a copy of the variable. */
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)
{
! gcc_assert (src->var_part[k].cur_loc);
if (src->var_part[k].cur_loc != src->var_part[k].loc_chain->loc)
break;
}
}
if (k < src->n_var_parts)
unshare_variable (set, src);
*************** variable_union (void **slot, void *data)
*** 1047,1056 ****
else
dst = *dstp;
! #ifdef ENABLE_CHECKING
! if (src->n_var_parts == 0)
! abort ();
! #endif
/* Count the number of location parts, result is K. */
for (i = 0, j = 0, k = 0;
--- 1036,1042 ----
else
dst = *dstp;
! gcc_assert (src->n_var_parts);
/* Count the number of location parts, result is K. */
for (i = 0, j = 0, k = 0;
*************** variable_union (void **slot, void *data)
*** 1068,1079 ****
}
k += src->n_var_parts - i;
k += dst->n_var_parts - j;
! #ifdef ENABLE_CHECKING
/* We track only variables whose size is <= MAX_VAR_PARTS bytes
thus there are at most MAX_VAR_PARTS different offsets. */
! if (k > MAX_VAR_PARTS)
! abort ();
! #endif
if (dst->refcount > 1 && dst->n_var_parts != k)
dst = unshare_variable (set, dst);
--- 1054,1063 ----
}
k += src->n_var_parts - i;
k += dst->n_var_parts - j;
!
/* We track only variables whose size is <= MAX_VAR_PARTS bytes
thus there are at most MAX_VAR_PARTS different offsets. */
! gcc_assert (k <= MAX_VAR_PARTS);
if (dst->refcount > 1 && dst->n_var_parts != k)
dst = unshare_variable (set, dst);
*************** dataflow_set_different_2 (void **slot, v
*** 1356,1367 ****
return 0;
}
- #ifdef ENABLE_CHECKING
/* If both variables are defined they have been already checked for
equivalence. */
! if (variable_different_p (var1, var2, false))
! abort ();
! #endif
/* Continue traversing the hash table. */
return 1;
--- 1340,1348 ----
return 0;
}
/* If both variables are defined they have been already checked for
equivalence. */
! gcc_assert (!variable_different_p (var1, var2, false));
/* Continue traversing the hash table. */
return 1;
*************** count_uses (rtx *loc, void *insn)
*** 1517,1533 ****
if (REG_P (*loc))
{
! #ifdef ENABLE_CHECKING
! if (REGNO (*loc) >= FIRST_PSEUDO_REGISTER)
! abort ();
! #endif
! VTI (bb)->n_mos++;
}
else if (MEM_P (*loc)
&& MEM_EXPR (*loc)
&& track_expr_p (MEM_EXPR (*loc)))
{
! VTI (bb)->n_mos++;
}
return 0;
--- 1498,1511 ----
if (REG_P (*loc))
{
! gcc_assert (REGNO (*loc) < FIRST_PSEUDO_REGISTER);
! VTI (bb)->n_mos++;
}
else if (MEM_P (*loc)
&& MEM_EXPR (*loc)
&& track_expr_p (MEM_EXPR (*loc)))
{
! VTI (bb)->n_mos++;
}
return 0;
*************** variable_was_changed (variable var, htab
*** 1922,1931 ****
}
else
{
! #ifdef ENABLE_CHECKING
! if (!htab)
! abort ();
! #endif
if (var->n_var_parts == 0)
{
void **slot = htab_find_slot_with_hash (htab, var->decl, hash,
--- 1900,1906 ----
}
else
{
! gcc_assert (htab);
if (var->n_var_parts == 0)
{
void **slot = htab_find_slot_with_hash (htab, var->decl, hash,
*************** set_frame_base_location (dataflow_set *s
*** 1947,1962 ****
var = htab_find_with_hash (set->vars, frame_base_decl,
VARIABLE_HASH_VAL (frame_base_decl));
! #ifdef ENABLE_CHECKING
! if (!var)
! abort ();
! if (var->n_var_parts != 1)
! 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 (var->refcount > 1)
--- 1922,1931 ----
var = htab_find_with_hash (set->vars, frame_base_decl,
VARIABLE_HASH_VAL (frame_base_decl));
! gcc_assert (var);
! gcc_assert (var->n_var_parts == 1);
! gcc_assert (!var->var_part[0].offset);
! gcc_assert (var->var_part[0].loc_chain);
/* If frame_base_decl is shared unshare it first. */
if (var->refcount > 1)
*************** set_variable_part (dataflow_set *set, rt
*** 2040,2051 ****
if (var->refcount > 1)
var = unshare_variable (set, var);
- #ifdef ENABLE_CHECKING
/* We track only variables whose size is <= MAX_VAR_PARTS bytes
thus there are at most MAX_VAR_PARTS different offsets. */
! if (var->n_var_parts >= MAX_VAR_PARTS)
! abort ();
! #endif
/* We have to move the elements of array starting at index low to the
next position. */
--- 2009,2017 ----
if (var->refcount > 1)
var = unshare_variable (set, var);
/* We track only variables whose size is <= MAX_VAR_PARTS bytes
thus there are at most MAX_VAR_PARTS different offsets. */
! gcc_assert (var->n_var_parts < MAX_VAR_PARTS);
/* We have to move the elements of array starting at index low to the
next position. */
*************** emit_note_insn_var_location (void **varp
*** 2207,2216 ****
HOST_WIDE_INT last_limit;
tree type_size_unit;
! #ifdef ENABLE_CHECKING
! if (!var->decl)
! abort ();
! #endif
complete = true;
last_limit = 0;
--- 2173,2179 ----
HOST_WIDE_INT last_limit;
tree type_size_unit;
! gcc_assert (var->decl);
complete = true;
last_limit = 0;
*************** vt_emit_notes (void)
*** 2447,2456 ****
dataflow_set *last_out;
dataflow_set empty;
! #ifdef ENABLE_CHECKING
! if (htab_elements (changed_variables))
! abort ();
! #endif
/* Enable emitting notes by functions (mainly by set_variable_part and
delete_variable_part). */
--- 2410,2416 ----
dataflow_set *last_out;
dataflow_set empty;
! gcc_assert (!htab_elements (changed_variables));
/* Enable emitting notes by functions (mainly by set_variable_part and
delete_variable_part). */
*************** vt_add_function_parameters (void)
*** 2536,2555 ****
if (!decl)
continue;
! #ifdef ENABLE_CHECKING
! if (parm != decl)
! abort ();
! #endif
incoming = eliminate_regs (incoming, 0, NULL_RTX);
out = &VTI (ENTRY_BLOCK_PTR)->out;
if (REG_P (incoming))
{
! #ifdef ENABLE_CHECKING
! if (REGNO (incoming) >= FIRST_PSEUDO_REGISTER)
! abort ();
! #endif
attrs_list_insert (&out->regs[REGNO (incoming)],
parm, offset, incoming);
set_variable_part (out, incoming, parm, offset);
--- 2496,2509 ----
if (!decl)
continue;
! gcc_assert (parm == decl);
incoming = eliminate_regs (incoming, 0, NULL_RTX);
out = &VTI (ENTRY_BLOCK_PTR)->out;
if (REG_P (incoming))
{
! gcc_assert (REGNO (incoming) < FIRST_PSEUDO_REGISTER);
attrs_list_insert (&out->regs[REGNO (incoming)],
parm, offset, incoming);
set_variable_part (out, incoming, parm, offset);
Index: varasm.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/varasm.c,v
retrieving revision 1.479
diff -c -3 -p -r1.479 varasm.c
*** varasm.c 2 Mar 2005 21:33:44 -0000 1.479
--- varasm.c 10 Mar 2005 14:52:14 -0000
*************** named_section_real (const char *name, un
*** 423,430 ****
{
if (in_section != in_named || strcmp (name, in_named_name) != 0)
{
! if (! set_named_section_flags (name, flags))
! abort ();
targetm.asm_out.named_section (name, flags, decl);
--- 423,431 ----
{
if (in_section != in_named || strcmp (name, in_named_name) != 0)
{
! bool unchanged = set_named_section_flags (name, flags);
!
! gcc_assert (unchanged);
targetm.asm_out.named_section (name, flags, decl);
*************** named_section (tree decl, const char *na
*** 448,455 ****
{
unsigned int flags;
! if (decl != NULL_TREE && !DECL_P (decl))
! abort ();
if (name == NULL)
name = TREE_STRING_POINTER (DECL_SECTION_NAME (decl));
--- 449,455 ----
{
unsigned int flags;
! gcc_assert (!decl || DECL_P (decl));
if (name == NULL)
name = TREE_STRING_POINTER (DECL_SECTION_NAME (decl));
*************** make_decl_rtl (tree decl)
*** 852,870 ****
rtx x;
/* Check that we are not being given an automatic variable. */
/* A weak alias has TREE_PUBLIC set but not the other bits. */
! if (TREE_CODE (decl) == PARM_DECL
! || TREE_CODE (decl) == RESULT_DECL
! || (TREE_CODE (decl) == VAR_DECL
! && !TREE_STATIC (decl)
! && !TREE_PUBLIC (decl)
! && !DECL_EXTERNAL (decl)
! && !DECL_REGISTER (decl)))
! abort ();
/* And that we were not given a type or a label. */
! else if (TREE_CODE (decl) == TYPE_DECL
! || TREE_CODE (decl) == LABEL_DECL)
! abort ();
/* For a duplicate declaration, we can be called twice on the
same DECL node. Don't discard the RTL already made. */
--- 852,870 ----
rtx x;
/* 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. */
! gcc_assert (TREE_CODE (decl) != VAR_DECL
! || TREE_STATIC (decl)
! || TREE_PUBLIC (decl)
! || DECL_EXTERNAL (decl)
! || DECL_REGISTER (decl));
!
/* And that we were not given a type or a label. */
! gcc_assert (TREE_CODE (decl) != TYPE_DECL
! && TREE_CODE (decl) != LABEL_DECL);
/* For a duplicate declaration, we can be called twice on the
same DECL node. Don't discard the RTL already made. */
*************** make_decl_rtl (tree decl)
*** 1003,1010 ****
void
make_var_volatile (tree var)
{
! if (!MEM_P (DECL_RTL (var)))
! abort ();
MEM_VOLATILE_P (DECL_RTL (var)) = 1;
}
--- 1003,1009 ----
void
make_var_volatile (tree var)
{
! gcc_assert (MEM_P (DECL_RTL (var)));
MEM_VOLATILE_P (DECL_RTL (var)) = 1;
}
*************** asm_emit_uninitialised (tree decl, const
*** 1487,1493 ****
ASM_EMIT_LOCAL (decl, name, size, rounded);
break;
default:
! abort ();
}
return true;
--- 1486,1492 ----
ASM_EMIT_LOCAL (decl, name, size, rounded);
break;
default:
! gcc_unreachable ();
}
return true;
*************** assemble_integer (rtx x, unsigned int si
*** 2122,2134 ****
/* If we've printed some of it, but not all of it, there's no going
back now. */
! if (i > 0)
! abort ();
}
! if (force)
! abort ();
!
return false;
}
--- 2121,2131 ----
/* If we've printed some of it, but not all of it, there's no going
back now. */
! gcc_assert (!i);
}
! gcc_assert (!force);
!
return false;
}
*************** decode_addr_const (tree exp, struct addr
*** 2231,2241 ****
break;
default:
! abort ();
}
! if (!MEM_P (x))
! abort ();
x = XEXP (x, 0);
value->base = x;
--- 2228,2237 ----
break;
default:
! gcc_unreachable ();
}
! gcc_assert (MEM_P (x));
x = XEXP (x, 0);
value->base = x;
*************** const_hash_1 (const tree exp)
*** 2318,2336 ****
struct addr_const value;
decode_addr_const (exp, &value);
! if (GET_CODE (value.base) == SYMBOL_REF)
{
/* Don't hash the address of the SYMBOL_REF;
only use the offset and the symbol name. */
hi = value.offset;
p = XSTR (value.base, 0);
for (i = 0; p[i] != 0; i++)
hi = ((hi * 613) + (unsigned) (p[i]));
}
- else if (GET_CODE (value.base) == LABEL_REF)
- hi = value.offset + CODE_LABEL_NUMBER (XEXP (value.base, 0)) * 13;
- else
- abort ();
}
return hi;
--- 2314,2337 ----
struct addr_const value;
decode_addr_const (exp, &value);
! switch (GET_CODE (value.base))
{
+ case SYMBOL_REF:
/* Don't hash the address of the SYMBOL_REF;
only use the offset and the symbol name. */
hi = value.offset;
p = XSTR (value.base, 0);
for (i = 0; p[i] != 0; i++)
hi = ((hi * 613) + (unsigned) (p[i]));
+ break;
+
+ case LABEL_REF:
+ hi = value.offset + CODE_LABEL_NUMBER (XEXP (value.base, 0)) * 13;
+ break;
+
+ default:
+ gcc_unreachable ();
}
}
return hi;
*************** compare_constant (const tree t1, const t
*** 2492,2499 ****
}
}
! /* Should not get here. */
! abort ();
}
/* Make a copy of the whole tree structure for a constant. This
--- 2493,2499 ----
}
}
! gcc_unreachable ();
}
/* Make a copy of the whole tree structure for a constant. This
*************** copy_constant (tree exp)
*** 2551,2562 ****
default:
{
! tree t;
! t = lang_hooks.expand_constant (exp);
! if (t != exp)
! return copy_constant (t);
! else
! abort ();
}
}
}
--- 2551,2560 ----
default:
{
! tree t = lang_hooks.expand_constant (exp);
!
! gcc_assert (t == exp);
! return copy_constant (t);
}
}
}
*************** force_const_mem (enum machine_mode mode,
*** 3018,3025 ****
/* Insert the descriptor into the symbol cross-reference table too. */
slot = htab_find_slot (pool->const_rtx_sym_htab, desc, INSERT);
! if (*slot)
! abort ();
*slot = desc;
/* Construct the MEM. */
--- 3016,3022 ----
/* Insert the descriptor into the symbol cross-reference table too. */
slot = htab_find_slot (pool->const_rtx_sym_htab, desc, INSERT);
! gcc_assert (!*slot);
*slot = desc;
/* Construct the MEM. */
*************** output_constant_pool_2 (enum machine_mod
*** 3100,3115 ****
switch (GET_MODE_CLASS (mode))
{
case MODE_FLOAT:
! if (GET_CODE (x) != CONST_DOUBLE)
! abort ();
! else
! {
! REAL_VALUE_TYPE r;
! REAL_VALUE_FROM_CONST_DOUBLE (r, x);
! assemble_real (r, mode, align);
! }
! break;
!
case MODE_INT:
case MODE_PARTIAL_INT:
assemble_integer (x, GET_MODE_SIZE (mode), align, 1);
--- 3097,3111 ----
switch (GET_MODE_CLASS (mode))
{
case MODE_FLOAT:
! {
! REAL_VALUE_TYPE r;
!
! gcc_assert (GET_CODE (x) == CONST_DOUBLE);
! REAL_VALUE_FROM_CONST_DOUBLE (r, x);
! assemble_real (r, mode, align);
! break;
! }
!
case MODE_INT:
case MODE_PARTIAL_INT:
assemble_integer (x, GET_MODE_SIZE (mode), align, 1);
*************** output_constant_pool_2 (enum machine_mod
*** 3122,3129 ****
enum machine_mode submode = GET_MODE_INNER (mode);
unsigned int subalign = MIN (align, GET_MODE_BITSIZE (submode));
! if (GET_CODE (x) != CONST_VECTOR)
! abort ();
units = CONST_VECTOR_NUNITS (x);
for (i = 0; i < units; i++)
--- 3118,3124 ----
enum machine_mode submode = GET_MODE_INNER (mode);
unsigned int subalign = MIN (align, GET_MODE_BITSIZE (submode));
! gcc_assert (GET_CODE (x) == CONST_VECTOR);
units = CONST_VECTOR_NUNITS (x);
for (i = 0; i < units; i++)
*************** output_constant_pool_2 (enum machine_mod
*** 3135,3141 ****
break;
default:
! abort ();
}
}
--- 3130,3136 ----
break;
default:
! gcc_unreachable ();
}
}
*************** output_constant_pool_1 (struct constant_
*** 3171,3183 ****
case LABEL_REF:
tmp = XEXP (x, 0);
! if (INSN_DELETED_P (tmp)
! || (NOTE_P (tmp)
! && NOTE_LINE_NUMBER (tmp) == NOTE_INSN_DELETED))
! {
! abort ();
! x = const0_rtx;
! }
break;
default:
--- 3166,3174 ----
case LABEL_REF:
tmp = XEXP (x, 0);
! gcc_assert (!INSN_DELETED_P (tmp));
! gcc_assert (!NOTE_P (tmp)
! || NOTE_LINE_NUMBER (tmp) != NOTE_INSN_DELETED);
break;
default:
*************** output_constant (tree exp, unsigned HOST
*** 3743,3749 ****
tree decl = TREE_OPERAND (exp, 0);
ASM_OUTPUT_FDESC (asm_out_file, decl, part);
#else
! abort ();
#endif
return;
}
--- 3734,3740 ----
tree decl = TREE_OPERAND (exp, 0);
ASM_OUTPUT_FDESC (asm_out_file, decl, part);
#else
! gcc_unreachable ();
#endif
return;
}
*************** output_constant (tree exp, unsigned HOST
*** 3780,3830 ****
case ARRAY_TYPE:
case VECTOR_TYPE:
! if (TREE_CODE (exp) == CONSTRUCTOR)
{
output_constructor (exp, size, align);
return;
! }
! else if (TREE_CODE (exp) == STRING_CST)
! {
thissize = MIN ((unsigned HOST_WIDE_INT)TREE_STRING_LENGTH (exp),
size);
assemble_string (TREE_STRING_POINTER (exp), thissize);
}
- else if (TREE_CODE (exp) == VECTOR_CST)
- {
- int elt_size;
- tree link;
- unsigned int nalign;
- enum machine_mode inner;
-
- inner = TYPE_MODE (TREE_TYPE (TREE_TYPE (exp)));
- nalign = MIN (align, GET_MODE_ALIGNMENT (inner));
-
- elt_size = GET_MODE_SIZE (inner);
-
- link = TREE_VECTOR_CST_ELTS (exp);
- output_constant (TREE_VALUE (link), elt_size, align);
- while ((link = TREE_CHAIN (link)) != NULL)
- output_constant (TREE_VALUE (link), elt_size, nalign);
- }
- else
- abort ();
break;
case RECORD_TYPE:
case UNION_TYPE:
! if (TREE_CODE (exp) == CONSTRUCTOR)
! output_constructor (exp, size, align);
! else
! abort ();
return;
case ERROR_MARK:
return;
default:
! abort ();
}
if (size > thissize)
--- 3771,3821 ----
case ARRAY_TYPE:
case VECTOR_TYPE:
! switch (TREE_CODE (exp))
{
+ case CONSTRUCTOR:
output_constructor (exp, size, align);
return;
! case STRING_CST:
thissize = MIN ((unsigned HOST_WIDE_INT)TREE_STRING_LENGTH (exp),
size);
assemble_string (TREE_STRING_POINTER (exp), thissize);
+ break;
+
+ case VECTOR_CST:
+ {
+ int elt_size;
+ tree link;
+ unsigned int nalign;
+ enum machine_mode inner;
+
+ inner = TYPE_MODE (TREE_TYPE (TREE_TYPE (exp)));
+ nalign = MIN (align, GET_MODE_ALIGNMENT (inner));
+
+ elt_size = GET_MODE_SIZE (inner);
+
+ link = TREE_VECTOR_CST_ELTS (exp);
+ output_constant (TREE_VALUE (link), elt_size, align);
+ while ((link = TREE_CHAIN (link)) != NULL)
+ output_constant (TREE_VALUE (link), elt_size, nalign);
+ break;
+ }
+ default:
+ gcc_unreachable ();
}
break;
case RECORD_TYPE:
case UNION_TYPE:
! gcc_assert (TREE_CODE (exp) == CONSTRUCTOR);
! output_constructor (exp, size, align);
return;
case ERROR_MARK:
return;
default:
! gcc_unreachable ();
}
if (size > thissize)
*************** output_constructor (tree exp, unsigned H
*** 3890,3897 ****
int byte_buffer_in_use = 0;
int byte = 0;
! if (HOST_BITS_PER_WIDE_INT < BITS_PER_UNIT)
! abort ();
if (TREE_CODE (type) == RECORD_TYPE)
field = TYPE_FIELDS (type);
--- 3881,3887 ----
int byte_buffer_in_use = 0;
int byte = 0;
! gcc_assert (HOST_BITS_PER_WIDE_INT >= BITS_PER_UNIT);
if (TREE_CODE (type) == RECORD_TYPE)
field = TYPE_FIELDS (type);
*************** output_constructor (tree exp, unsigned H
*** 4012,4019 ****
fieldsize = array_size_for_constructor (val);
/* Given a non-empty initialization, this field had
better be last. */
! if (fieldsize != 0 && TREE_CHAIN (field) != NULL_TREE)
! abort ();
}
else if (DECL_SIZE_UNIT (field))
{
--- 4002,4008 ----
fieldsize = array_size_for_constructor (val);
/* Given a non-empty initialization, this field had
better be last. */
! gcc_assert (!fieldsize || !TREE_CHAIN (field));
}
else if (DECL_SIZE_UNIT (field))
{
*************** output_constructor (tree exp, unsigned H
*** 4122,4134 ****
/* Now get the bits from the appropriate constant word. */
if (shift < HOST_BITS_PER_WIDE_INT)
value = TREE_INT_CST_LOW (val);
! else if (shift < 2 * HOST_BITS_PER_WIDE_INT)
{
value = TREE_INT_CST_HIGH (val);
shift -= HOST_BITS_PER_WIDE_INT;
}
- else
- abort ();
/* Get the result. This works only when:
1 <= this_time <= HOST_BITS_PER_WIDE_INT. */
--- 4111,4122 ----
/* Now get the bits from the appropriate constant word. */
if (shift < HOST_BITS_PER_WIDE_INT)
value = TREE_INT_CST_LOW (val);
! else
{
+ gcc_assert (shift < 2 * HOST_BITS_PER_WIDE_INT);
value = TREE_INT_CST_HIGH (val);
shift -= HOST_BITS_PER_WIDE_INT;
}
/* Get the result. This works only when:
1 <= this_time <= HOST_BITS_PER_WIDE_INT. */
*************** output_constructor (tree exp, unsigned H
*** 4155,4167 ****
/* Now get the bits from the appropriate constant word. */
if (shift < HOST_BITS_PER_WIDE_INT)
value = TREE_INT_CST_LOW (val);
! else if (shift < 2 * HOST_BITS_PER_WIDE_INT)
{
value = TREE_INT_CST_HIGH (val);
shift -= HOST_BITS_PER_WIDE_INT;
}
- else
- abort ();
/* Get the result. This works only when:
1 <= this_time <= HOST_BITS_PER_WIDE_INT. */
--- 4143,4154 ----
/* Now get the bits from the appropriate constant word. */
if (shift < HOST_BITS_PER_WIDE_INT)
value = TREE_INT_CST_LOW (val);
! else
{
+ gcc_assert (shift < 2 * HOST_BITS_PER_WIDE_INT);
value = TREE_INT_CST_HIGH (val);
shift -= HOST_BITS_PER_WIDE_INT;
}
/* Get the result. This works only when:
1 <= this_time <= HOST_BITS_PER_WIDE_INT. */
*************** supports_one_only (void)
*** 4556,4563 ****
void
make_decl_one_only (tree decl)
{
! if (TREE_CODE (decl) != VAR_DECL && TREE_CODE (decl) != FUNCTION_DECL)
! abort ();
TREE_PUBLIC (decl) = 1;
--- 4543,4550 ----
void
make_decl_one_only (tree decl)
{
! gcc_assert (TREE_CODE (decl) == VAR_DECL
! || TREE_CODE (decl) == FUNCTION_DECL);
TREE_PUBLIC (decl) = 1;
*************** make_decl_one_only (tree decl)
*** 4571,4580 ****
else if (TREE_CODE (decl) == VAR_DECL
&& (DECL_INITIAL (decl) == 0 || DECL_INITIAL (decl) == error_mark_node))
DECL_COMMON (decl) = 1;
- else if (SUPPORTS_WEAK)
- DECL_WEAK (decl) = 1;
else
! abort ();
}
void
--- 4558,4568 ----
else if (TREE_CODE (decl) == VAR_DECL
&& (DECL_INITIAL (decl) == 0 || DECL_INITIAL (decl) == error_mark_node))
DECL_COMMON (decl) = 1;
else
! {
! gcc_assert (SUPPORTS_WEAK);
! DECL_WEAK (decl) = 1;
! }
}
void
*************** decl_tls_model (tree decl)
*** 4598,4605 ****
if (attr)
{
attr = TREE_VALUE (TREE_VALUE (attr));
! if (TREE_CODE (attr) != STRING_CST)
! abort ();
if (!strcmp (TREE_STRING_POINTER (attr), "local-exec"))
kind = TLS_MODEL_LOCAL_EXEC;
else if (!strcmp (TREE_STRING_POINTER (attr), "initial-exec"))
--- 4586,4593 ----
if (attr)
{
attr = TREE_VALUE (TREE_VALUE (attr));
! gcc_assert (TREE_CODE (attr) == STRING_CST);
!
if (!strcmp (TREE_STRING_POINTER (attr), "local-exec"))
kind = TLS_MODEL_LOCAL_EXEC;
else if (!strcmp (TREE_STRING_POINTER (attr), "initial-exec"))
*************** decl_tls_model (tree decl)
*** 4609,4615 ****
else if (!strcmp (TREE_STRING_POINTER (attr), "global-dynamic"))
kind = TLS_MODEL_GLOBAL_DYNAMIC;
else
! abort ();
return kind;
}
--- 4597,4603 ----
else if (!strcmp (TREE_STRING_POINTER (attr), "global-dynamic"))
kind = TLS_MODEL_GLOBAL_DYNAMIC;
else
! gcc_unreachable ();
return kind;
}
*************** default_no_named_section (const char *na
*** 4710,4716 ****
{
/* Some object formats don't support named sections at all. The
front-end should already have flagged this as an error. */
! abort ();
}
void
--- 4698,4704 ----
{
/* Some object formats don't support named sections at all. The
front-end should already have flagged this as an error. */
! gcc_unreachable ();
}
void
*************** default_elf_select_section_1 (tree decl,
*** 5011,5017 ****
{
case SECCAT_TEXT:
/* We're not supposed to be called on FUNCTION_DECLs. */
! abort ();
case SECCAT_RODATA:
readonly_data_section ();
return;
--- 4999,5005 ----
{
case SECCAT_TEXT:
/* We're not supposed to be called on FUNCTION_DECLs. */
! gcc_unreachable ();
case SECCAT_RODATA:
readonly_data_section ();
return;
*************** default_elf_select_section_1 (tree decl,
*** 5063,5069 ****
sname = ".tbss";
break;
default:
! abort ();
}
if (!DECL_P (decl))
--- 5051,5057 ----
sname = ".tbss";
break;
default:
! gcc_unreachable ();
}
if (!DECL_P (decl))
*************** default_unique_section_1 (tree decl, int
*** 5125,5131 ****
prefix = one_only ? ".gnu.linkonce.tb." : ".tbss.";
break;
default:
! abort ();
}
plen = strlen (prefix);
--- 5113,5119 ----
prefix = one_only ? ".gnu.linkonce.tb." : ".tbss.";
break;
default:
! gcc_unreachable ();
}
plen = strlen (prefix);
Index: vec.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/vec.c,v
retrieving revision 2.8
diff -c -3 -p -r2.8 vec.c
*** vec.c 8 Sep 2004 08:08:55 -0000 2.8
--- vec.c 10 Mar 2005 14:52:14 -0000
*************** vec_gc_o_reserve (void *vec, int reserve
*** 66,73 ****
else
alloc = 4;
! if (pfx && pfx->alloc >= alloc)
! abort ();
vec = ggc_realloc_stat (vec, vec_offset + alloc * elt_size PASS_MEM_STAT);
((struct vec_prefix *)vec)->alloc = alloc;
--- 66,72 ----
else
alloc = 4;
! gcc_assert (!pfx || pfx->alloc < alloc);
vec = ggc_realloc_stat (vec, vec_offset + alloc * elt_size PASS_MEM_STAT);
((struct vec_prefix *)vec)->alloc = alloc;
*************** vec_heap_o_reserve (void *vec, int reser
*** 117,124 ****
else
alloc = 4;
! if (pfx && pfx->alloc >= alloc)
! abort ();
vec = xrealloc (vec, vec_offset + alloc * elt_size);
((struct vec_prefix *)vec)->alloc = alloc;
--- 116,122 ----
else
alloc = 4;
! gcc_assert (!pfx || pfx->alloc < alloc);
vec = xrealloc (vec, vec_offset + alloc * elt_size);
((struct vec_prefix *)vec)->alloc = alloc;
Index: vmsdbgout.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/vmsdbgout.c,v
retrieving revision 1.36
diff -c -3 -p -r1.36 vmsdbgout.c
*** vmsdbgout.c 3 Jun 2004 18:48:26 -0000 1.36
--- vmsdbgout.c 10 Mar 2005 14:52:18 -0000
*************** restart:
*** 432,441 ****
switch (GET_CODE (x))
{
case PC:
! if (flag_pic)
! strcat (str, ",");
! else
! abort ();
break;
case SYMBOL_REF:
--- 432,439 ----
switch (GET_CODE (x))
{
case PC:
! gcc_assert (flag_pic);
! strcat (str, ",");
break;
case SYMBOL_REF: