}
#ifdef DWARF_ALT_FRAME_RETURN_COLUMN
- if (! wrote_return_column)
- abort ();
+ gcc_assert (wrote_return_column);
i = DWARF_ALT_FRAME_RETURN_COLUMN;
wrote_return_column = false;
#else
description. */
HOST_WIDE_INT check_offset = offset / DWARF_CIE_DATA_ALIGNMENT;
- if (check_offset * DWARF_CIE_DATA_ALIGNMENT != offset)
- abort ();
+ gcc_assert (check_offset * DWARF_CIE_DATA_ALIGNMENT == offset);
}
#endif
offset /= DWARF_CIE_DATA_ALIGNMENT;
switch (GET_CODE (rtl))
{
case REG:
- if (REGNO (rtl) != STACK_POINTER_REGNUM)
- abort ();
+ gcc_assert (REGNO (rtl) == STACK_POINTER_REGNUM);
offset = 0;
break;
case PLUS:
- if (REGNO (XEXP (rtl, 0)) != STACK_POINTER_REGNUM)
- abort ();
+ gcc_assert (REGNO (XEXP (rtl, 0)) == STACK_POINTER_REGNUM);
offset = INTVAL (XEXP (rtl, 1));
break;
case MINUS:
- if (REGNO (XEXP (rtl, 0)) != STACK_POINTER_REGNUM)
- abort ();
+ gcc_assert (REGNO (XEXP (rtl, 0)) == STACK_POINTER_REGNUM);
offset = -INTVAL (XEXP (rtl, 1));
break;
default:
- abort ();
+ gcc_unreachable ();
}
break;
/* The return address is at some offset from any value we can
actually load. For instance, on the SPARC it is in %i7+8. Just
ignore the offset for now; it doesn't matter for unwinding frames. */
- if (GET_CODE (XEXP (rtl, 1)) != CONST_INT)
- abort ();
+ gcc_assert (GET_CODE (XEXP (rtl, 1)) == CONST_INT);
initial_return_save (XEXP (rtl, 0));
return;
default:
- abort ();
+ gcc_unreachable ();
}
if (reg != DWARF_FRAME_RETURN_COLUMN)
{
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 ();
+ gcc_assert (GET_CODE (XEXP (src, 1)) == PLUS
+ && GET_CODE (val) == CONST_INT);
offset = -INTVAL (val);
break;
}
insn = XVECEXP (insn, 0, 0);
if (GET_CODE (insn) == SET)
insn = SET_SRC (insn);
- if (GET_CODE (insn) != CALL)
- abort ();
+ gcc_assert (GET_CODE (insn) == CALL);
dwarf2out_args_size ("", INTVAL (XEXP (insn, 1)));
return;
break;
if (q->saved_reg && i == num_regs_saved_in_regs)
{
- if (i == ARRAY_SIZE (regs_saved_in_regs))
- abort ();
+ gcc_assert (i != ARRAY_SIZE (regs_saved_in_regs));
num_regs_saved_in_regs++;
}
if (i != num_regs_saved_in_regs)
return;
}
- if (GET_CODE (expr) != SET)
- abort ();
+ gcc_assert (GET_CODE (expr) == SET);
src = SET_SRC (expr);
dest = SET_DEST (expr);
cfa_temp.reg = cfa.reg;
cfa_temp.offset = cfa.offset;
}
- else if (call_used_regs [REGNO (dest)]
- && ! fixed_regs [REGNO (dest)])
+ else
{
/* Saving a register in a register. */
+ gcc_assert (call_used_regs [REGNO (dest)]
+ && !fixed_regs [REGNO (dest)]);
queue_reg_save (label, src, dest, 0);
}
- else
- abort ();
break;
case PLUS:
offset = INTVAL (XEXP (src, 1));
break;
case REG:
- if ((unsigned) REGNO (XEXP (src, 1)) != cfa_temp.reg)
- abort ();
+ gcc_assert ((unsigned) REGNO (XEXP (src, 1))
+ == cfa_temp.reg);
offset = cfa_temp.offset;
break;
default:
- abort ();
+ gcc_unreachable ();
}
if (XEXP (src, 0) == hard_frame_pointer_rtx)
{
/* Restoring SP from FP in the epilogue. */
- if (cfa.reg != (unsigned) HARD_FRAME_POINTER_REGNUM)
- abort ();
+ gcc_assert (cfa.reg == (unsigned) HARD_FRAME_POINTER_REGNUM);
cfa.reg = STACK_POINTER_REGNUM;
}
else if (GET_CODE (src) == LO_SUM)
/* Assume we've set the source reg of the LO_SUM from sp. */
;
- else if (XEXP (src, 0) != stack_pointer_rtx)
- abort ();
+ else
+ gcc_assert (XEXP (src, 0) == stack_pointer_rtx);
if (GET_CODE (src) != MINUS)
offset = -offset;
/* Rule 3 */
/* Either setting the FP from an offset of the SP,
or adjusting the FP */
- if (! frame_pointer_needed)
- abort ();
+ gcc_assert (frame_pointer_needed);
- if (REG_P (XEXP (src, 0))
- && (unsigned) REGNO (XEXP (src, 0)) == cfa.reg
- && GET_CODE (XEXP (src, 1)) == CONST_INT)
- {
- offset = INTVAL (XEXP (src, 1));
- if (GET_CODE (src) != MINUS)
- offset = -offset;
- cfa.offset += offset;
- cfa.reg = HARD_FRAME_POINTER_REGNUM;
- }
- else
- abort ();
+ gcc_assert (REG_P (XEXP (src, 0))
+ && (unsigned) REGNO (XEXP (src, 0)) == cfa.reg
+ && GET_CODE (XEXP (src, 1)) == CONST_INT);
+ offset = INTVAL (XEXP (src, 1));
+ if (GET_CODE (src) != MINUS)
+ offset = -offset;
+ cfa.offset += offset;
+ cfa.reg = HARD_FRAME_POINTER_REGNUM;
}
else
{
- if (GET_CODE (src) == MINUS)
- abort ();
+ gcc_assert (GET_CODE (src) != MINUS);
/* Rule 4 */
if (REG_P (XEXP (src, 0))
{
/* Setting a scratch register that we will use instead
of SP for saving registers to the stack. */
- if (cfa.reg != STACK_POINTER_REGNUM)
- abort ();
+ gcc_assert (cfa.reg == STACK_POINTER_REGNUM);
cfa_store.reg = REGNO (dest);
cfa_store.offset = cfa.offset - cfa_temp.offset;
}
cfa_temp.offset = INTVAL (XEXP (src, 1));
}
else
- abort ();
+ gcc_unreachable ();
}
break;
/* Rule 7 */
case IOR:
- if (!REG_P (XEXP (src, 0))
- || (unsigned) REGNO (XEXP (src, 0)) != cfa_temp.reg
- || GET_CODE (XEXP (src, 1)) != CONST_INT)
- abort ();
+ gcc_assert (REG_P (XEXP (src, 0))
+ && (unsigned) REGNO (XEXP (src, 0)) == cfa_temp.reg
+ && GET_CODE (XEXP (src, 1)) == CONST_INT);
if ((unsigned) REGNO (dest) != cfa_temp.reg)
cfa_temp.reg = REGNO (dest);
break;
default:
- abort ();
+ gcc_unreachable ();
}
def_cfa_1 (label, &cfa);
break;
case MEM:
- if (!REG_P (src))
- abort ();
+ gcc_assert (REG_P (src));
/* Saving a register to the stack. Make sure dest is relative to the
CFA register. */
/* With a push. */
case PRE_MODIFY:
/* We can't handle variable size modifications. */
- if (GET_CODE (XEXP (XEXP (XEXP (dest, 0), 1), 1)) != CONST_INT)
- abort ();
+ gcc_assert (GET_CODE (XEXP (XEXP (XEXP (dest, 0), 1), 1))
+ == CONST_INT);
offset = -INTVAL (XEXP (XEXP (XEXP (dest, 0), 1), 1));
- if (REGNO (XEXP (XEXP (dest, 0), 0)) != STACK_POINTER_REGNUM
- || cfa_store.reg != STACK_POINTER_REGNUM)
- abort ();
+ gcc_assert (REGNO (XEXP (XEXP (dest, 0), 0)) == STACK_POINTER_REGNUM
+ && cfa_store.reg == STACK_POINTER_REGNUM);
cfa_store.offset += offset;
if (cfa.reg == STACK_POINTER_REGNUM)
if (GET_CODE (XEXP (dest, 0)) == PRE_INC)
offset = -offset;
- if (REGNO (XEXP (XEXP (dest, 0), 0)) != STACK_POINTER_REGNUM
- || cfa_store.reg != STACK_POINTER_REGNUM)
- abort ();
+ gcc_assert (REGNO (XEXP (XEXP (dest, 0), 0)) == STACK_POINTER_REGNUM
+ && cfa_store.reg == STACK_POINTER_REGNUM);
cfa_store.offset += offset;
if (cfa.reg == STACK_POINTER_REGNUM)
case PLUS:
case MINUS:
case LO_SUM:
- if (GET_CODE (XEXP (XEXP (dest, 0), 1)) != CONST_INT)
- abort ();
- offset = INTVAL (XEXP (XEXP (dest, 0), 1));
- if (GET_CODE (XEXP (dest, 0)) == MINUS)
- offset = -offset;
-
- if (cfa_store.reg == (unsigned) REGNO (XEXP (XEXP (dest, 0), 0)))
- offset -= cfa_store.offset;
- else if (cfa_temp.reg == (unsigned) REGNO (XEXP (XEXP (dest, 0), 0)))
- offset -= cfa_temp.offset;
- else
- abort ();
+ {
+ int regno;
+
+ gcc_assert (GET_CODE (XEXP (XEXP (dest, 0), 1)) == CONST_INT);
+ offset = INTVAL (XEXP (XEXP (dest, 0), 1));
+ if (GET_CODE (XEXP (dest, 0)) == MINUS)
+ offset = -offset;
+
+ regno = REGNO (XEXP (XEXP (dest, 0), 0));
+
+ if (cfa_store.reg == (unsigned) regno)
+ offset -= cfa_store.offset;
+ else
+ {
+ gcc_assert (cfa_temp.reg == (unsigned) regno);
+ offset -= cfa_temp.offset;
+ }
+ }
break;
/* Rule 13 */
/* Without an offset. */
case REG:
- if (cfa_store.reg == (unsigned) REGNO (XEXP (dest, 0)))
- offset = -cfa_store.offset;
- else if (cfa_temp.reg == (unsigned) REGNO (XEXP (dest, 0)))
- offset = -cfa_temp.offset;
- else
- abort ();
+ {
+ int regno = REGNO (XEXP (dest, 0));
+
+ if (cfa_store.reg == (unsigned) regno)
+ offset = -cfa_store.offset;
+ else
+ {
+ gcc_assert (cfa_temp.reg == (unsigned) regno);
+ offset = -cfa_temp.offset;
+ }
+ }
break;
/* Rule 14 */
case POST_INC:
- if (cfa_temp.reg != (unsigned) REGNO (XEXP (XEXP (dest, 0), 0)))
- abort ();
+ gcc_assert (cfa_temp.reg
+ == (unsigned) REGNO (XEXP (XEXP (dest, 0), 0)));
offset = -cfa_temp.offset;
cfa_temp.offset -= GET_MODE_SIZE (GET_MODE (dest));
break;
default:
- abort ();
+ gcc_unreachable ();
}
if (REGNO (src) != STACK_POINTER_REGNUM
if (!REG_P (x))
x = XEXP (x, 0);
- if (!REG_P (x))
- abort ();
+ gcc_assert (REG_P (x));
cfa.reg = REGNO (x);
cfa.base_offset = offset;
break;
default:
- abort ();
+ gcc_unreachable ();
}
}
/* Set up state for generating call frame debug info. */
lookup_cfa (&cfa);
- if (cfa.reg != (unsigned long) DWARF_FRAME_REGNUM (STACK_POINTER_REGNUM))
- abort ();
+ gcc_assert (cfa.reg
+ == (unsigned long)DWARF_FRAME_REGNUM (STACK_POINTER_REGNUM));
cfa.reg = STACK_POINTER_REGNUM;
cfa_store = cfa;
return dw_cfi_oprnd_loc;
default:
- abort ();
+ gcc_unreachable ();
}
}
case DW_CFA_GNU_negative_offset_extended:
/* Obsoleted by DW_CFA_offset_extended_sf. */
- abort ();
+ gcc_unreachable ();
default:
break;
/* Augmentations should be small, so there's scarce need to
iterate for a solution. Die if we exceed one uleb128 byte. */
- if (size_of_uleb128 (augmentation_size) != 1)
- abort ();
+ gcc_assert (size_of_uleb128 (augmentation_size) == 1);
}
}
int pad = -offset & (PTR_SIZE - 1);
size += pad;
- if (size_of_uleb128 (size) != 1)
- abort ();
+ gcc_assert (size_of_uleb128 (size) == 1);
}
dw2_asm_output_data_uleb128 (size, "Augmentation size");
break;
case DW_OP_const8u:
case DW_OP_const8s:
- if (HOST_BITS_PER_LONG < 64)
- abort ();
+ gcc_assert (HOST_BITS_PER_LONG >= 64);
dw2_asm_output_data (8, val1->v.val_int, NULL);
break;
case DW_OP_skip:
{
int offset;
- if (val1->val_class == dw_val_class_loc)
- offset = val1->v.val_loc->dw_loc_addr - (loc->dw_loc_addr + 3);
- else
- abort ();
+ gcc_assert (val1->val_class == dw_val_class_loc);
+ offset = val1->v.val_loc->dw_loc_addr - (loc->dw_loc_addr + 3);
dw2_asm_output_data (2, offset, NULL);
}
aligned properly like we do for the main unwind info, so
don't support emitting things larger than a byte if we're
only doing unwinding. */
- abort ();
+ gcc_unreachable ();
#endif
case DW_OP_const1u:
case DW_OP_const1s:
val1->v.val_addr);
fputc ('\n', asm_out_file);
#else
- abort ();
+ gcc_unreachable ();
#endif
break;
{
struct dw_loc_descr_struct *head, *tmp;
- if (cfa->indirect == 0)
- abort ();
+ gcc_assert (cfa->indirect);
if (cfa->base_offset)
{
if (DECL_ABSTRACT (decl) && DECL_ABSTRACT_ORIGIN (decl) == decl)
return NULL_TREE;
-#ifdef ENABLE_CHECKING
- if (DECL_FROM_INLINE (DECL_ORIGIN (decl)))
- /* Since the DECL_ABSTRACT_ORIGIN for a DECL is supposed to be the
- most distant ancestor, this should never happen. */
- abort ();
-#endif
+ /* Since the DECL_ABSTRACT_ORIGIN for a DECL is supposed to be the
+ most distant ancestor, this should never happen. */
+ gcc_assert (!DECL_FROM_INLINE (DECL_ORIGIN (decl)));
return DECL_ABSTRACT_ORIGIN (decl);
}
static inline unsigned
AT_flag (dw_attr_ref a)
{
- if (a && AT_class (a) == dw_val_class_flag)
- return a->dw_attr_val.v.val_flag;
-
- abort ();
+ gcc_assert (a && AT_class (a) == dw_val_class_flag);
+ return a->dw_attr_val.v.val_flag;
}
/* Add a signed integer attribute value to a DIE. */
static inline HOST_WIDE_INT
AT_int (dw_attr_ref a)
{
- if (a && AT_class (a) == dw_val_class_const)
- return a->dw_attr_val.v.val_int;
-
- abort ();
+ gcc_assert (a && AT_class (a) == dw_val_class_const);
+ return a->dw_attr_val.v.val_int;
}
/* Add an unsigned integer attribute value to a DIE. */
static inline unsigned HOST_WIDE_INT
AT_unsigned (dw_attr_ref a)
{
- if (a && AT_class (a) == dw_val_class_unsigned_const)
- return a->dw_attr_val.v.val_unsigned;
-
- abort ();
+ gcc_assert (a && AT_class (a) == dw_val_class_unsigned_const);
+ return a->dw_attr_val.v.val_unsigned;
}
/* Add an unsigned double integer attribute value to a DIE. */
static inline const char *
AT_string (dw_attr_ref a)
{
- if (a && AT_class (a) == dw_val_class_str)
- return a->dw_attr_val.v.val_str->str;
-
- abort ();
+ gcc_assert (a && AT_class (a) == dw_val_class_str);
+ return a->dw_attr_val.v.val_str->str;
}
/* Find out whether a string should be output inline in DIE
static int
AT_string_form (dw_attr_ref a)
{
- if (a && AT_class (a) == dw_val_class_str)
- {
- struct indirect_string_node *node;
- unsigned int len;
- char label[32];
-
- node = a->dw_attr_val.v.val_str;
- if (node->form)
- return node->form;
-
- len = strlen (node->str) + 1;
+ struct indirect_string_node *node;
+ unsigned int len;
+ char label[32];
- /* If the string is shorter or equal to the size of the reference, it is
- always better to put it inline. */
- if (len <= DWARF_OFFSET_SIZE || node->refcount == 0)
- return node->form = DW_FORM_string;
+ gcc_assert (a && AT_class (a) == dw_val_class_str);
+
+ node = a->dw_attr_val.v.val_str;
+ if (node->form)
+ return node->form;
+
+ len = strlen (node->str) + 1;
- /* If we cannot expect the linker to merge strings in .debug_str
- section, only put it into .debug_str if it is worth even in this
- single module. */
- if ((DEBUG_STR_SECTION_FLAGS & SECTION_MERGE) == 0
- && (len - DWARF_OFFSET_SIZE) * node->refcount <= len)
- return node->form = DW_FORM_string;
+ /* If the string is shorter or equal to the size of the reference, it is
+ always better to put it inline. */
+ if (len <= DWARF_OFFSET_SIZE || node->refcount == 0)
+ return node->form = DW_FORM_string;
- ASM_GENERATE_INTERNAL_LABEL (label, "LASF", dw2_string_counter);
- ++dw2_string_counter;
- node->label = xstrdup (label);
+ /* If we cannot expect the linker to merge strings in .debug_str
+ section, only put it into .debug_str if it is worth even in this
+ single module. */
+ if ((DEBUG_STR_SECTION_FLAGS & SECTION_MERGE) == 0
+ && (len - DWARF_OFFSET_SIZE) * node->refcount <= len)
+ return node->form = DW_FORM_string;
- return node->form = DW_FORM_strp;
- }
+ ASM_GENERATE_INTERNAL_LABEL (label, "LASF", dw2_string_counter);
+ ++dw2_string_counter;
+ node->label = xstrdup (label);
- abort ();
+ return node->form = DW_FORM_strp;
}
/* Add a DIE reference attribute value to a DIE. */
add_AT_specification (dw_die_ref die, dw_die_ref targ_die)
{
add_AT_die_ref (die, DW_AT_specification, targ_die);
- if (targ_die->die_definition)
- abort ();
+ gcc_assert (!targ_die->die_definition);
targ_die->die_definition = die;
}
static inline dw_die_ref
AT_ref (dw_attr_ref a)
{
- if (a && AT_class (a) == dw_val_class_die_ref)
- return a->dw_attr_val.v.val_die_ref.die;
-
- abort ();
+ gcc_assert (a && AT_class (a) == dw_val_class_die_ref);
+ return a->dw_attr_val.v.val_die_ref.die;
}
static inline int
static inline void
set_AT_ref_external (dw_attr_ref a, int i)
{
- if (a && AT_class (a) == dw_val_class_die_ref)
- a->dw_attr_val.v.val_die_ref.external = i;
- else
- abort ();
+ gcc_assert (a && AT_class (a) == dw_val_class_die_ref);
+ a->dw_attr_val.v.val_die_ref.external = i;
}
/* Add an FDE reference attribute value to a DIE. */
static inline dw_loc_descr_ref
AT_loc (dw_attr_ref a)
{
- if (a && AT_class (a) == dw_val_class_loc)
- return a->dw_attr_val.v.val_loc;
-
- abort ();
+ gcc_assert (a && AT_class (a) == dw_val_class_loc);
+ return a->dw_attr_val.v.val_loc;
}
static inline void
static inline dw_loc_list_ref
AT_loc_list (dw_attr_ref a)
{
- if (a && AT_class (a) == dw_val_class_loc_list)
- return a->dw_attr_val.v.val_loc_list;
-
- abort ();
+ gcc_assert (a && AT_class (a) == dw_val_class_loc_list);
+ return a->dw_attr_val.v.val_loc_list;
}
/* Add an address constant attribute value to a DIE. */
static inline rtx
AT_addr (dw_attr_ref a)
{
- if (a && AT_class (a) == dw_val_class_addr)
- return a->dw_attr_val.v.val_addr;
-
- abort ();
+ gcc_assert (a && AT_class (a) == dw_val_class_addr);
+ return a->dw_attr_val.v.val_addr;
}
/* Add a label identifier attribute value to a DIE. */
static inline const char *
AT_lbl (dw_attr_ref a)
{
- if (a && (AT_class (a) == dw_val_class_lbl_id
- || AT_class (a) == dw_val_class_lbl_offset))
- return a->dw_attr_val.v.val_lbl_id;
-
- abort ();
+ gcc_assert (a && (AT_class (a) == dw_val_class_lbl_id
+ || AT_class (a) == dw_val_class_lbl_offset));
+ return a->dw_attr_val.v.val_lbl_id;
}
/* Get the attribute of type attr_kind. */
{
if (die != NULL && child_die != NULL)
{
- if (die == child_die)
- abort ();
+ gcc_assert (die != child_die);
child_die->die_parent = die;
child_die->die_sib = die->die_child;
child = tmp;
}
- if (child->die_parent != parent
- && child->die_parent != get_AT_ref (parent, DW_AT_specification))
- abort ();
+ gcc_assert (child->die_parent == parent
+ || (child->die_parent
+ == get_AT_ref (parent, DW_AT_specification)));
for (p = &(child->die_parent->die_child); *p; p = &((*p)->die_sib))
if (*p == child)
case dw_val_class_addr:
r = AT_addr (at);
- switch (GET_CODE (r))
- {
- case SYMBOL_REF:
- CHECKSUM_STRING (XSTR (r, 0));
- break;
-
- default:
- abort ();
- }
+ gcc_assert (GET_CODE (r) == SYMBOL_REF);
+ CHECKSUM_STRING (XSTR (r, 0));
break;
case dw_val_class_offset:
r2 = v2->v.val_addr;
if (GET_CODE (r1) != GET_CODE (r2))
return 0;
- switch (GET_CODE (r1))
- {
- case SYMBOL_REF:
- return !strcmp (XSTR (r1, 0), XSTR (r2, 0));
-
- default:
- abort ();
- }
+ gcc_assert (GET_CODE (r1) == SYMBOL_REF);
+ return !strcmp (XSTR (r1, 0), XSTR (r2, 0));
case dw_val_class_offset:
return v1->v.val_offset == v2->v.val_offset;
#if 0
/* We can only use this in debugging, since the frontend doesn't check
to make sure that we leave every include file we enter. */
- if (unit != NULL)
- abort ();
+ gcc_assert (!unit);
#endif
assign_symbol_names (die);
if (AT_class (d_attr) == dw_val_class_die_ref
&& AT_ref (d_attr)->die_mark == 0)
{
- if (AT_ref (d_attr)->die_symbol == 0)
- abort ();
+ gcc_assert (AT_ref (d_attr)->die_symbol);
set_AT_ref_external (d_attr, 1);
}
size += strlen (a->dw_attr_val.v.val_str->str) + 1;
break;
default:
- abort ();
+ gcc_unreachable ();
}
}
{
dw_die_ref c;
- if (die->die_mark)
- abort ();
+ gcc_assert (!die->die_mark);
die->die_mark = 1;
for (c = die->die_child; c; c = c->die_sib)
{
dw_die_ref c;
- if (!die->die_mark)
- abort ();
+ gcc_assert (die->die_mark);
die->die_mark = 0;
for (c = die->die_child; c; c = c->die_sib)
return DW_FORM_addr;
case dw_val_class_range_list:
case dw_val_class_offset:
- if (DWARF_OFFSET_SIZE == 4)
- return DW_FORM_data4;
- if (DWARF_OFFSET_SIZE == 8)
- return DW_FORM_data8;
- abort ();
+ switch (DWARF_OFFSET_SIZE)
+ {
+ case 4:
+ return DW_FORM_data4;
+ case 8:
+ return DW_FORM_data8;
+ default:
+ gcc_unreachable ();
+ }
case dw_val_class_loc_list:
/* FIXME: Could be DW_FORM_data8, with a > 32 bit size
.debug_loc section */
case 2:
return DW_FORM_block2;
default:
- abort ();
+ gcc_unreachable ();
}
case dw_val_class_const:
return DW_FORM_sdata;
case 8:
return DW_FORM_data8;
default:
- abort ();
+ gcc_unreachable ();
}
case dw_val_class_long_long:
return DW_FORM_block1;
return AT_string_form (a);
default:
- abort ();
+ gcc_unreachable ();
}
}
size = size_of_locs (curr->expr);
/* Output the block length for this list of location operations. */
- if (size > 0xffff)
- abort ();
+ gcc_assert (size <= 0xffff);
dw2_asm_output_data (2, size, "%s", "Location expression size");
output_loc_sequence (curr->expr);
{
char *sym = AT_loc_list (a)->ll_symbol;
- if (sym == 0)
- abort ();
+ gcc_assert (sym);
dw2_asm_output_offset (DWARF_OFFSET_SIZE, sym, "%s", name);
}
break;
{
char *sym = AT_ref (a)->die_symbol;
- if (sym == 0)
- abort ();
+ gcc_assert (sym);
dw2_asm_output_offset (DWARF2_ADDR_SIZE, sym, "%s", name);
}
- else if (AT_ref (a)->die_offset == 0)
- abort ();
else
- dw2_asm_output_data (DWARF_OFFSET_SIZE, AT_ref (a)->die_offset,
- "%s", name);
+ {
+ gcc_assert (AT_ref (a)->die_offset);
+ dw2_asm_output_data (DWARF_OFFSET_SIZE, AT_ref (a)->die_offset,
+ "%s", name);
+ }
break;
case dw_val_class_fde_ref:
break;
default:
- abort ();
+ gcc_unreachable ();
}
}
pubname_ref pub = &pubname_table[i];
/* We shouldn't see pubnames for DIEs outside of the main CU. */
- if (pub->die->die_mark == 0)
- abort ();
+ gcc_assert (pub->die->die_mark);
dw2_asm_output_data (DWARF_OFFSET_SIZE, pub->die->die_offset,
"DIE offset");
dw_die_ref die = arange_table[i];
/* We shouldn't see aranges for DIEs outside of the main CU. */
- if (die->die_mark == 0)
- abort ();
+ gcc_assert (die->die_mark);
if (die->die_tag == DW_TAG_subprogram)
{
dw_attr_ref a = get_AT (die, DW_AT_location);
dw_loc_descr_ref loc;
- if (! a || AT_class (a) != dw_val_class_loc)
- abort ();
+ gcc_assert (a && AT_class (a) == dw_val_class_loc);
loc = AT_loc (a);
- if (loc->dw_loc_opc != DW_OP_addr)
- abort ();
+ gcc_assert (loc->dw_loc_opc == DW_OP_addr);
dw2_asm_output_addr_rtx (DWARF2_ADDR_SIZE,
loc->dw_loc_oprnd1.v.val_addr, "Address");
default:
/* No other TREE_CODEs are Dwarf fundamental types. */
- abort ();
+ gcc_unreachable ();
}
base_type_result = new_die (DW_TAG_base_type, comp_unit_die, type);
return 0;
default:
- abort ();
+ gcc_unreachable ();
}
return 0;
/* Vectors have the debugging information in the type,
not the main variant. */
mod_type_die = lookup_type_die (type);
- if (mod_type_die == NULL)
- abort ();
+ gcc_assert (mod_type_die);
}
/* We want to equate the qualified type to the die below. */
{
unsigned regno = REGNO (rtl);
- if (regno >= FIRST_PSEUDO_REGISTER)
- abort ();
+ gcc_assert (regno < FIRST_PSEUDO_REGISTER);
return DBX_REGISTER_NUMBER (regno);
}
/* Now onto stupid register sets in non contiguous locations. */
- if (GET_CODE (regs) != PARALLEL)
- abort ();
+ gcc_assert (GET_CODE (regs) == PARALLEL);
size = GET_MODE_SIZE (GET_MODE (XVECEXP (regs, 0, 0)));
loc_result = NULL;
break;
default:
- abort ();
+ gcc_unreachable ();
}
return mem_loc_result;
break;
default:
- abort ();
+ gcc_unreachable ();
}
return loc_result;
#ifdef ENABLE_CHECKING
/* Otherwise this is a generic code; we should just lists all of
these explicitly. Aborting means we forgot one. */
- abort ();
+ gcc_unreachable ();
#else
/* In a release build, we want to degrade gracefully: better to
generate incomplete debugging information than to crash. */
if (TREE_CODE (decl) == ERROR_MARK)
return 0;
- else if (TREE_CODE (decl) != FIELD_DECL)
- abort ();
+
+ gcc_assert (TREE_CODE (decl) == FIELD_DECL);
type = field_type (decl);
field_size_tree = DECL_SIZE (decl);
/* Calculate the address of the offset. */
offset = tree_low_cst (BINFO_VPTR_FIELD (decl), 0);
- if (offset >= 0)
- abort ();
+ gcc_assert (offset < 0);
tmp = int_loc_descriptor (-offset);
add_loc_descr (&loc_descr, tmp);
else
{
/* ??? We really should be using HOST_WIDE_INT throughout. */
- if (HOST_BITS_PER_LONG != HOST_BITS_PER_WIDE_INT)
- abort ();
+ gcc_assert (HOST_BITS_PER_LONG == HOST_BITS_PER_WIDE_INT);
add_AT_long_long (die, DW_AT_const_value,
CONST_DOUBLE_HIGH (rtl), CONST_DOUBLE_LOW (rtl));
unsigned int i;
unsigned char *p;
- if (GET_MODE_CLASS (mode) == MODE_VECTOR_INT)
+ switch (GET_MODE_CLASS (mode))
{
+ case MODE_VECTOR_INT:
for (i = 0, p = array; i < length; i++, p += elt_size)
{
rtx elt = CONST_VECTOR_ELT (rtl, i);
HOST_WIDE_INT lo, hi;
- if (GET_CODE (elt) == CONST_INT)
+
+ switch (GET_CODE (elt))
{
+ case CONST_INT:
lo = INTVAL (elt);
hi = -(lo < 0);
- }
- else if (GET_CODE (elt) == CONST_DOUBLE)
- {
+ break;
+
+ case CONST_DOUBLE:
lo = CONST_DOUBLE_LOW (elt);
hi = CONST_DOUBLE_HIGH (elt);
+ break;
+
+ default:
+ gcc_unreachable ();
}
- else
- abort ();
-
+
if (elt_size <= sizeof (HOST_WIDE_INT))
insert_int (lo, elt_size, p);
- else if (elt_size == 2 * sizeof (HOST_WIDE_INT))
+ else
{
unsigned char *p0 = p;
unsigned char *p1 = p + sizeof (HOST_WIDE_INT);
-
+
+ gcc_assert (elt_size == 2 * sizeof (HOST_WIDE_INT));
if (WORDS_BIG_ENDIAN)
{
p0 = p1;
insert_int (lo, sizeof (HOST_WIDE_INT), p0);
insert_int (hi, sizeof (HOST_WIDE_INT), p1);
}
- else
- abort ();
}
- }
- else if (GET_MODE_CLASS (mode) == MODE_VECTOR_FLOAT)
- {
+ break;
+
+ case MODE_VECTOR_FLOAT:
for (i = 0, p = array; i < length; i++, p += elt_size)
{
rtx elt = CONST_VECTOR_ELT (rtl, i);
insert_float (elt, p);
}
+ break;
+
+ default:
+ gcc_unreachable ();
}
- else
- abort ();
add_AT_vec (die, DW_AT_const_value, length, elt_size, array);
}
default:
/* No other kinds of rtx should be possible here. */
- abort ();
+ gcc_unreachable ();
}
}
rtl = expand_expr (DECL_INITIAL (decl), NULL_RTX, VOIDmode,
EXPAND_INITIALIZER);
/* If expand_expr returns a MEM, it wasn't immediate. */
- if (rtl && MEM_P (rtl))
- abort ();
+ gcc_assert (!rtl || !MEM_P (rtl));
}
}
if (TREE_CODE (decl) == ERROR_MARK)
return;
- else if (TREE_CODE (decl) != VAR_DECL && TREE_CODE (decl) != PARM_DECL
- && TREE_CODE (decl) != RESULT_DECL)
- abort ();
+
+ gcc_assert (TREE_CODE (decl) == VAR_DECL || TREE_CODE (decl) == PARM_DECL
+ || TREE_CODE (decl) == RESULT_DECL);
/* See if we possibly have multiple locations for this variable. */
loc_list = lookup_decl_loc (decl);
size = simple_type_size_in_bits (field_type (tree_node)) / BITS_PER_UNIT;
break;
default:
- abort ();
+ gcc_unreachable ();
}
/* Note that `size' might be -1 when we get to this point. If it is, that
HOST_WIDE_INT unsigned bit_offset;
/* Must be a field and a bit field. */
- if (!type
- || TREE_CODE (decl) != FIELD_DECL)
- abort ();
+ gcc_assert (type && TREE_CODE (decl) == FIELD_DECL);
/* We can't yet handle bit-fields whose offsets are variable, so if we
encounter such things, just return without generating any attribute
add_bit_size_attribute (dw_die_ref die, tree decl)
{
/* Must be a field and a bit field. */
- if (TREE_CODE (decl) != FIELD_DECL
- || ! DECL_BIT_FIELD_TYPE (decl))
- abort ();
+ gcc_assert (TREE_CODE (decl) == FIELD_DECL
+ && DECL_BIT_FIELD_TYPE (decl));
if (host_integerp (DECL_SIZE (decl), 1))
add_AT_unsigned (die, DW_AT_bit_size, tree_low_cst (DECL_SIZE (decl), 1));
else if (TYPE_P (origin))
origin_die = lookup_type_die (origin);
- if (origin_die == NULL)
- abort ();
+ gcc_assert (origin_die);
add_AT_die_ref (die, DW_AT_abstract_origin, origin_die);
}
static inline void
pop_decl_scope (void)
{
- if (VARRAY_ACTIVE_SIZE (decl_scope_table) <= 0)
- abort ();
+ gcc_assert (VARRAY_ACTIVE_SIZE (decl_scope_table) > 0);
VARRAY_POP (decl_scope_table);
}
int i;
/* Non-types always go in the current scope. */
- if (! TYPE_P (t))
- abort ();
+ gcc_assert (TYPE_P (t));
containing_scope = TYPE_CONTEXT (t);
if (i < 0)
{
- if (debug_info_level > DINFO_LEVEL_TERSE
- && !TREE_ASM_WRITTEN (containing_scope))
- abort ();
+ gcc_assert (debug_info_level <= DINFO_LEVEL_TERSE
+ || TREE_ASM_WRITTEN (containing_scope));
/* If none of the current dies are suitable, we get file scope. */
scope_die = comp_unit_die;
const char *fnname;
x = DECL_RTL (decl);
- if (!MEM_P (x))
- abort ();
+ gcc_assert (MEM_P (x));
x = XEXP (x, 0);
- if (GET_CODE (x) != SYMBOL_REF)
- abort ();
+ gcc_assert (GET_CODE (x) == SYMBOL_REF);
fnname = XSTR (x, 0);
return fnname;
break;
default:
- abort ();
+ gcc_unreachable ();
}
return parm_die;
if (TYPE_DECL_SUPPRESS_DEBUG (TYPE_STUB_DECL (type))
&& ! lookup_decl_die (member))
{
- if (decl_ultimate_origin (member))
- abort ();
+ gcc_assert (!decl_ultimate_origin (member));
push_decl_scope (type);
if (TREE_CODE (member) == FUNCTION_DECL)
if (origin && declaration && class_or_namespace_scope_p (context_die))
{
origin = NULL;
- if (old_die)
- abort ();
+ gcc_assert (!old_die);
}
if (origin != NULL)
{
- if (declaration && ! local_scope_p (context_die))
- abort ();
+ gcc_assert (!declaration || local_scope_p (context_die));
/* Fixup die_parent for the abstract instance of a nested
inline function. */
we should detect this case and ignore it. For now, if we have
already reported an error, any error at all, then assume that
we got here because of an input error, not a dwarf2 bug. */
- if (errorcount)
- return;
- abort ();
+ gcc_assert (errorcount);
+ return;
}
/* If the definition comes from the same place as the declaration,
represent source-level labels which were explicitly declared by
the user. This really shouldn't be happening though, so catch
it if it ever does happen. */
- if (INSN_DELETED_P (insn))
- abort ();
+ gcc_assert (!INSN_DELETED_P (insn));
ASM_GENERATE_INTERNAL_LABEL (label, "L", CODE_LABEL_NUMBER (insn));
add_AT_lbl_id (lbl_die, DW_AT_low_pc, label);
{
type = DECL_ORIGINAL_TYPE (decl);
- if (type == TREE_TYPE (decl))
- abort ();
- else
- equate_type_number_to_die (TREE_TYPE (decl), type_die);
+ gcc_assert (type != TREE_TYPE (decl));
+ equate_type_number_to_die (TREE_TYPE (decl), type_die);
}
else
type = TREE_TYPE (decl);
return;
/* Prevent broken recursion; we can't hand off to the same type. */
- if (DECL_ORIGINAL_TYPE (TYPE_NAME (type)) == type)
- abort ();
+ gcc_assert (DECL_ORIGINAL_TYPE (TYPE_NAME (type)) != type);
TREE_ASM_WRITTEN (type) = 1;
gen_decl_die (TYPE_NAME (type), context_die);
case FILE_TYPE:
gen_type_die (TREE_TYPE (type), context_die);
- abort (); /* No way to represent these in Dwarf yet! */
+ /* No way to represent these in Dwarf yet! */
+ gcc_unreachable ();
break;
case FUNCTION_TYPE:
break;
default:
- abort ();
+ gcc_unreachable ();
}
TREE_ASM_WRITTEN (type) = 1;
this type (i.e. without any const or volatile qualifiers) so make sure
that we have the main variant (i.e. the unqualified version) of this
type now. */
- if (type != type_main_variant (type))
- abort ();
+ gcc_assert (type == type_main_variant (type));
/* Do not check TREE_ASM_WRITTEN (type) as it may not be set if this is
an instance of an unresolved type. */
break;
default:
- abort ();
+ gcc_unreachable ();
}
}
break;
default:
- abort ();
+ gcc_unreachable ();
}
/* See if we can find the die for this deci now.
If not then abort. */
if (!decl_die)
decl_die = lookup_decl_die (decl);
- if (!decl_die)
- abort ();
+ gcc_assert (decl_die);
}
return decl_die;
gen_type_die (type, context_die);
type_die = lookup_type_die (type);
- if (!type_die)
- abort();
+ gcc_assert (type_die);
}
return type_die;
}
break;
default:
- if ((int)TREE_CODE (decl) > NUM_TREE_CODES)
- /* Probably some frontend-internal decl. Assume we don't care. */
- break;
- abort ();
+ /* Probably some frontend-internal decl. Assume we don't care. */
+ gcc_assert ((int)TREE_CODE (decl) > NUM_TREE_CODES);
+ break;
}
}
\f
if (debug_info_level <= DINFO_LEVEL_TERSE)
return;
- if (!decl)
- abort ();
+ gcc_assert (decl);
/* To emit DW_TAG_imported_module or DW_TAG_imported_decl, we need two DIEs.
We need decl DIE for reference and scope die. First, get DIE for the decl
prune_unused_types_prune (dw_die_ref die)
{
dw_die_ref c, p, n;
- if (!die->die_mark)
- abort();
+
+ gcc_assert (die->die_mark);
p = NULL;
for (c = die->die_child; c; c = n)
if (die->die_parent == NULL)
{
dw_die_ref origin = get_AT_ref (die, DW_AT_abstract_origin);
- tree context;
if (origin)
add_child_die (origin->die_parent, die);
else if (errorcount > 0 || sorrycount > 0)
/* It's OK to be confused by errors in the input. */
add_child_die (comp_unit_die, die);
- else if (node->created_for
- && ((DECL_P (node->created_for)
- && (context = DECL_CONTEXT (node->created_for)))
- || (TYPE_P (node->created_for)
- && (context = TYPE_CONTEXT (node->created_for))))
- && TREE_CODE (context) == FUNCTION_DECL)
+ else
{
/* In certain situations, the lexical block containing a
nested function can be optimized away, which results
in the nested function die being orphaned. Likewise
with the return type of that nested function. Force
this to be a child of the containing function. */
+ tree context = NULL_TREE;
+
+ gcc_assert (node->created_for);
+
+ if (DECL_P (node->created_for))
+ context = DECL_CONTEXT (node->created_for);
+ else if (TYPE_P (node->created_for))
+ context = TYPE_CONTEXT (node->created_for);
+
+ gcc_assert (context && TREE_CODE (context) == FUNCTION_DECL);
+
origin = lookup_decl_die (context);
- if (! origin)
- abort ();
+ gcc_assert (origin);
add_child_die (origin, die);
}
- else
- abort ();
}
}