This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch for changing the name of gas assert macro to gas_assert


Hello,

This patch changes the name of the macro "assert" defined in as.h
to "gas_assert". This makes the code play nicer with the standard
header assert.h.

I have compiled the following targets and made sure that "make check"
produce the same result for all of them. Some targets did not build
correctly without the patch. These targets are marked with *.

alpha-freebsd
alpha-linux
arc-elf
arm-eabi
arm-aout
cr16-linux
cris-linux
crx-linux
d30v-linux
dlx-elf
hppa-linux
i370-linux
i686-linux
x86_64-linux
i860-mach3*    - build error
i960-elf
ia64-linux
iq2000-elf
m32c-elf
m32r-linux
m68hc11-linux
m68k-linux
maxq-coff*     - obsolete
mcore-elf
mep-elf
mips-linux
mmix-linux
mn10300-linux
moxie-elf
ns32k-netbsd
pj-linux
ppc-linux
s390-linux
score-elf
sh-linux
sparc-linux
spu-elf
c30-coff*      - not supported by bfd?
vax-linux
xtensa-linux


Thanks,
Martin Thuresson


2009-06-17  Martin Thuresson  <martin@mtme.org>
	
	* gas/app, gas/as.c, gas/as.h, gas/atof-generic.c, gas/cgen.c,
	gas/config/atof-ieee.c, gas/config/obj-aout.c,
	gas/config/obj-coff.c, gas/config/obj-ecoff.c,
	gas/config/obj-elf.c, gas/config/obj-som.c, gas/config/tc-alpha.c,
	gas/config/tc-arc.c, gas/config/tc-arm.c, gas/config/tc-cr16.c,
	gas/config/tc-cris.c, gas/config/tc-crx.c, gas/config/tc-d30v.c,
	gas/config/tc-dlx.c, gas/config/tc-hppa.c, gas/config/tc-i370.c,
	gas/config/tc-i386-intel.c, gas/config/tc-i386.c,
	gas/config/tc-i860.c, gas/config/tc-i960.c, gas/config/tc-ia64.c,
	gas/config/tc-iq2000.c, gas/config/tc-m32c.c,
	gas/config/tc-m32r.c, gas/config/tc-m68hc11.c,
	gas/config/tc-m68k.c, gas/config/tc-maxq.c, gas/config/tc-mcore.c,
	gas/config/tc-mep.c, gas/config/tc-mips.c, gas/config/tc-mmix.c,
	gas/config/tc-mn10300.c, gas/config/tc-moxie.c,
	gas/config/tc-ns32k.c, gas/config/tc-pj.c, gas/config/tc-ppc.c,
	gas/config/tc-s390.c, gas/config/tc-score.c,
	gas/config/tc-score7.c, gas/config/tc-sh.c, gas/config/tc-sparc.c,
	gas/config/tc-spu.c, gas/config/tc-tic30.c, gas/config/tc-vax.c,
	gas/config/tc-xtensa.c, gas/config/xtensa-relax.c,
	gas/dw2gencfi.c, gas/dwarf2dbg.c, gas/ehopt.c, gas/expr.c,
	gas/frags.c, gas/input-file.c, gas/read.c, gas/sb.c,
	gas/subsegs.c, gas/symbols.c, gas/write.c: Change the name of the
	gas macro `assert' to `gas_assert'.
diff -crp src.head/gas/app.c src.assert/gas/app.c
*** src.head/gas/app.c	Tue Jun 16 09:07:25 2009
--- src.assert/gas/app.c	Tue Jun 16 09:39:04 2009
*************** app_pop (char *arg)
*** 294,300 ****
      saved_input = NULL;
    else
      {
!       assert (saved->saved_input_len <= (int) (sizeof input_buffer));
        memcpy (input_buffer, saved->saved_input, saved->saved_input_len);
        saved_input = input_buffer;
        saved_input_len = saved->saved_input_len;
--- 294,300 ----
      saved_input = NULL;
    else
      {
!       gas_assert (saved->saved_input_len <= (int) (sizeof input_buffer));
        memcpy (input_buffer, saved->saved_input, saved->saved_input_len);
        saved_input = input_buffer;
        saved_input_len = saved->saved_input_len;
diff -crp src.head/gas/as.c src.assert/gas/as.c
*** src.head/gas/as.c	Tue Jun 16 09:07:25 2009
--- src.assert/gas/as.c	Tue Jun 16 09:39:04 2009
*************** main (int argc, char ** argv)
*** 1150,1156 ****
    PROGRESS (1);
  
    output_file_create (out_file_name);
!   assert (stdoutput != 0);
  
  #ifdef tc_init_after_args
    tc_init_after_args ();
--- 1150,1156 ----
    PROGRESS (1);
  
    output_file_create (out_file_name);
!   gas_assert (stdoutput != 0);
  
  #ifdef tc_init_after_args
    tc_init_after_args ();
Only in src.assert/gas: as.c.orig
diff -crp src.head/gas/as.h src.assert/gas/as.h
*** src.head/gas/as.h	Tue Jun 16 09:07:25 2009
--- src.assert/gas/as.h	Tue Jun 16 09:39:04 2009
*************** typedef int * va_list;
*** 108,114 ****
  #if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 6)
  #define __PRETTY_FUNCTION__  ((char*)0)
  #endif
! #define assert(P) \
    ((void) ((P) ? 0 : (as_assert (__FILE__, __LINE__, __PRETTY_FUNCTION__), 0)))
  #undef abort
  #define abort()		as_abort (__FILE__, __LINE__, __PRETTY_FUNCTION__)
--- 108,114 ----
  #if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 6)
  #define __PRETTY_FUNCTION__  ((char*)0)
  #endif
! #define gas_assert(P) \
    ((void) ((P) ? 0 : (as_assert (__FILE__, __LINE__, __PRETTY_FUNCTION__), 0)))
  #undef abort
  #define abort()		as_abort (__FILE__, __LINE__, __PRETTY_FUNCTION__)
*************** typedef addressT valueT;
*** 235,241 ****
  
  #if ENABLE_CHECKING || defined (DEBUG)
  #ifndef know
! #define know(p) assert(p)	/* Verify our assumptions!  */
  #endif /* not yet defined */
  #else
  #define know(p)			/* know() checks are no-op.ed  */
--- 235,241 ----
  
  #if ENABLE_CHECKING || defined (DEBUG)
  #ifndef know
! #define know(p) gas_assert(p)	/* Verify our assumptions!  */
  #endif /* not yet defined */
  #else
  #define know(p)			/* know() checks are no-op.ed  */
Only in src.assert/gas: as.h.orig
diff -crp src.head/gas/atof-generic.c src.assert/gas/atof-generic.c
*** src.head/gas/atof-generic.c	Tue Jun 16 09:07:25 2009
--- src.assert/gas/atof-generic.c	Tue Jun 16 09:39:04 2009
*************** atof_generic (/* return pointer to just 
*** 101,107 ****
    int seen_significant_digit;
  
  #ifdef ASSUME_DECIMAL_MARK_IS_DOT
!   assert (string_of_decimal_marks[0] == '.'
  	  && string_of_decimal_marks[1] == 0);
  #define IS_DECIMAL_MARK(c)	((c) == '.')
  #else
--- 101,107 ----
    int seen_significant_digit;
  
  #ifdef ASSUME_DECIMAL_MARK_IS_DOT
!   gas_assert (string_of_decimal_marks[0] == '.'
  	  && string_of_decimal_marks[1] == 0);
  #define IS_DECIMAL_MARK(c)	((c) == '.')
  #else
diff -crp src.head/gas/cgen.c src.assert/gas/cgen.c
*** src.head/gas/cgen.c	Tue Jun 16 09:07:25 2009
--- src.assert/gas/cgen.c	Tue Jun 16 09:39:04 2009
*************** gas_cgen_tc_gen_reloc (section, fixP)
*** 1035,1041 ****
        return NULL;
      }
  
!   assert (!fixP->fx_pcrel == !reloc->howto->pc_relative);
  
    reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
    *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy);
--- 1035,1041 ----
        return NULL;
      }
  
!   gas_assert (!fixP->fx_pcrel == !reloc->howto->pc_relative);
  
    reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
    *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy);
*************** gas_cgen_begin ()
*** 1062,1065 ****
    else
      cgen_clear_signed_overflow_ok (gas_cgen_cpu_desc);
  }
- 
--- 1062,1064 ----
Only in src.assert/gas: cgen.c.orig
diff -crp src.head/gas/config/atof-ieee.c src.assert/gas/config/atof-ieee.c
*** src.head/gas/config/atof-ieee.c	Tue Jun 16 09:07:24 2009
--- src.assert/gas/config/atof-ieee.c	Tue Jun 16 09:39:04 2009
*************** ieee_md_atof (int type,
*** 784,790 ****
        return _("Unrecognized or unsupported floating point constant");
      }
  
!   assert (prec <= MAX_LITTLENUMS);
  
    t = atof_ieee (input_line_pointer, type, words);
    if (t)
--- 784,790 ----
        return _("Unrecognized or unsupported floating point constant");
      }
  
!   gas_assert (prec <= MAX_LITTLENUMS);
  
    t = atof_ieee (input_line_pointer, type, words);
    if (t)
diff -crp src.head/gas/config/obj-aout.c src.assert/gas/config/obj-aout.c
*** src.head/gas/config/obj-aout.c	Tue Jun 16 09:07:24 2009
--- src.assert/gas/config/obj-aout.c	Tue Jun 16 09:39:04 2009
*************** obj_aout_frob_file_before_fix (void)
*** 132,138 ****
      x = bfd_set_section_contents (stdoutput, data_section, &b, (file_ptr) 0,
  				  (bfd_size_type) 1);
  
!   assert (x);
  }
  
  static void
--- 132,138 ----
      x = bfd_set_section_contents (stdoutput, data_section, &b, (file_ptr) 0,
  				  (bfd_size_type) 1);
  
!   gas_assert (x);
  }
  
  static void
diff -crp src.head/gas/config/obj-coff.c src.assert/gas/config/obj-coff.c
*** src.head/gas/config/obj-coff.c	Tue Jun 16 09:07:24 2009
--- src.assert/gas/config/obj-coff.c	Tue Jun 16 09:39:05 2009
*************** fetch_coff_debug_section (void)
*** 248,254 ****
        const asymbol *s;
  
        s = bfd_make_debug_symbol (stdoutput, NULL, 0);
!       assert (s != 0);
        debug_section = s->section;
      }
    return debug_section;
--- 248,254 ----
        const asymbol *s;
  
        s = bfd_make_debug_symbol (stdoutput, NULL, 0);
!       gas_assert (s != 0);
        debug_section = s->section;
      }
    return debug_section;
*************** weak_altname2name (const char * name)
*** 1098,1104 ****
    char * weak_name;
    char * dot;
  
!   assert (weak_is_altname (name));
  
    weak_name = xstrdup (name + 6);
    if ((dot = strchr (weak_name, '.')))
--- 1098,1104 ----
    char * weak_name;
    char * dot;
  
!   gas_assert (weak_is_altname (name));
  
    weak_name = xstrdup (name + 6);
    if ((dot = strchr (weak_name, '.')))
*************** weak_uniquify (const char * name)
*** 1119,1125 ****
    if (an_external_name != NULL)
      unique = an_external_name;
  #endif
!   assert (weak_is_altname (name));
  
    if (strchr (name + sizeof (weak_altprefix), '.'))
      return name;
--- 1119,1125 ----
    if (an_external_name != NULL)
      unique = an_external_name;
  #endif
!   gas_assert (weak_is_altname (name));
  
    if (strchr (name + sizeof (weak_altprefix), '.'))
      return name;
*************** coff_frob_symbol (symbolS *symp, int *pu
*** 1249,1256 ****
        symbolS *weakp = symbol_find_noref (weak_altname2name
  					  (S_GET_NAME (symp)), 1);
  
!       assert (weakp);
!       assert (S_GET_NUMBER_AUXILIARY (weakp) == 1);
  
        if (! S_IS_WEAK (weakp))
  	{
--- 1249,1256 ----
        symbolS *weakp = symbol_find_noref (weak_altname2name
  					  (S_GET_NAME (symp)), 1);
  
!       gas_assert (weakp);
!       gas_assert (S_GET_NUMBER_AUXILIARY (weakp) == 1);
  
        if (! S_IS_WEAK (weakp))
  	{
*************** coff_frob_symbol (symbolS *symp, int *pu
*** 1332,1338 ****
  
        if (!S_IS_DEFINED (symp) && !SF_GET_LOCAL (symp))
  	{
! 	  assert (S_GET_VALUE (symp) == 0);
  	  if (S_IS_WEAKREFD (symp))
  	    *punt = 1;
  	  else
--- 1332,1338 ----
  
        if (!S_IS_DEFINED (symp) && !SF_GET_LOCAL (symp))
  	{
! 	  gas_assert (S_GET_VALUE (symp) == 0);
  	  if (S_IS_WEAKREFD (symp))
  	    *punt = 1;
  	  else
*************** coff_frob_section (segT sec)
*** 1790,1796 ****
    fragp = seg_info (sec)->frchainP->frch_root;
    while (fragp && fragp->fr_fix == 0)
      fragp = fragp->fr_next;
!   assert (fragp != 0 && fragp->fr_fix >= 12);
  
    /* Store the values.  */
    p = fragp->fr_literal;
--- 1790,1796 ----
    fragp = seg_info (sec)->frchainP->frch_root;
    while (fragp && fragp->fr_fix == 0)
      fragp = fragp->fr_next;
!   gas_assert (fragp != 0 && fragp->fr_fix >= 12);
  
    /* Store the values.  */
    p = fragp->fr_literal;
Only in src.assert/gas/config: obj-coff.c.orig
diff -crp src.head/gas/config/obj-ecoff.c src.assert/gas/config/obj-ecoff.c
*** src.head/gas/config/obj-ecoff.c	Tue Jun 16 09:07:24 2009
--- src.assert/gas/config/obj-ecoff.c	Tue Jun 16 09:39:05 2009
*************** ecoff_frob_file (void)
*** 146,152 ****
    char *set;
  
    /* Build the ECOFF debugging information.  */
!   assert (ecoff_data (stdoutput) != 0);
    hdr = &ecoff_data (stdoutput)->debug_info.symbolic_header;
    ecoff_build_debug (hdr, &buf, debug_swap);
  
--- 146,152 ----
    char *set;
  
    /* Build the ECOFF debugging information.  */
!   gas_assert (ecoff_data (stdoutput) != 0);
    hdr = &ecoff_data (stdoutput)->debug_info.symbolic_header;
    ecoff_build_debug (hdr, &buf, debug_swap);
  
diff -crp src.head/gas/config/obj-elf.c src.assert/gas/config/obj-elf.c
*** src.head/gas/config/obj-elf.c	Tue Jun 16 09:07:24 2009
--- src.assert/gas/config/obj-elf.c	Tue Jun 16 09:39:05 2009
*************** obj_elf_visibility (int visibility)
*** 459,465 ****
        bfdsym = symbol_get_bfdsym (symbolP);
        elfsym = elf_symbol_from (bfd_asymbol_bfd (bfdsym), bfdsym);
  
!       assert (elfsym);
  
        elfsym->internal_elf_sym.st_other &= ~3;
        elfsym->internal_elf_sym.st_other |= visibility;
--- 459,465 ----
        bfdsym = symbol_get_bfdsym (symbolP);
        elfsym = elf_symbol_from (bfd_asymbol_bfd (bfdsym), bfdsym);
  
!       gas_assert (elfsym);
  
        elfsym->internal_elf_sym.st_other &= ~3;
        elfsym->internal_elf_sym.st_other |= visibility;
*************** obj_elf_vtable_inherit (int ignore ATTRI
*** 1346,1352 ****
    if (bad)
      return NULL;
  
!   assert (symbol_get_value_expression (csym)->X_op == O_constant);
    return fix_new (symbol_get_frag (csym),
  		  symbol_get_value_expression (csym)->X_add_number,
  		  0, psym, 0, 0, BFD_RELOC_VTABLE_INHERIT);
--- 1346,1352 ----
    if (bad)
      return NULL;
  
!   gas_assert (symbol_get_value_expression (csym)->X_op == O_constant);
    return fix_new (symbol_get_frag (csym),
  		  symbol_get_value_expression (csym)->X_add_number,
  		  0, psym, 0, 0, BFD_RELOC_VTABLE_INHERIT);
*************** adjust_stab_sections (bfd *abfd, asectio
*** 1779,1785 ****
    nsyms = bfd_section_size (abfd, sec) / 12 - 1;
  
    p = seg_info (sec)->stabu.p;
!   assert (p != 0);
  
    bfd_h_put_16 (abfd, nsyms, p + 6);
    bfd_h_put_32 (abfd, strsz, p + 8);
--- 1779,1785 ----
    nsyms = bfd_section_size (abfd, sec) / 12 - 1;
  
    p = seg_info (sec)->stabu.p;
!   gas_assert (p != 0);
  
    bfd_h_put_16 (abfd, nsyms, p + 6);
    bfd_h_put_32 (abfd, strsz, p + 8);
*************** elf_frob_file_after_relocs (void)
*** 2190,2196 ****
  		  bfd_errmsg (bfd_get_error ()));
  
        sec = bfd_get_section_by_name (stdoutput, ".mdebug");
!       assert (sec != NULL);
  
        know (!stdoutput->output_has_begun);
  
--- 2190,2196 ----
  		  bfd_errmsg (bfd_get_error ()));
  
        sec = bfd_get_section_by_name (stdoutput, ".mdebug");
!       gas_assert (sec != NULL);
  
        know (!stdoutput->output_has_begun);
  
Only in src.assert/gas/config: obj-elf.c.orig
diff -crp src.head/gas/config/obj-som.c src.assert/gas/config/obj-som.c
*** src.head/gas/config/obj-som.c	Tue Jun 16 09:07:24 2009
--- src.assert/gas/config/obj-som.c	Tue Jun 16 09:39:05 2009
*************** adjust_stab_sections (bfd *abfd, asectio
*** 280,286 ****
    nsyms = bfd_section_size (abfd, sec) / 12 - 1;
  
    p = seg_info (sec)->stabu.p;
!   assert (p != 0);
  
    bfd_h_put_16 (abfd, (bfd_vma) nsyms, (bfd_byte *) p + 6);
    bfd_h_put_32 (abfd, (bfd_vma) strsz, (bfd_byte *) p + 8);
--- 280,286 ----
    nsyms = bfd_section_size (abfd, sec) / 12 - 1;
  
    p = seg_info (sec)->stabu.p;
!   gas_assert (p != 0);
  
    bfd_h_put_16 (abfd, (bfd_vma) nsyms, (bfd_byte *) p + 6);
    bfd_h_put_32 (abfd, (bfd_vma) strsz, (bfd_byte *) p + 8);
diff -crp src.head/gas/config/tc-alpha.c src.assert/gas/config/tc-alpha.c
*** src.head/gas/config/tc-alpha.c	Tue Jun 16 09:07:24 2009
--- src.assert/gas/config/tc-alpha.c	Wed Jun 17 09:03:53 2009
*************** load_expression (int targreg,
*** 1280,1286 ****
  
  	assemble_tokens_to_insn ("ldq", newtok, 3, &insn);
  
! 	assert (insn.nfixups == 1);
  	insn.fixups[0].reloc = BFD_RELOC_ALPHA_LITERAL;
  	insn.sequence = emit_lituse = next_sequence_num--;
  #endif /* OBJ_ECOFF */
--- 1280,1286 ----
  
  	assemble_tokens_to_insn ("ldq", newtok, 3, &insn);
  
! 	gas_assert (insn.nfixups == 1);
  	insn.fixups[0].reloc = BFD_RELOC_ALPHA_LITERAL;
  	insn.sequence = emit_lituse = next_sequence_num--;
  #endif /* OBJ_ECOFF */
*************** load_expression (int targreg,
*** 1316,1322 ****
  
  	assemble_tokens_to_insn ("ldq", newtok, 3, &insn);
  
! 	assert (insn.nfixups == 1);
  	insn.fixups[0].reloc = BFD_RELOC_ALPHA_ELF_LITERAL;
  	insn.sequence = emit_lituse = next_sequence_num--;
  #endif /* OBJ_ELF */
--- 1316,1322 ----
  
  	assemble_tokens_to_insn ("ldq", newtok, 3, &insn);
  
! 	gas_assert (insn.nfixups == 1);
  	insn.fixups[0].reloc = BFD_RELOC_ALPHA_ELF_LITERAL;
  	insn.sequence = emit_lituse = next_sequence_num--;
  #endif /* OBJ_ELF */
*************** load_expression (int targreg,
*** 1376,1382 ****
  		    memcpy (ensymname, ptr1, ptr2 - ptr1);
  		    memcpy (ensymname + (ptr2 - ptr1), "..en", 5);
  
! 		    assert (insn.nfixups + 1 <= MAX_INSN_FIXUPS);
  		    insn.fixups[insn.nfixups].reloc = BFD_RELOC_ALPHA_NOP;
  		    ensym = symbol_find_or_make (ensymname);
  		    ensym->sy_used = 1;
--- 1376,1382 ----
  		    memcpy (ensymname, ptr1, ptr2 - ptr1);
  		    memcpy (ensymname + (ptr2 - ptr1), "..en", 5);
  
! 		    gas_assert (insn.nfixups + 1 <= MAX_INSN_FIXUPS);
  		    insn.fixups[insn.nfixups].reloc = BFD_RELOC_ALPHA_NOP;
  		    ensym = symbol_find_or_make (ensymname);
  		    ensym->sy_used = 1;
*************** load_expression (int targreg,
*** 1405,1411 ****
  		    psymname = (char *) xmalloc (ptr2 - ptr1 + 1);
  		    memcpy (psymname, ptr1, ptr2 - ptr1);
  		    psymname [ptr2 - ptr1] = 0;
! 		    assert (insn.nfixups + 1 <= MAX_INSN_FIXUPS);
  		    insn.fixups[insn.nfixups].reloc = BFD_RELOC_ALPHA_LDA;
  		    psym = symbol_find_or_make (psymname);
  		    psym->sy_used = 1;
--- 1405,1411 ----
  		    psymname = (char *) xmalloc (ptr2 - ptr1 + 1);
  		    memcpy (psymname, ptr1, ptr2 - ptr1);
  		    psymname [ptr2 - ptr1] = 0;
! 		    gas_assert (insn.nfixups + 1 <= MAX_INSN_FIXUPS);
  		    insn.fixups[insn.nfixups].reloc = BFD_RELOC_ALPHA_LDA;
  		    psym = symbol_find_or_make (psymname);
  		    psym->sy_used = 1;
*************** load_expression (int targreg,
*** 1544,1550 ****
  
        assemble_tokens_to_insn ("ldq", newtok, 3, &insn);
  
!       assert (insn.nfixups == 1);
  #ifdef OBJ_ECOFF
        insn.fixups[0].reloc = BFD_RELOC_ALPHA_LITERAL;
  #endif
--- 1544,1550 ----
  
        assemble_tokens_to_insn ("ldq", newtok, 3, &insn);
  
!       gas_assert (insn.nfixups == 1);
  #ifdef OBJ_ECOFF
        insn.fixups[0].reloc = BFD_RELOC_ALPHA_LITERAL;
  #endif
*************** load_expression (int targreg,
*** 1562,1568 ****
  
        assemble_tokens_to_insn ("ldq", newtok, 3, &insn);
  
!       assert (insn.nfixups < MAX_INSN_FIXUPS);
        insn.fixups[insn.nfixups].reloc = DUMMY_RELOC_LITUSE_BASE;
        insn.fixups[insn.nfixups].exp.X_op = O_absent;
        insn.nfixups++;
--- 1562,1568 ----
  
        assemble_tokens_to_insn ("ldq", newtok, 3, &insn);
  
!       gas_assert (insn.nfixups < MAX_INSN_FIXUPS);
        insn.fixups[insn.nfixups].reloc = DUMMY_RELOC_LITUSE_BASE;
        insn.fixups[insn.nfixups].exp.X_op = O_absent;
        insn.nfixups++;
*************** emit_insn (struct alpha_insn *insn)
*** 1765,1771 ****
  	{
  	  reloc_howto_type *reloc_howto
  	    = bfd_reloc_type_lookup (stdoutput, fixup->reloc);
! 	  assert (reloc_howto);
  
  	  size = bfd_get_reloc_size (reloc_howto);
  
--- 1765,1771 ----
  	{
  	  reloc_howto_type *reloc_howto
  	    = bfd_reloc_type_lookup (stdoutput, fixup->reloc);
! 	  gas_assert (reloc_howto);
  
  	  size = bfd_get_reloc_size (reloc_howto);
  
*************** emit_insn (struct alpha_insn *insn)
*** 1779,1785 ****
  	      break;
  #endif
  	    default:
! 	      assert (size >= 1 && size <= 4);
  	    }
   
  	  pcrel = reloc_howto->pc_relative;
--- 1779,1785 ----
  	      break;
  #endif
  	    default:
! 	      gas_assert (size >= 1 && size <= 4);
  	    }
   
  	  pcrel = reloc_howto->pc_relative;
*************** assemble_insn (const struct alpha_opcode
*** 2060,2066 ****
  
  	case O_constant:
  	  image = insert_operand (image, operand, t->X_add_number, NULL, 0);
! 	  assert (reloc_operand == NULL);
  	  reloc_operand = operand;
  	  reloc_exp = t;
  	  break;
--- 2060,2066 ----
  
  	case O_constant:
  	  image = insert_operand (image, operand, t->X_add_number, NULL, 0);
! 	  gas_assert (reloc_operand == NULL);
  	  reloc_operand = operand;
  	  reloc_exp = t;
  	  break;
*************** assemble_insn (const struct alpha_opcode
*** 2090,2096 ****
  	      if (reloc == BFD_RELOC_UNUSED)
  		reloc = operand->default_reloc;
  
! 	      assert (reloc_operand == NULL);
  	      reloc_operand = operand;
  	      reloc_exp = t;
  	    }
--- 2090,2096 ----
  	      if (reloc == BFD_RELOC_UNUSED)
  		reloc = operand->default_reloc;
  
! 	      gas_assert (reloc_operand == NULL);
  	      reloc_operand = operand;
  	      reloc_exp = t;
  	    }
*************** emit_ir_load (const expressionS *tok,
*** 2180,2186 ****
  
    if (lituse)
      {
!       assert (insn.nfixups < MAX_INSN_FIXUPS);
        insn.fixups[insn.nfixups].reloc = DUMMY_RELOC_LITUSE_BASE;
        insn.fixups[insn.nfixups].exp.X_op = O_absent;
        insn.nfixups++;
--- 2180,2186 ----
  
    if (lituse)
      {
!       gas_assert (insn.nfixups < MAX_INSN_FIXUPS);
        insn.fixups[insn.nfixups].reloc = DUMMY_RELOC_LITUSE_BASE;
        insn.fixups[insn.nfixups].exp.X_op = O_absent;
        insn.nfixups++;
*************** emit_loadstore (const expressionS *tok,
*** 2229,2235 ****
  
    if (lituse)
      {
!       assert (insn.nfixups < MAX_INSN_FIXUPS);
        insn.fixups[insn.nfixups].reloc = DUMMY_RELOC_LITUSE_BASE;
        insn.fixups[insn.nfixups].exp.X_op = O_absent;
        insn.nfixups++;
--- 2229,2235 ----
  
    if (lituse)
      {
!       gas_assert (insn.nfixups < MAX_INSN_FIXUPS);
        insn.fixups[insn.nfixups].reloc = DUMMY_RELOC_LITUSE_BASE;
        insn.fixups[insn.nfixups].exp.X_op = O_absent;
        insn.nfixups++;
*************** emit_ldXu (const expressionS *tok,
*** 2275,2281 ****
  
        if (lituse)
  	{
! 	  assert (insn.nfixups < MAX_INSN_FIXUPS);
  	  insn.fixups[insn.nfixups].reloc = DUMMY_RELOC_LITUSE_BASE;
  	  insn.fixups[insn.nfixups].exp.X_op = O_absent;
  	  insn.nfixups++;
--- 2275,2281 ----
  
        if (lituse)
  	{
! 	  gas_assert (insn.nfixups < MAX_INSN_FIXUPS);
  	  insn.fixups[insn.nfixups].reloc = DUMMY_RELOC_LITUSE_BASE;
  	  insn.fixups[insn.nfixups].exp.X_op = O_absent;
  	  insn.nfixups++;
*************** emit_ldXu (const expressionS *tok,
*** 2291,2297 ****
  
        if (lituse)
  	{
! 	  assert (insn.nfixups < MAX_INSN_FIXUPS);
  	  insn.fixups[insn.nfixups].reloc = DUMMY_RELOC_LITUSE_BYTOFF;
  	  insn.fixups[insn.nfixups].exp.X_op = O_absent;
  	  insn.nfixups++;
--- 2291,2297 ----
  
        if (lituse)
  	{
! 	  gas_assert (insn.nfixups < MAX_INSN_FIXUPS);
  	  insn.fixups[insn.nfixups].reloc = DUMMY_RELOC_LITUSE_BYTOFF;
  	  insn.fixups[insn.nfixups].exp.X_op = O_absent;
  	  insn.nfixups++;
*************** emit_stX (const expressionS *tok,
*** 2427,2433 ****
  
        if (lituse)
  	{
! 	  assert (insn.nfixups < MAX_INSN_FIXUPS);
  	  insn.fixups[insn.nfixups].reloc = DUMMY_RELOC_LITUSE_BASE;
  	  insn.fixups[insn.nfixups].exp.X_op = O_absent;
  	  insn.nfixups++;
--- 2427,2433 ----
  
        if (lituse)
  	{
! 	  gas_assert (insn.nfixups < MAX_INSN_FIXUPS);
  	  insn.fixups[insn.nfixups].reloc = DUMMY_RELOC_LITUSE_BASE;
  	  insn.fixups[insn.nfixups].exp.X_op = O_absent;
  	  insn.nfixups++;
*************** emit_stX (const expressionS *tok,
*** 2444,2450 ****
  
        if (lituse)
  	{
! 	  assert (insn.nfixups < MAX_INSN_FIXUPS);
  	  insn.fixups[insn.nfixups].reloc = DUMMY_RELOC_LITUSE_BYTOFF;
  	  insn.fixups[insn.nfixups].exp.X_op = O_absent;
  	  insn.nfixups++;
--- 2444,2450 ----
  
        if (lituse)
  	{
! 	  gas_assert (insn.nfixups < MAX_INSN_FIXUPS);
  	  insn.fixups[insn.nfixups].reloc = DUMMY_RELOC_LITUSE_BYTOFF;
  	  insn.fixups[insn.nfixups].exp.X_op = O_absent;
  	  insn.nfixups++;
*************** emit_stX (const expressionS *tok,
*** 2460,2466 ****
  
        if (lituse)
  	{
! 	  assert (insn.nfixups < MAX_INSN_FIXUPS);
  	  insn.fixups[insn.nfixups].reloc = DUMMY_RELOC_LITUSE_BYTOFF;
  	  insn.fixups[insn.nfixups].exp.X_op = O_absent;
  	  insn.nfixups++;
--- 2460,2466 ----
  
        if (lituse)
  	{
! 	  gas_assert (insn.nfixups < MAX_INSN_FIXUPS);
  	  insn.fixups[insn.nfixups].reloc = DUMMY_RELOC_LITUSE_BYTOFF;
  	  insn.fixups[insn.nfixups].exp.X_op = O_absent;
  	  insn.nfixups++;
*************** emit_stX (const expressionS *tok,
*** 2480,2486 ****
  
        if (lituse)
  	{
! 	  assert (insn.nfixups < MAX_INSN_FIXUPS);
  	  insn.fixups[insn.nfixups].reloc = DUMMY_RELOC_LITUSE_BASE;
  	  insn.fixups[insn.nfixups].exp.X_op = O_absent;
  	  insn.nfixups++;
--- 2480,2486 ----
  
        if (lituse)
  	{
! 	  gas_assert (insn.nfixups < MAX_INSN_FIXUPS);
  	  insn.fixups[insn.nfixups].reloc = DUMMY_RELOC_LITUSE_BASE;
  	  insn.fixups[insn.nfixups].exp.X_op = O_absent;
  	  insn.nfixups++;
*************** emit_jsrjmp (const expressionS *tok,
*** 2845,2851 ****
  
    if (lituse)
      {
!       assert (insn.nfixups < MAX_INSN_FIXUPS);
        insn.fixups[insn.nfixups].reloc = DUMMY_RELOC_LITUSE_JSR;
        insn.fixups[insn.nfixups].exp.X_op = O_absent;
        insn.nfixups++;
--- 2845,2851 ----
  
    if (lituse)
      {
!       gas_assert (insn.nfixups < MAX_INSN_FIXUPS);
        insn.fixups[insn.nfixups].reloc = DUMMY_RELOC_LITUSE_JSR;
        insn.fixups[insn.nfixups].exp.X_op = O_absent;
        insn.nfixups++;
*************** emit_jsrjmp (const expressionS *tok,
*** 2866,2872 ****
        memcpy (ensymname, symname, symlen);
        memcpy (ensymname + symlen, "..en", 5);
  
!       assert (insn.nfixups < MAX_INSN_FIXUPS);
        if (insn.nfixups > 0)
  	{
  	  memmove (&insn.fixups[1], &insn.fixups[0],
--- 2866,2872 ----
        memcpy (ensymname, symname, symlen);
        memcpy (ensymname + symlen, "..en", 5);
  
!       gas_assert (insn.nfixups < MAX_INSN_FIXUPS);
        if (insn.nfixups > 0)
  	{
  	  memmove (&insn.fixups[1], &insn.fixups[0],
*************** s_alpha_coff_wrapper (int which)
*** 4008,4014 ****
      ecoff_directive_val,
    };
  
!   assert (which >= 0 && which < (int) (sizeof (fns)/sizeof (*fns)));
  
    if (ECOFF_DEBUGGING)
      (*fns[which]) (0);
--- 4008,4014 ----
      ecoff_directive_val,
    };
  
!   gas_assert (which >= 0 && which < (int) (sizeof (fns)/sizeof (*fns)));
  
    if (ECOFF_DEBUGGING)
      (*fns[which]) (0);
*************** maybe_set_gp (asection *sec)
*** 5294,5300 ****
  static void
  select_gp_value (void)
  {
!   assert (alpha_gp_value == 0);
  
    /* Get minus-one in whatever width...  */
    alpha_gp_value = 0;
--- 5294,5300 ----
  static void
  select_gp_value (void)
  {
!   gas_assert (alpha_gp_value == 0);
  
    /* Get minus-one in whatever width...  */
    alpha_gp_value = 0;
*************** md_begin (void)
*** 5401,5407 ****
      expressionS e;
  
      e.X_op = O_max;
!     assert (e.X_op == O_max);
    }
  
    /* Create the opcode hash table.  */
--- 5401,5407 ----
      expressionS e;
  
      e.X_op = O_max;
!     gas_assert (e.X_op == O_max);
    }
  
    /* Create the opcode hash table.  */
*************** md_apply_fix (fixS *fixP, valueT * valP,
*** 5782,5788 ****
  
  #ifdef OBJ_ECOFF
      case BFD_RELOC_GPREL32:
!       assert (fixP->fx_subsy == alpha_gp_symbol);
        fixP->fx_subsy = 0;
        /* FIXME: inherited this obliviousness of `value' -- why?  */
        md_number_to_chars (fixpos, -alpha_gp_value, 4);
--- 5782,5788 ----
  
  #ifdef OBJ_ECOFF
      case BFD_RELOC_GPREL32:
!       gas_assert (fixP->fx_subsy == alpha_gp_symbol);
        fixP->fx_subsy = 0;
        /* FIXME: inherited this obliviousness of `value' -- why?  */
        md_number_to_chars (fixpos, -alpha_gp_value, 4);
*************** md_apply_fix (fixS *fixP, valueT * valP,
*** 5928,5934 ****
  	  as_fatal (_("unhandled relocation type %s"),
  		    bfd_get_reloc_code_name (fixP->fx_r_type));
  
! 	assert (-(int) fixP->fx_r_type < (int) alpha_num_operands);
  	operand = &alpha_operands[-(int) fixP->fx_r_type];
  
  	/* The rest of these fixups only exist internally during symbol
--- 5928,5934 ----
  	  as_fatal (_("unhandled relocation type %s"),
  		    bfd_get_reloc_code_name (fixP->fx_r_type));
  
! 	gas_assert (-(int) fixP->fx_r_type < (int) alpha_num_operands);
  	operand = &alpha_operands[-(int) fixP->fx_r_type];
  
  	/* The rest of these fixups only exist internally during symbol
*************** tc_gen_reloc (asection *sec ATTRIBUTE_UN
*** 6213,6219 ****
  
    /* Make sure none of our internal relocations make it this far.
       They'd better have been fully resolved by this point.  */
!   assert ((int) fixp->fx_r_type > 0);
  
    reloc->howto = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type);
    if (reloc->howto == NULL)
--- 6213,6219 ----
  
    /* Make sure none of our internal relocations make it this far.
       They'd better have been fully resolved by this point.  */
!   gas_assert ((int) fixp->fx_r_type > 0);
  
    reloc->howto = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type);
    if (reloc->howto == NULL)
*************** tc_gen_reloc (asection *sec ATTRIBUTE_UN
*** 6228,6234 ****
      as_fatal (_("internal error? cannot generate `%s' relocation"),
  	      bfd_get_reloc_code_name (fixp->fx_r_type));
  
!   assert (!fixp->fx_pcrel == !reloc->howto->pc_relative);
  
  #ifdef OBJ_ECOFF
    if (fixp->fx_r_type == BFD_RELOC_ALPHA_LITERAL)
--- 6228,6234 ----
      as_fatal (_("internal error? cannot generate `%s' relocation"),
  	      bfd_get_reloc_code_name (fixp->fx_r_type));
  
!   gas_assert (!fixp->fx_pcrel == !reloc->howto->pc_relative);
  
  #ifdef OBJ_ECOFF
    if (fixp->fx_r_type == BFD_RELOC_ALPHA_LITERAL)
Only in src.assert/gas/config: tc-alpha.c.orig
Only in src.assert/gas/config: tc-alpha.c.rej
diff -crp src.head/gas/config/tc-arc.c src.assert/gas/config/tc-arc.c
*** src.head/gas/config/tc-arc.c	Tue Jun 16 09:07:24 2009
--- src.assert/gas/config/tc-arc.c	Tue Jun 16 09:39:05 2009
*************** arc_common (int localScope)
*** 889,895 ****
        as_warn (_("length of symbol \"%s\" already %ld, ignoring %d"),
  	       S_GET_NAME (symbolP), (long) S_GET_VALUE (symbolP), size);
      }
!   assert (symbolP->sy_frag == &zero_address_frag);
  
    /* Now parse the alignment field.  This field is optional for
       local and global symbols. Default alignment is zero.  */
--- 889,895 ----
        as_warn (_("length of symbol \"%s\" already %ld, ignoring %d"),
  	       S_GET_NAME (symbolP), (long) S_GET_VALUE (symbolP), size);
      }
!   gas_assert (symbolP->sy_frag == &zero_address_frag);
  
    /* Now parse the alignment field.  This field is optional for
       local and global symbols. Default alignment is zero.  */
*************** md_apply_fix (fixS *fixP, valueT * valP,
*** 1283,1303 ****
  	 limm values.  */
        if (operand->fmt == 'B')
  	{
! 	  assert ((operand->flags & ARC_OPERAND_RELATIVE_BRANCH) != 0
  		  && operand->bits == 20
  		  && operand->shift == 7);
  	  fixP->fx_r_type = BFD_RELOC_ARC_B22_PCREL;
  	}
        else if (operand->fmt == 'J')
  	{
! 	  assert ((operand->flags & ARC_OPERAND_ABSOLUTE_BRANCH) != 0
  		  && operand->bits == 24
  		  && operand->shift == 32);
  	  fixP->fx_r_type = BFD_RELOC_ARC_B26;
  	}
        else if (operand->fmt == 'L')
  	{
! 	  assert ((operand->flags & ARC_OPERAND_LIMM) != 0
  		  && operand->bits == 32
  		  && operand->shift == 32);
  	  fixP->fx_r_type = BFD_RELOC_32;
--- 1283,1303 ----
  	 limm values.  */
        if (operand->fmt == 'B')
  	{
! 	  gas_assert ((operand->flags & ARC_OPERAND_RELATIVE_BRANCH) != 0
  		  && operand->bits == 20
  		  && operand->shift == 7);
  	  fixP->fx_r_type = BFD_RELOC_ARC_B22_PCREL;
  	}
        else if (operand->fmt == 'J')
  	{
! 	  gas_assert ((operand->flags & ARC_OPERAND_ABSOLUTE_BRANCH) != 0
  		  && operand->bits == 24
  		  && operand->shift == 32);
  	  fixP->fx_r_type = BFD_RELOC_ARC_B26;
  	}
        else if (operand->fmt == 'L')
  	{
! 	  gas_assert ((operand->flags & ARC_OPERAND_LIMM) != 0
  		  && operand->bits == 32
  		  && operand->shift == 32);
  	  fixP->fx_r_type = BFD_RELOC_32;
*************** tc_gen_reloc (asection *section ATTRIBUT
*** 1365,1371 ****
        return NULL;
      }
  
!   assert (!fixP->fx_pcrel == !reloc->howto->pc_relative);
  
    /* Set addend to account for PC being advanced one insn before the
       target address is computed.  */
--- 1365,1371 ----
        return NULL;
      }
  
!   gas_assert (!fixP->fx_pcrel == !reloc->howto->pc_relative);
  
    /* Set addend to account for PC being advanced one insn before the
       target address is computed.  */
diff -crp src.head/gas/config/tc-arm.c src.assert/gas/config/tc-arm.c
*** src.head/gas/config/tc-arm.c	Tue Jun 16 09:07:24 2009
--- src.assert/gas/config/tc-arm.c	Wed Jun 17 09:08:38 2009
*************** s_arm_unwind_save_vfp_armv6 (void)
*** 3401,3407 ****
  
    /* Generate opcode for registers numbered in the range 0 .. 15.  */
    num_regs_below_16 = num_vfpv3_regs > 0 ? 16 - (int) start : count;
!   assert (num_regs_below_16 + num_vfpv3_regs == count);
    if (num_regs_below_16 > 0)
      {
        op = 0xc900 | (start << 4) | (num_regs_below_16 - 1);
--- 3401,3407 ----
  
    /* Generate opcode for registers numbered in the range 0 .. 15.  */
    num_regs_below_16 = num_vfpv3_regs > 0 ? 16 - (int) start : count;
!   gas_assert (num_regs_below_16 + num_vfpv3_regs == count);
    if (num_regs_below_16 > 0)
      {
        op = 0xc900 | (start << 4) | (num_regs_below_16 - 1);
*************** parse_big_immediate (char **str, int i)
*** 4058,4064 ****
        /* Bignums have their least significant bits in
           generic_bignum[0]. Make sure we put 32 bits in imm and
           32 bits in reg,  in a (hopefully) portable way.  */
!       assert (parts != 0);
        inst.operands[i].imm = 0;
        for (j = 0; j < parts; j++, idx++)
          inst.operands[i].imm |= generic_bignum[idx]
--- 4058,4064 ----
        /* Bignums have their least significant bits in
           generic_bignum[0]. Make sure we put 32 bits in imm and
           32 bits in reg,  in a (hopefully) portable way.  */
!       gas_assert (parts != 0);
        inst.operands[i].imm = 0;
        for (j = 0; j < parts; j++, idx++)
          inst.operands[i].imm |= generic_bignum[idx]
*************** parse_shifter_operand_group_reloc (char 
*** 4576,4582 ****
  
        /* Record the relocation type (always the ALU variant here).  */
        inst.reloc.type = entry->alu_code;
!       assert (inst.reloc.type != 0);
  
        return PARSE_OPERAND_SUCCESS;
      }
--- 4576,4582 ----
  
        /* Record the relocation type (always the ALU variant here).  */
        inst.reloc.type = entry->alu_code;
!       gas_assert (inst.reloc.type != 0);
  
        return PARSE_OPERAND_SUCCESS;
      }
*************** parse_address_main (char **str, int i, i
*** 4735,4741 ****
                      break;
  
                    default:
!                     assert (0);
                  }
  
                if (inst.reloc.type == 0)
--- 4735,4741 ----
                      break;
  
                    default:
!                     gas_assert (0);
                  }
  
                if (inst.reloc.type == 0)
*************** parse_operands (char *str, const unsigne
*** 5587,5593 ****
        if (upat[i] >= OP_FIRST_OPTIONAL)
  	{
  	  /* Remember where we are in case we need to backtrack.  */
! 	  assert (!backtrack_pos);
  	  backtrack_pos = str;
  	  backtrack_error = inst.error;
  	  backtrack_index = i;
--- 5587,5593 ----
        if (upat[i] >= OP_FIRST_OPTIONAL)
  	{
  	  /* Remember where we are in case we need to backtrack.  */
! 	  gas_assert (!backtrack_pos);
  	  backtrack_pos = str;
  	  backtrack_error = inst.error;
  	  backtrack_index = i;
*************** encode_arm_shifter_operand (int i)
*** 6289,6295 ****
  static void
  encode_arm_addr_mode_common (int i, bfd_boolean is_t)
  {
!   assert (inst.operands[i].isreg);
    inst.instruction |= inst.operands[i].reg << 16;
  
    if (inst.operands[i].preind)
--- 6289,6295 ----
  static void
  encode_arm_addr_mode_common (int i, bfd_boolean is_t)
  {
!   gas_assert (inst.operands[i].isreg);
    inst.instruction |= inst.operands[i].reg << 16;
  
    if (inst.operands[i].preind)
*************** encode_arm_addr_mode_common (int i, bfd_
*** 6306,6312 ****
      }
    else if (inst.operands[i].postind)
      {
!       assert (inst.operands[i].writeback);
        if (is_t)
  	inst.instruction |= WRITE_BACK;
      }
--- 6306,6312 ----
      }
    else if (inst.operands[i].postind)
      {
!       gas_assert (inst.operands[i].writeback);
        if (is_t)
  	inst.instruction |= WRITE_BACK;
      }
*************** encode_arm_cp_address (int i, int wb_ok,
*** 6400,6410 ****
  {
    inst.instruction |= inst.operands[i].reg << 16;
  
!   assert (!(inst.operands[i].preind && inst.operands[i].postind));
  
    if (!inst.operands[i].preind && !inst.operands[i].postind) /* unindexed */
      {
!       assert (!inst.operands[i].writeback);
        if (!unind_ok)
  	{
  	  inst.error = _("instruction does not support unindexed addressing");
--- 6400,6410 ----
  {
    inst.instruction |= inst.operands[i].reg << 16;
  
!   gas_assert (!(inst.operands[i].preind && inst.operands[i].postind));
  
    if (!inst.operands[i].preind && !inst.operands[i].postind) /* unindexed */
      {
!       gas_assert (!inst.operands[i].writeback);
        if (!unind_ok)
  	{
  	  inst.error = _("instruction does not support unindexed addressing");
*************** encode_thumb32_addr_mode (int i, bfd_boo
*** 8332,8338 ****
      }
    else if (inst.operands[i].postind)
      {
!       assert (inst.operands[i].writeback);
        constraint (is_pc, _("cannot use post-indexing with PC-relative addressing"));
        constraint (is_t, _("cannot use post-indexing with this instruction"));
  
--- 8332,8338 ----
      }
    else if (inst.operands[i].postind)
      {
!       gas_assert (inst.operands[i].writeback);
        constraint (is_pc, _("cannot use post-indexing with PC-relative addressing"));
        constraint (is_t, _("cannot use post-indexing with this instruction"));
  
*************** do_t_branch (void)
*** 9033,9039 ****
  	inst.reloc.type = BFD_RELOC_THUMB_PCREL_BRANCH25;
        else
  	{
! 	  assert (cond != 0xF);
  	  inst.instruction |= cond << 22;
  	  inst.reloc.type = BFD_RELOC_THUMB_PCREL_BRANCH20;
  	}
--- 9033,9039 ----
  	inst.reloc.type = BFD_RELOC_THUMB_PCREL_BRANCH25;
        else
  	{
! 	  gas_assert (cond != 0xF);
  	  inst.instruction |= cond << 22;
  	  inst.reloc.type = BFD_RELOC_THUMB_PCREL_BRANCH20;
  	}
*************** neon_type_promote (struct neon_type_el *
*** 11294,11300 ****
  {
    struct neon_type_el dest = *key;
  
!   assert ((thisarg & N_EQK) != 0);
  
    neon_modify_type_size (thisarg, &dest.type, &dest.size);
  
--- 11294,11300 ----
  {
    struct neon_type_el dest = *key;
  
!   gas_assert ((thisarg & N_EQK) != 0);
  
    neon_modify_type_size (thisarg, &dest.type, &dest.size);
  
*************** do_neon_rev (void)
*** 13495,13501 ****
       extract it here to check the elements to be reversed are smaller.
       Otherwise we'd get a reserved instruction.  */
    unsigned elsize = (op == 2) ? 16 : (op == 1) ? 32 : (op == 0) ? 64 : 0;
!   assert (elsize != 0);
    constraint (et.size >= elsize,
                _("elements must be smaller than reversal region"));
    neon_two_same (neon_quad (rs), 1, et.size);
--- 13495,13501 ----
       extract it here to check the elements to be reversed are smaller.
       Otherwise we'd get a reserved instruction.  */
    unsigned elsize = (op == 2) ? 16 : (op == 1) ? 32 : (op == 0) ? 64 : 0;
!   gas_assert (elsize != 0);
    constraint (et.size >= elsize,
                _("elements must be smaller than reversal region"));
    neon_two_same (neon_quad (rs), 1, et.size);
*************** do_neon_ld_dup (void)
*** 14201,14207 ****
    switch ((inst.instruction >> 8) & 3)
      {
      case 0:  /* VLD1.  */
!       assert (NEON_REG_STRIDE (inst.operands[0].imm) != 2);
        align_good = neon_alignment_bit (et.size, inst.operands[1].imm >> 8,
                                         &do_align, 16, 16, 32, 32, -1);
        if (align_good == FAIL)
--- 14201,14207 ----
    switch ((inst.instruction >> 8) & 3)
      {
      case 0:  /* VLD1.  */
!       gas_assert (NEON_REG_STRIDE (inst.operands[0].imm) != 2);
        align_good = neon_alignment_bit (et.size, inst.operands[1].imm >> 8,
                                         &do_align, 16, 16, 32, 32, -1);
        if (align_good == FAIL)
*************** output_inst (const char * str)
*** 14417,14428 ****
  
    if (thumb_mode && (inst.size > THUMB_SIZE))
      {
!       assert (inst.size == (2 * THUMB_SIZE));
        put_thumb32_insn (to, inst.instruction);
      }
    else if (inst.size > INSN_SIZE)
      {
!       assert (inst.size == (2 * INSN_SIZE));
        md_number_to_chars (to, inst.instruction, INSN_SIZE);
        md_number_to_chars (to + INSN_SIZE, inst.instruction, INSN_SIZE);
      }
--- 14417,14428 ----
  
    if (thumb_mode && (inst.size > THUMB_SIZE))
      {
!       gas_assert (inst.size == (2 * THUMB_SIZE));
        put_thumb32_insn (to, inst.instruction);
      }
    else if (inst.size > INSN_SIZE)
      {
!       gas_assert (inst.size == (2 * INSN_SIZE));
        md_number_to_chars (to, inst.instruction, INSN_SIZE);
        md_number_to_chars (to + INSN_SIZE, inst.instruction, INSN_SIZE);
      }
*************** opcode_lookup (char **str)
*** 14590,14596 ****
  	as_warn (_("conditional infixes are deprecated in unified syntax"));
        affix = base + (opcode->tag - OT_odd_infix_0);
        cond = hash_find_n (arm_cond_hsh, affix, 2);
!       assert (cond);
  
        inst.cond = cond->value;
        return opcode;
--- 14590,14596 ----
  	as_warn (_("conditional infixes are deprecated in unified syntax"));
        affix = base + (opcode->tag - OT_odd_infix_0);
        cond = hash_find_n (arm_cond_hsh, affix, 2);
!       gas_assert (cond);
  
        inst.cond = cond->value;
        return opcode;
*************** md_assemble (char *str)
*** 14784,14790 ****
  
        if (!(inst.error || inst.relax))
  	{
! 	  assert (inst.instruction < 0xe800 || inst.instruction > 0xffff);
  	  inst.size = (inst.instruction > 0xffff ? 4 : 2);
  	  if (inst.size_req && inst.size_req != inst.size)
  	    {
--- 14784,14790 ----
  
        if (!(inst.error || inst.relax))
  	{
! 	  gas_assert (inst.instruction < 0xe800 || inst.instruction > 0xffff);
  	  inst.size = (inst.instruction > 0xffff ? 4 : 2);
  	  if (inst.size_req && inst.size_req != inst.size)
  	    {
*************** md_assemble (char *str)
*** 14795,14801 ****
  
        /* Something has gone badly wrong if we try to relax a fixed size
           instruction.  */
!       assert (inst.size_req == 0 || !inst.relax);
  
        ARM_MERGE_FEATURE_SETS (thumb_arch_used, thumb_arch_used,
  			      *opcode->tvariant);
--- 14795,14801 ----
  
        /* Something has gone badly wrong if we try to relax a fixed size
           instruction.  */
!       gas_assert (inst.size_req == 0 || !inst.relax);
  
        ARM_MERGE_FEATURE_SETS (thumb_arch_used, thumb_arch_used,
  			      *opcode->tvariant);
*************** arm_handle_align (fragS * fragP)
*** 17628,17634 ****
    if (bytes > MAX_MEM_FOR_RS_ALIGN_CODE)
      bytes &= MAX_MEM_FOR_RS_ALIGN_CODE;
  
!   assert ((fragP->tc_frag_data & MODE_RECORDED) != 0);
  
    if (fragP->tc_frag_data & (~ MODE_RECORDED))
      {
--- 17628,17634 ----
    if (bytes > MAX_MEM_FOR_RS_ALIGN_CODE)
      bytes &= MAX_MEM_FOR_RS_ALIGN_CODE;
  
!   gas_assert ((fragP->tc_frag_data & MODE_RECORDED) != 0);
  
    if (fragP->tc_frag_data & (~ MODE_RECORDED))
      {
*************** validate_immediate_twopart (unsigned int
*** 18338,18344 ****
  	  }
  	else
  	  {
! 	    assert (a & 0xff000000);
  	    * highpart = (a >> 24) | ((i + 8) << 7);
  	  }
  
--- 18338,18344 ----
  	  }
  	else
  	  {
! 	    gas_assert (a & 0xff000000);
  	    * highpart = (a >> 24) | ((i + 8) << 7);
  	  }
  
*************** md_apply_fix (fixS *	fixP,
*** 18567,18573 ****
    int		 sign;
    char *	 buf = fixP->fx_where + fixP->fx_frag->fr_literal;
  
!   assert (fixP->fx_r_type <= BFD_RELOC_UNUSED);
  
    /* Note whether this will delete the relocation.  */
  
--- 18567,18573 ----
    int		 sign;
    char *	 buf = fixP->fx_where + fixP->fx_frag->fr_literal;
  
!   gas_assert (fixP->fx_r_type <= BFD_RELOC_UNUSED);
  
    /* Note whether this will delete the relocation.  */
  
*************** md_apply_fix (fixS *	fixP,
*** 19617,19623 ****
     case BFD_RELOC_ARM_ALU_SB_G1_NC:
     case BFD_RELOC_ARM_ALU_SB_G1:
     case BFD_RELOC_ARM_ALU_SB_G2:
!      assert (!fixP->fx_done);
       if (!seg->use_rela_p)
         {
           bfd_vma insn;
--- 19617,19623 ----
     case BFD_RELOC_ARM_ALU_SB_G1_NC:
     case BFD_RELOC_ARM_ALU_SB_G1:
     case BFD_RELOC_ARM_ALU_SB_G2:
!      gas_assert (!fixP->fx_done);
       if (!seg->use_rela_p)
         {
           bfd_vma insn;
*************** md_apply_fix (fixS *	fixP,
*** 19659,19665 ****
      case BFD_RELOC_ARM_LDR_SB_G0:
      case BFD_RELOC_ARM_LDR_SB_G1:
      case BFD_RELOC_ARM_LDR_SB_G2:
!       assert (!fixP->fx_done);
        if (!seg->use_rela_p)
          {
            bfd_vma insn;
--- 19659,19665 ----
      case BFD_RELOC_ARM_LDR_SB_G0:
      case BFD_RELOC_ARM_LDR_SB_G1:
      case BFD_RELOC_ARM_LDR_SB_G2:
!       gas_assert (!fixP->fx_done);
        if (!seg->use_rela_p)
          {
            bfd_vma insn;
*************** md_apply_fix (fixS *	fixP,
*** 19698,19704 ****
      case BFD_RELOC_ARM_LDRS_SB_G0:
      case BFD_RELOC_ARM_LDRS_SB_G1:
      case BFD_RELOC_ARM_LDRS_SB_G2:
!       assert (!fixP->fx_done);
        if (!seg->use_rela_p)
          {
            bfd_vma insn;
--- 19698,19704 ----
      case BFD_RELOC_ARM_LDRS_SB_G0:
      case BFD_RELOC_ARM_LDRS_SB_G1:
      case BFD_RELOC_ARM_LDRS_SB_G2:
!       gas_assert (!fixP->fx_done);
        if (!seg->use_rela_p)
          {
            bfd_vma insn;
*************** md_apply_fix (fixS *	fixP,
*** 19738,19744 ****
      case BFD_RELOC_ARM_LDC_SB_G0:
      case BFD_RELOC_ARM_LDC_SB_G1:
      case BFD_RELOC_ARM_LDC_SB_G2:
!       assert (!fixP->fx_done);
        if (!seg->use_rela_p)
          {
            bfd_vma insn;
--- 19738,19744 ----
      case BFD_RELOC_ARM_LDC_SB_G0:
      case BFD_RELOC_ARM_LDC_SB_G1:
      case BFD_RELOC_ARM_LDC_SB_G2:
!       gas_assert (!fixP->fx_done);
        if (!seg->use_rela_p)
          {
            bfd_vma insn;
*************** arm_apply_sym_value (struct fix * fixP)
*** 21808,21812 ****
    return 0;
  }
  #endif /* OBJ_ELF */
- 
- 
--- 21808,21810 ----
Only in src.assert/gas/config: tc-arm.c.orig
diff -crp src.head/gas/config/tc-cr16.c src.assert/gas/config/tc-cr16.c
*** src.head/gas/config/tc-cr16.c	Tue Jun 16 09:07:24 2009
--- src.assert/gas/config/tc-cr16.c	Tue Jun 16 09:39:05 2009
*************** tc_gen_reloc (asection *section ATTRIBUT
*** 586,592 ****
  	}
  #endif
  
!   assert ((int) fixP->fx_r_type > 0);
    reloc->howto = bfd_reloc_type_lookup (stdoutput, fixP->fx_r_type);
  
    if (reloc->howto == NULL)
--- 586,592 ----
  	}
  #endif
  
!   gas_assert ((int) fixP->fx_r_type > 0);
    reloc->howto = bfd_reloc_type_lookup (stdoutput, fixP->fx_r_type);
  
    if (reloc->howto == NULL)
*************** tc_gen_reloc (asection *section ATTRIBUT
*** 597,603 ****
                      bfd_get_reloc_code_name (fixP->fx_r_type));
        return NULL;
      }
!   assert (!fixP->fx_pcrel == !reloc->howto->pc_relative);
  
    return reloc;
  }
--- 597,603 ----
                      bfd_get_reloc_code_name (fixP->fx_r_type));
        return NULL;
      }
!   gas_assert (!fixP->fx_pcrel == !reloc->howto->pc_relative);
  
    return reloc;
  }
Only in src.assert/gas/config: tc-cr16.c.orig
diff -crp src.head/gas/config/tc-cris.c src.assert/gas/config/tc-cris.c
*** src.head/gas/config/tc-cris.c	Tue Jun 16 09:07:24 2009
--- src.assert/gas/config/tc-cris.c	Tue Jun 16 09:39:05 2009
*************** tc_gen_reloc (asection *section ATTRIBUT
*** 3939,3945 ****
      }
  
    relP = (arelent *) xmalloc (sizeof (arelent));
!   assert (relP != 0);
    relP->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
    *relP->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy);
    relP->address = fixP->fx_frag->fr_address + fixP->fx_where;
--- 3939,3945 ----
      }
  
    relP = (arelent *) xmalloc (sizeof (arelent));
!   gas_assert (relP != 0);
    relP->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
    *relP->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy);
    relP->address = fixP->fx_frag->fr_address + fixP->fx_where;
Only in src.assert/gas/config: tc-cris.c.orig
diff -crp src.head/gas/config/tc-crx.c src.assert/gas/config/tc-crx.c
*** src.head/gas/config/tc-crx.c	Tue Jun 16 09:07:24 2009
--- src.assert/gas/config/tc-crx.c	Tue Jun 16 09:39:05 2009
*************** tc_gen_reloc (asection *section ATTRIBUT
*** 351,357 ****
  	}
      }
  
!   assert ((int) fixP->fx_r_type > 0);
    reloc->howto = bfd_reloc_type_lookup (stdoutput, fixP->fx_r_type);
  
    if (reloc->howto == (reloc_howto_type *) NULL)
--- 351,357 ----
  	}
      }
  
!   gas_assert ((int) fixP->fx_r_type > 0);
    reloc->howto = bfd_reloc_type_lookup (stdoutput, fixP->fx_r_type);
  
    if (reloc->howto == (reloc_howto_type *) NULL)
*************** tc_gen_reloc (asection *section ATTRIBUT
*** 362,368 ****
  		    bfd_get_reloc_code_name (fixP->fx_r_type));
        return NULL;
      }
!   assert (!fixP->fx_pcrel == !reloc->howto->pc_relative);
  
    return reloc;
  }
--- 362,368 ----
  		    bfd_get_reloc_code_name (fixP->fx_r_type));
        return NULL;
      }
!   gas_assert (!fixP->fx_pcrel == !reloc->howto->pc_relative);
  
    return reloc;
  }
diff -crp src.head/gas/config/tc-d30v.c src.assert/gas/config/tc-d30v.c
*** src.head/gas/config/tc-d30v.c	Tue Jun 16 09:07:24 2009
--- src.assert/gas/config/tc-d30v.c	Tue Jun 16 09:39:05 2009
*************** d30v_align (int n, char *pfill, symbolS 
*** 1516,1522 ****
        valueT       old_value;
        valueT       new_value;
  
!       assert (S_GET_SEGMENT (label) == now_seg);
  
        old_frag  = symbol_get_frag (label);
        old_value = S_GET_VALUE (label);
--- 1516,1522 ----
        valueT       old_value;
        valueT       new_value;
  
!       gas_assert (S_GET_SEGMENT (label) == now_seg);
  
        old_frag  = symbol_get_frag (label);
        old_value = S_GET_VALUE (label);
*************** const pseudo_typeS md_pseudo_table[] =
*** 2113,2116 ****
    { "sect.s", s_d30v_section, 0 },
    { NULL, NULL, 0 }
  };
- 
--- 2113,2115 ----
diff -crp src.head/gas/config/tc-dlx.c src.assert/gas/config/tc-dlx.c
*** src.head/gas/config/tc-dlx.c	Tue Jun 16 09:07:24 2009
--- src.assert/gas/config/tc-dlx.c	Tue Jun 16 09:39:05 2009
*************** tc_gen_reloc (asection *section ATTRIBUT
*** 1203,1209 ****
        return NULL;
      }
  
!   assert (!fixP->fx_pcrel == !reloc->howto->pc_relative);
  
    reloc->sym_ptr_ptr = xmalloc (sizeof (asymbol *));
    *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy);
--- 1203,1209 ----
        return NULL;
      }
  
!   gas_assert (!fixP->fx_pcrel == !reloc->howto->pc_relative);
  
    reloc->sym_ptr_ptr = xmalloc (sizeof (asymbol *));
    *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy);
*************** dlx_pop_insert (void)
*** 1235,1238 ****
    pop_insert (dlx_pseudo_table);
    return ;
  }
- 
--- 1235,1237 ----
diff -crp src.head/gas/config/tc-hppa.c src.assert/gas/config/tc-hppa.c
*** src.head/gas/config/tc-hppa.c	Tue Jun 16 09:07:24 2009
--- src.assert/gas/config/tc-hppa.c	Tue Jun 16 09:39:05 2009
*************** tc_gen_reloc (asection *section, fixS *f
*** 1388,1395 ****
    if (fixp->fx_addsy == 0)
      return &no_relocs;
  
!   assert (hppa_fixp != 0);
!   assert (section != 0);
  
    reloc = xmalloc (sizeof (arelent));
  
--- 1388,1395 ----
    if (fixp->fx_addsy == 0)
      return &no_relocs;
  
!   gas_assert (hppa_fixp != 0);
!   gas_assert (section != 0);
  
    reloc = xmalloc (sizeof (arelent));
  
*************** tc_gen_reloc (asection *section, fixS *f
*** 1434,1440 ****
    switch (fixp->fx_r_type)
      {
      default:
!       assert (n_relocs == 1);
  
        code = *codes[0];
  
--- 1434,1440 ----
    switch (fixp->fx_r_type)
      {
      default:
!       gas_assert (n_relocs == 1);
  
        code = *codes[0];
  
*************** tc_gen_reloc (asection *section, fixS *f
*** 1488,1494 ****
  					    (bfd_reloc_code_real_type) code);
        reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
  
!       assert (reloc->howto && (unsigned int) code == reloc->howto->type);
        break;
      }
  #else /* OBJ_SOM */
--- 1488,1494 ----
  					    (bfd_reloc_code_real_type) code);
        reloc->address = fixp->fx_frag->fr_address + fixp->fx_where;
  
!       gas_assert (reloc->howto && (unsigned int) code == reloc->howto->type);
        break;
      }
  #else /* OBJ_SOM */
*************** tc_gen_reloc (asection *section, fixS *f
*** 1511,1517 ****
  	  /* The only time we ever use a R_COMP2 fixup is for the difference
  	     of two symbols.  With that in mind we fill in all four
  	     relocs now and break out of the loop.  */
! 	  assert (i == 1);
  	  relocs[0]->sym_ptr_ptr
  	    = (asymbol **) bfd_abs_section_ptr->symbol_ptr_ptr;
  	  relocs[0]->howto
--- 1511,1517 ----
  	  /* The only time we ever use a R_COMP2 fixup is for the difference
  	     of two symbols.  With that in mind we fill in all four
  	     relocs now and break out of the loop.  */
! 	  gas_assert (i == 1);
  	  relocs[0]->sym_ptr_ptr
  	    = (asymbol **) bfd_abs_section_ptr->symbol_ptr_ptr;
  	  relocs[0]->howto
*************** md_assemble (char *str)
*** 5728,5734 ****
    char *to;
  
    /* The had better be something to assemble.  */
!   assert (str);
  
    /* If we are within a procedure definition, make sure we've
       defined a label for the procedure; handle case where the
--- 5728,5734 ----
    char *to;
  
    /* The had better be something to assemble.  */
!   gas_assert (str);
  
    /* If we are within a procedure definition, make sure we've
       defined a label for the procedure; handle case where the
*************** hppa_elf_mark_end_of_function (void)
*** 6433,6439 ****
  	  symbolP = symbol_new (name, now_seg, (valueT) (frag_now_fix () - 4),
  				frag_now);
  
! 	  assert (symbolP);
  	  S_CLEAR_EXTERNAL (symbolP);
  	  symbol_table_insert (symbolP);
  	}
--- 6433,6439 ----
  	  symbolP = symbol_new (name, now_seg, (valueT) (frag_now_fix () - 4),
  				frag_now);
  
! 	  gas_assert (symbolP);
  	  S_CLEAR_EXTERNAL (symbolP);
  	  symbol_table_insert (symbolP);
  	}
*************** hppa_force_relocation (struct fix *fixp)
*** 8465,8471 ****
      return 1;
  #endif
  
!   assert (fixp->fx_addsy != NULL);
  
    /* Ensure we emit a relocation for global symbols so that dynamic
       linking works.  */
--- 8465,8471 ----
      return 1;
  #endif
  
!   gas_assert (fixp->fx_addsy != NULL);
  
    /* Ensure we emit a relocation for global symbols so that dynamic
       linking works.  */
Only in src.assert/gas/config: tc-hppa.c.orig
diff -crp src.head/gas/config/tc-i370.c src.assert/gas/config/tc-i370.c
*** src.head/gas/config/tc-i370.c	Tue Jun 16 09:07:24 2009
--- src.assert/gas/config/tc-i370.c	Tue Jun 16 09:39:05 2009
*************** md_assemble (char *str)
*** 1923,1929 ****
      {
        const struct i370_macro *macro;
  
!       assert (i370_macro_hash);
        macro = (const struct i370_macro *) hash_find (i370_macro_hash, str);
        if (macro == (const struct i370_macro *) NULL)
          as_bad ("Unrecognized opcode: `%s'", str);
--- 1923,1929 ----
      {
        const struct i370_macro *macro;
  
!       gas_assert (i370_macro_hash);
        macro = (const struct i370_macro *) hash_find (i370_macro_hash, str);
        if (macro == (const struct i370_macro *) NULL)
          as_bad ("Unrecognized opcode: `%s'", str);
*************** const pseudo_typeS md_pseudo_table[] =
*** 2668,2671 ****
  
    { NULL,       NULL,		0 }
  };
- 
--- 2668,2670 ----
diff -crp src.head/gas/config/tc-i386-intel.c src.assert/gas/config/tc-i386-intel.c
*** src.head/gas/config/tc-i386-intel.c	Tue Jun 16 09:07:24 2009
--- src.assert/gas/config/tc-i386-intel.c	Tue Jun 16 10:11:03 2009
*************** i386_intel_operand (char *operand_string
*** 468,476 ****
    intel_state.index = NULL;
    intel_state.seg = NULL;
    operand_type_set (&intel_state.reloc_types, ~0);
!   assert (!intel_state.in_offset);
!   assert (!intel_state.in_bracket);
!   assert (!intel_state.in_scale);
  
    saved_input_line_pointer = input_line_pointer;
    input_line_pointer = buf = xstrdup (operand_string);
--- 468,476 ----
    intel_state.index = NULL;
    intel_state.seg = NULL;
    operand_type_set (&intel_state.reloc_types, ~0);
!   gas_assert (!intel_state.in_offset);
!   gas_assert (!intel_state.in_bracket);
!   gas_assert (!intel_state.in_scale);
  
    saved_input_line_pointer = input_line_pointer;
    input_line_pointer = buf = xstrdup (operand_string);
*************** i386_intel_operand (char *operand_string
*** 501,509 ****
    input_line_pointer = saved_input_line_pointer;
    free (buf);
  
!   assert (!intel_state.in_offset);
!   assert (!intel_state.in_bracket);
!   assert (!intel_state.in_scale);
  
    if (!ret)
      return 0;
--- 501,509 ----
    input_line_pointer = saved_input_line_pointer;
    free (buf);
  
!   gas_assert (!intel_state.in_offset);
!   gas_assert (!intel_state.in_bracket);
!   gas_assert (!intel_state.in_scale);
  
    if (!ret)
      return 0;
diff -crp src.head/gas/config/tc-i386.c src.assert/gas/config/tc-i386.c
*** src.head/gas/config/tc-i386.c	Tue Jun 16 09:07:24 2009
--- src.assert/gas/config/tc-i386.c	Tue Jun 16 10:01:20 2009
*************** operand_size_match (const template *t)
*** 1496,1502 ****
      return match;
  
    /* Check reverse.  */
!   assert (i.operands == 2);
  
    match = 1;
    for (j = 0; j < 2; j++)
--- 1496,1502 ----
      return match;
  
    /* Check reverse.  */
!   gas_assert (i.operands == 2);
  
    match = 1;
    for (j = 0; j < 2; j++)
*************** build_vex_prefix (const template *t)
*** 2564,2570 ****
        i.op[xchg] = i.op[0];
        i.op[0] = temp_op;
  
!       assert (i.rm.mode == 3);
  
        i.rex = REX_R;
        xchg = i.rm.regmem;
--- 2564,2570 ----
        i.op[xchg] = i.op[0];
        i.op[0] = temp_op;
  
!       gas_assert (i.rm.mode == 3);
  
        i.rex = REX_R;
        xchg = i.rm.regmem;
*************** process_immext (void)
*** 2681,2687 ****
       AVX instructions also use this encoding, for some of
       3 argument instructions.  */
  
!   assert (i.imm_operands == 0
  	  && (i.operands <= 2
  	      || (i.tm.opcode_modifier.vex
  		  && i.operands <= 4)));
--- 2681,2687 ----
       AVX instructions also use this encoding, for some of
       3 argument instructions.  */
  
!   gas_assert (i.imm_operands == 0
  	  && (i.operands <= 2
  	      || (i.tm.opcode_modifier.vex
  		  && i.operands <= 4)));
*************** finalize_imm (void)
*** 4502,4508 ****
        return 0;
  
    i.types[2] = operand_type_and (i.types[2], i.tm.operand_types[2]);
!   assert (operand_type_check (i.types[2], imm) == 0);
  
    return 1;
  }
--- 4502,4508 ----
        return 0;
  
    i.types[2] = operand_type_and (i.types[2], i.tm.operand_types[2]);
!   gas_assert (operand_type_check (i.types[2], imm) == 0);
  
    return 1;
  }
*************** process_operands (void)
*** 4537,4550 ****
        unsigned int j;
  
        /* The destination must be an xmm register.  */
!       assert (i.reg_operands
  	      && MAX_OPERANDS > dup
  	      && operand_type_equal (&i.types[dest], &regxmm));
  
        if (i.tm.opcode_modifier.firstxmm0)
  	{
  	  /* The first operand is implicit and must be xmm0.  */
! 	  assert (operand_type_equal (&i.types[0], &regxmm));
  	  if (i.op[0].regs->reg_num != 0)
  	    return bad_implicit_operand (1);
  
--- 4537,4550 ----
        unsigned int j;
  
        /* The destination must be an xmm register.  */
!       gas_assert (i.reg_operands
  	      && MAX_OPERANDS > dup
  	      && operand_type_equal (&i.types[dest], &regxmm));
  
        if (i.tm.opcode_modifier.firstxmm0)
  	{
  	  /* The first operand is implicit and must be xmm0.  */
! 	  gas_assert (operand_type_equal (&i.types[0], &regxmm));
  	  if (i.op[0].regs->reg_num != 0)
  	    return bad_implicit_operand (1);
  
*************** process_operands (void)
*** 4569,4575 ****
  	}
        else if (i.tm.opcode_modifier.implicit1stxmm0)
  	{ 
! 	  assert ((MAX_OPERANDS - 1) > dup
  		  && i.tm.opcode_modifier.vex3sources);
  
  	  /* Add the implicit xmm0 for instructions with VEX prefix
--- 4569,4575 ----
  	}
        else if (i.tm.opcode_modifier.implicit1stxmm0)
  	{ 
! 	  gas_assert ((MAX_OPERANDS - 1) > dup
  		  && i.tm.opcode_modifier.vex3sources);
  
  	  /* Add the implicit xmm0 for instructions with VEX prefix
*************** duplicate:
*** 4615,4621 ****
        unsigned int j;
  
        /* The first operand is implicit and must be xmm0/ymm0.  */
!       assert (i.reg_operands
  	      && (operand_type_equal (&i.types[0], &regxmm)
  		  || operand_type_equal (&i.types[0], &regymm)));
        if (i.op[0].regs->reg_num != 0)
--- 4615,4621 ----
        unsigned int j;
  
        /* The first operand is implicit and must be xmm0/ymm0.  */
!       gas_assert (i.reg_operands
  	      && (operand_type_equal (&i.types[0], &regxmm)
  		  || operand_type_equal (&i.types[0], &regymm)));
        if (i.op[0].regs->reg_num != 0)
*************** duplicate:
*** 4648,4654 ****
        else
  	first_reg_op = 1;
        /* Pretend we saw the extra register operand.  */
!       assert (i.reg_operands == 1
  	      && i.op[first_reg_op + 1].regs == 0);
        i.op[first_reg_op + 1].regs = i.op[first_reg_op].regs;
        i.types[first_reg_op + 1] = i.types[first_reg_op];
--- 4648,4654 ----
        else
  	first_reg_op = 1;
        /* Pretend we saw the extra register operand.  */
!       gas_assert (i.reg_operands == 1
  	      && i.op[first_reg_op + 1].regs == 0);
        i.op[first_reg_op + 1].regs = i.op[first_reg_op].regs;
        i.types[first_reg_op + 1] = i.types[first_reg_op];
*************** build_modrm_byte (void)
*** 4765,4771 ****
        /* This instruction must have 4 operands: 4 register operands
  	 or 3 register operands plus 1 memory operand.  It must have
  	 VexNDS and VexImmExt.  */
!       assert (i.operands == 4
  	      && (i.reg_operands == 4
  		  || (i.reg_operands == 3 && i.mem_operands == 1))
  	      && i.tm.opcode_modifier.vexnds
--- 4765,4771 ----
        /* This instruction must have 4 operands: 4 register operands
  	 or 3 register operands plus 1 memory operand.  It must have
  	 VexNDS and VexImmExt.  */
!       gas_assert (i.operands == 4
  	      && (i.reg_operands == 4
  		  || (i.reg_operands == 3 && i.mem_operands == 1))
  	      && i.tm.opcode_modifier.vexnds
*************** build_modrm_byte (void)
*** 4822,4828 ****
  	     which may be the first or the last operand.  Otherwise,
  	     the first operand must be shift count register (cl) or it
  	     is an instruction with VexNDS. */
! 	  assert (i.imm_operands == 1
  		  || (i.imm_operands == 0
  		      && (i.tm.opcode_modifier.vexnds
  			  || i.types[0].bitfield.shiftcount)));
--- 4822,4828 ----
  	     which may be the first or the last operand.  Otherwise,
  	     the first operand must be shift count register (cl) or it
  	     is an instruction with VexNDS. */
! 	  gas_assert (i.imm_operands == 1
  		  || (i.imm_operands == 0
  		      && (i.tm.opcode_modifier.vexnds
  			  || i.types[0].bitfield.shiftcount)));
*************** build_modrm_byte (void)
*** 4840,4846 ****
  	     For instructions with VexNDS, if the first operand
  	     an imm8, the source operand is the 2nd one.  If the last
  	     operand is imm8, the source operand is the first one.  */
! 	  assert ((i.imm_operands == 2
  		   && i.types[0].bitfield.imm8
  		   && i.types[1].bitfield.imm8)
  		  || (i.tm.opcode_modifier.vexnds
--- 4840,4846 ----
  	     For instructions with VexNDS, if the first operand
  	     an imm8, the source operand is the 2nd one.  If the last
  	     operand is imm8, the source operand is the first one.  */
! 	  gas_assert ((i.imm_operands == 2
  		   && i.types[0].bitfield.imm8
  		   && i.types[1].bitfield.imm8)
  		  || (i.tm.opcode_modifier.vexnds
*************** build_modrm_byte (void)
*** 4931,4937 ****
  	      for (op = 0; op < i.operands; op++)
  		if (operand_type_check (i.types[op], anymem))
  		  break;
! 	      assert (op < i.operands);
  
  	  default_seg = &ds;
  
--- 4931,4937 ----
  	      for (op = 0; op < i.operands; op++)
  		if (operand_type_check (i.types[op], anymem))
  		  break;
! 	      gas_assert (op < i.operands);
  
  	  default_seg = &ds;
  
*************** build_modrm_byte (void)
*** 5109,5115 ****
  		 holds the correct displacement size.  */
  	      expressionS *exp;
  
! 	      assert (i.op[op].disps == 0);
  	      exp = &disp_expressions[i.disp_operands++];
  	      i.op[op].disps = exp;
  	      exp->X_op = O_constant;
--- 5109,5115 ----
  		 holds the correct displacement size.  */
  	      expressionS *exp;
  
! 	      gas_assert (i.op[op].disps == 0);
  	      exp = &disp_expressions[i.disp_operands++];
  	      i.op[op].disps = exp;
  	      exp->X_op = O_constant;
*************** build_modrm_byte (void)
*** 5153,5169 ****
  		{
  		  /* For instructions with VexNDS, the register-only
  		     source operand is encoded in VEX prefix. */
! 		  assert (mem != (unsigned int) ~0);
  
  		  if (op > mem)
  		    {
  		      vex_reg = op++;
! 		      assert (op < i.operands);
  		    }
  		  else
  		    {
  		      vex_reg = op + 1;
! 		      assert (vex_reg < i.operands);
  		    }
  		}
  	      else if (i.tm.opcode_modifier.vexndd)
--- 5153,5169 ----
  		{
  		  /* For instructions with VexNDS, the register-only
  		     source operand is encoded in VEX prefix. */
! 		  gas_assert (mem != (unsigned int) ~0);
  
  		  if (op > mem)
  		    {
  		      vex_reg = op++;
! 		      gas_assert (op < i.operands);
  		    }
  		  else
  		    {
  		      vex_reg = op + 1;
! 		      gas_assert (vex_reg < i.operands);
  		    }
  		}
  	      else if (i.tm.opcode_modifier.vexndd)
*************** build_modrm_byte (void)
*** 5171,5186 ****
  		  /* For instructions with VexNDD, there should be
  		     no memory operand and the register destination
  		     is encoded in VEX prefix.  */
! 		  assert (i.mem_operands == 0
  			  && (op + 2) == i.operands);
  		  vex_reg = op + 1;
  		}
  	      else
! 		assert (op < i.operands);
  
  	      if (vex_reg != (unsigned int) ~0)
  		{
! 		  assert (i.reg_operands == 2);
  
  		  if (!operand_type_equal (&i.tm.operand_types[vex_reg],
  					   & regxmm)
--- 5171,5186 ----
  		  /* For instructions with VexNDD, there should be
  		     no memory operand and the register destination
  		     is encoded in VEX prefix.  */
! 		  gas_assert (i.mem_operands == 0
  			  && (op + 2) == i.operands);
  		  vex_reg = op + 1;
  		}
  	      else
! 		gas_assert (op < i.operands);
  
  	      if (vex_reg != (unsigned int) ~0)
  		{
! 		  gas_assert (i.reg_operands == 2);
  
  		  if (!operand_type_equal (&i.tm.operand_types[vex_reg],
  					   & regxmm)
*************** output_disp (fragS *insn_start_frag, off
*** 5640,5646 ****
  	      int pcrel = (i.flags[n] & Operand_PCrel) != 0;
  
  	      /* We can't have 8 bit displacement here.  */
! 	      assert (!i.types[n].bitfield.disp8);
  
  	      /* The PC relative address is computed relative
  		 to the instruction boundary, so in case immediate
--- 5640,5646 ----
  	      int pcrel = (i.flags[n] & Operand_PCrel) != 0;
  
  	      /* We can't have 8 bit displacement here.  */
! 	      gas_assert (!i.types[n].bitfield.disp8);
  
  	      /* The PC relative address is computed relative
  		 to the instruction boundary, so in case immediate
*************** output_disp (fragS *insn_start_frag, off
*** 5655,5666 ****
  		      {
  			/* Only one immediate is allowed for PC
  			   relative address.  */
! 			assert (sz == 0);
  			sz = imm_size (n1);
  			i.op[n].disps->X_add_number -= sz;
  		      }
  		  /* We should find the immediate.  */
! 		  assert (sz != 0);
  		}
  
  	      p = frag_more (size);
--- 5655,5666 ----
  		      {
  			/* Only one immediate is allowed for PC
  			   relative address.  */
! 			gas_assert (sz == 0);
  			sz = imm_size (n1);
  			i.op[n].disps->X_add_number -= sz;
  		      }
  		  /* We should find the immediate.  */
! 		  gas_assert (sz != 0);
  		}
  
  	      p = frag_more (size);
*************** i386_index_check (const char *operand_st
*** 6531,6537 ****
  		   : i386_regtab[j].reg_type.bitfield.reg16)
  		&& i386_regtab[j].reg_num == expected)
  	      break;
! 	  assert (j < i386_regtab_size);
  	  as_warn (_("`%s' is not valid here (expected `%c%s%s%c')"),
  		   operand_string,
  		   intel_syntax ? '[' : '(',
--- 6531,6537 ----
  		   : i386_regtab[j].reg_type.bitfield.reg16)
  		&& i386_regtab[j].reg_num == expected)
  	      break;
! 	  gas_assert (j < i386_regtab_size);
  	  as_warn (_("`%s' is not valid here (expected `%c%s%s%c')"),
  		   operand_string,
  		   intel_syntax ? '[' : '(',
*************** md_operand (expressionS *e)
*** 7546,7552 ****
        break;
  
      case '[':
!       assert (intel_syntax);
        end = input_line_pointer++;
        expression (e);
        if (*input_line_pointer == ']')
--- 7546,7552 ----
        break;
  
      case '[':
!       gas_assert (intel_syntax);
        end = input_line_pointer++;
        expression (e);
        if (*input_line_pointer == ']')
*************** tc_gen_reloc (section, fixp)
*** 8276,8282 ****
  		    bfd_get_reloc_code_name (code));
        /* Set howto to a garbage value so that we can keep going.  */
        rel->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_32);
!       assert (rel->howto != NULL);
      }
  
    return rel;
--- 8276,8282 ----
  		    bfd_get_reloc_code_name (code));
        /* Set howto to a garbage value so that we can keep going.  */
        rel->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_32);
!       gas_assert (rel->howto != NULL);
      }
  
    return rel;
*************** tc_x86_frame_initial_instructions (void)
*** 8326,8332 ****
  
        input_line_pointer = sp[flag_code >> 1];
        tc_x86_parse_to_dw2regnum (&exp);
!       assert (exp.X_op == O_constant);
        sp_regno[flag_code >> 1] = exp.X_add_number;
        input_line_pointer = saved_input;
      }
--- 8326,8332 ----
  
        input_line_pointer = sp[flag_code >> 1];
        tc_x86_parse_to_dw2regnum (&exp);
!       gas_assert (exp.X_op == O_constant);
        sp_regno[flag_code >> 1] = exp.X_add_number;
        input_line_pointer = saved_input;
      }
Only in src.assert/gas/config: tc-i386.c.orig
Only in src.assert/gas/config: tc-i386.c.rej
diff -crp src.head/gas/config/tc-i860.c src.assert/gas/config/tc-i860.c
*** src.head/gas/config/tc-i860.c	Tue Jun 16 09:07:24 2009
--- src.assert/gas/config/tc-i860.c	Tue Jun 16 09:39:05 2009
*************** md_assemble (char *str)
*** 261,267 ****
    int i;
    struct i860_it pseudo[3];
  
!   assert (str);
    fc = 0;
  
    /* Assemble the instruction.  */
--- 261,267 ----
    int i;
    struct i860_it pseudo[3];
  
!   gas_assert (str);
    fc = 0;
  
    /* Assemble the instruction.  */
*************** i860_check_label (symbolS *labelsym)
*** 1489,1492 ****
        input_line_pointer++;
      }
  }
- 
--- 1489,1491 ----
diff -crp src.head/gas/config/tc-i960.c src.assert/gas/config/tc-i960.c
*** src.head/gas/config/tc-i960.c	Tue Jun 16 09:07:24 2009
--- src.assert/gas/config/tc-i960.c	Tue Jun 16 09:39:05 2009
*************** tc_gen_reloc (asection *section ATTRIBUT
*** 2644,2650 ****
        return NULL;
      }
  
!   assert (!fixP->fx_pcrel == !reloc->howto->pc_relative);
  
    reloc->sym_ptr_ptr = xmalloc (sizeof (asymbol *));
    *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy);
--- 2644,2650 ----
        return NULL;
      }
  
!   gas_assert (!fixP->fx_pcrel == !reloc->howto->pc_relative);
  
    reloc->sym_ptr_ptr = xmalloc (sizeof (asymbol *));
    *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy);
diff -crp src.head/gas/config/tc-ia64.c src.assert/gas/config/tc-ia64.c
*** src.head/gas/config/tc-ia64.c	Tue Jun 16 09:07:24 2009
--- src.assert/gas/config/tc-ia64.c	Tue Jun 16 09:39:05 2009
*************** ia64_estimate_size_before_relax (fragS *
*** 2817,2823 ****
  
    /* fr_var carries the max_chars that we created the fragment with.
       We must, of course, have allocated enough memory earlier.  */
!   assert (frag->fr_var >= size);
  
    return frag->fr_fix + size;
  }
--- 2817,2823 ----
  
    /* fr_var carries the max_chars that we created the fragment with.
       We must, of course, have allocated enough memory earlier.  */
!   gas_assert (frag->fr_var >= size);
  
    return frag->fr_fix + size;
  }
*************** ia64_convert_frag (fragS *frag)
*** 2848,2854 ****
  
    /* fr_var carries the max_chars that we created the fragment with.
       We must, of course, have allocated enough memory earlier.  */
!   assert (frag->fr_var >= size);
  
    /* Initialize the header area. fr_offset is initialized with
       unwind.personality_routine.  */
--- 2848,2854 ----
  
    /* fr_var carries the max_chars that we created the fragment with.
       We must, of course, have allocated enough memory earlier.  */
!   gas_assert (frag->fr_var >= size);
  
    /* Initialize the header area. fr_offset is initialized with
       unwind.personality_routine.  */
*************** parse_operands (struct ia64_opcode *ides
*** 5886,5892 ****
    char *first_arg = 0, *end, *saved_input_pointer;
    unsigned int sof;
  
!   assert (strlen (idesc->name) <= 128);
  
    strcpy (mnemonic, idesc->name);
    if (idesc->operands[2] == IA64_OPND_SOF
--- 5886,5892 ----
    char *first_arg = 0, *end, *saved_input_pointer;
    unsigned int sof;
  
!   gas_assert (strlen (idesc->name) <= 128);
  
    strcpy (mnemonic, idesc->name);
    if (idesc->operands[2] == IA64_OPND_SOF
*************** build_insn (struct slot *slot, bfd_vma *
*** 6210,6216 ****
        else if (slot->opnd[i].X_op == O_big)
  	{
  	  /* This must be the value 0x10000000000000000.  */
! 	  assert (idesc->operands[i] == IA64_OPND_IMM8M1U8);
  	  val = 0;
  	}
        else
--- 6210,6216 ----
        else if (slot->opnd[i].X_op == O_big)
  	{
  	  /* This must be the value 0x10000000000000000.  */
! 	  gas_assert (idesc->operands[i] == IA64_OPND_IMM8M1U8);
  	  val = 0;
  	}
        else
Only in src.assert/gas/config: tc-ia64.c.orig
diff -crp src.head/gas/config/tc-iq2000.c src.assert/gas/config/tc-iq2000.c
*** src.head/gas/config/tc-iq2000.c	Tue Jun 16 09:07:24 2009
--- src.assert/gas/config/tc-iq2000.c	Tue Jun 16 09:39:05 2009
*************** iq2000_record_hi16 (int    reloc_type,
*** 534,540 ****
  {
    struct iq2000_hi_fixup * hi_fixup;
  
!   assert (reloc_type == BFD_RELOC_HI16);
  
    hi_fixup = xmalloc (sizeof * hi_fixup);
    hi_fixup->fixp = fixP;
--- 534,540 ----
  {
    struct iq2000_hi_fixup * hi_fixup;
  
!   gas_assert (reloc_type == BFD_RELOC_HI16);
  
    hi_fixup = xmalloc (sizeof * hi_fixup);
    hi_fixup->fixp = fixP;
*************** iq2000_frob_file (void)
*** 587,593 ****
        segment_info_type * seginfo;
        int                 pass;
  
!       assert (FX_OPINFO_R_TYPE (l->fixp) == BFD_RELOC_HI16
  	      || FX_OPINFO_R_TYPE (l->fixp) == BFD_RELOC_LO16);
  
        /* Check quickly whether the next fixup happens to be a matching low.  */
--- 587,593 ----
        segment_info_type * seginfo;
        int                 pass;
  
!       gas_assert (FX_OPINFO_R_TYPE (l->fixp) == BFD_RELOC_HI16
  	      || FX_OPINFO_R_TYPE (l->fixp) == BFD_RELOC_LO16);
  
        /* Check quickly whether the next fixup happens to be a matching low.  */
*************** iq2000_frob_file (void)
*** 627,633 ****
  		  for (pf = &seginfo->fix_root;
  		       * pf != l->fixp;
  		       pf = & (* pf)->fx_next)
! 		    assert (* pf != NULL);
  
  		  * pf = l->fixp->fx_next;
  
--- 627,633 ----
  		  for (pf = &seginfo->fix_root;
  		       * pf != l->fixp;
  		       pf = & (* pf)->fx_next)
! 		    gas_assert (* pf != NULL);
  
  		  * pf = l->fixp->fx_next;
  
*************** s_iq2000_end (int x ATTRIBUTE_UNUSED)
*** 837,843 ****
  
    if (p != NULL)
      {
!       assert (S_GET_NAME (p));
        if (strcmp (S_GET_NAME (p), S_GET_NAME (cur_proc_ptr->isym)))
  	as_warn (_(".end symbol does not match .ent symbol."));
      }
--- 837,843 ----
  
    if (p != NULL)
      {
!       gas_assert (S_GET_NAME (p));
        if (strcmp (S_GET_NAME (p), S_GET_NAME (cur_proc_ptr->isym)))
  	as_warn (_(".end symbol does not match .ent symbol."));
      }
diff -crp src.head/gas/config/tc-m32c.c src.assert/gas/config/tc-m32c.c
*** src.head/gas/config/tc-m32c.c	Tue Jun 16 09:07:24 2009
--- src.assert/gas/config/tc-m32c.c	Tue Jun 16 09:39:05 2009
*************** md_convert_frag (bfd *   abfd ATTRIBUTE_
*** 913,919 ****
  			 && operand != M32C_OPERAND_LAB32_JMP_S)))
      {
        fixS *fixP;
!       assert (fragP->fr_cgen.insn != 0);
        fixP = gas_cgen_record_fixup (fragP,
  				    where,
  				    fragP->fr_cgen.insn,
--- 913,919 ----
  			 && operand != M32C_OPERAND_LAB32_JMP_S)))
      {
        fixS *fixP;
!       gas_assert (fragP->fr_cgen.insn != 0);
        fixP = gas_cgen_record_fixup (fragP,
  				    where,
  				    fragP->fr_cgen.insn,
Only in src.assert/gas/config: tc-m32c.c.orig
diff -crp src.head/gas/config/tc-m32r.c src.assert/gas/config/tc-m32r.c
*** src.head/gas/config/tc-m32r.c	Tue Jun 16 09:07:25 2009
--- src.assert/gas/config/tc-m32r.c	Tue Jun 16 09:39:05 2009
*************** md_convert_frag (bfd *abfd ATTRIBUTE_UNU
*** 1809,1816 ****
      {
        fixS *fixP;
  
!       assert (fragP->fr_subtype != 1);
!       assert (fragP->fr_cgen.insn != 0);
  
        fixP = gas_cgen_record_fixup (fragP,
  				    /* Offset of branch insn in frag.  */
--- 1809,1816 ----
      {
        fixS *fixP;
  
!       gas_assert (fragP->fr_subtype != 1);
!       gas_assert (fragP->fr_cgen.insn != 0);
  
        fixP = gas_cgen_record_fixup (fragP,
  				    /* Offset of branch insn in frag.  */
*************** m32r_record_hi16 (int reloc_type,
*** 1900,1906 ****
  {
    struct m32r_hi_fixup *hi_fixup;
  
!   assert (reloc_type == BFD_RELOC_M32R_HI16_SLO
  	  || reloc_type == BFD_RELOC_M32R_HI16_ULO);
  
    hi_fixup = xmalloc (sizeof (* hi_fixup));
--- 1900,1906 ----
  {
    struct m32r_hi_fixup *hi_fixup;
  
!   gas_assert (reloc_type == BFD_RELOC_M32R_HI16_SLO
  	  || reloc_type == BFD_RELOC_M32R_HI16_ULO);
  
    hi_fixup = xmalloc (sizeof (* hi_fixup));
*************** m32r_frob_file (void)
*** 2008,2014 ****
        segment_info_type *seginfo;
        int pass;
  
!       assert (FX_OPINFO_R_TYPE (l->fixp) == BFD_RELOC_M32R_HI16_SLO
  	      || FX_OPINFO_R_TYPE (l->fixp) == BFD_RELOC_M32R_HI16_ULO);
  
        /* Check quickly whether the next fixup happens to be a matching low.  */
--- 2008,2014 ----
        segment_info_type *seginfo;
        int pass;
  
!       gas_assert (FX_OPINFO_R_TYPE (l->fixp) == BFD_RELOC_M32R_HI16_SLO
  	      || FX_OPINFO_R_TYPE (l->fixp) == BFD_RELOC_M32R_HI16_ULO);
  
        /* Check quickly whether the next fixup happens to be a matching low.  */
*************** m32r_frob_file (void)
*** 2049,2055 ****
  		  for (pf = &seginfo->fix_root;
  		       *pf != l->fixp;
  		       pf = & (*pf)->fx_next)
! 		    assert (*pf != NULL);
  
  		  *pf = l->fixp->fx_next;
  
--- 2049,2055 ----
  		  for (pf = &seginfo->fix_root;
  		       *pf != l->fixp;
  		       pf = & (*pf)->fx_next)
! 		    gas_assert (*pf != NULL);
  
  		  *pf = l->fixp->fx_next;
  
diff -crp src.head/gas/config/tc-m68hc11.c src.assert/gas/config/tc-m68hc11.c
*** src.head/gas/config/tc-m68hc11.c	Tue Jun 16 09:07:25 2009
--- src.assert/gas/config/tc-m68hc11.c	Tue Jun 16 09:39:05 2009
*************** build_jump_insn (struct m68hc11_opcode *
*** 1522,1530 ****
  
    /* The relative branch conversion is not supported for
       brclr and brset.  */
!   assert ((opcode->format & M6811_OP_BITMASK) == 0);
!   assert (nb_operands == 1);
!   assert (operands[0].reg1 == REG_NONE && operands[0].reg2 == REG_NONE);
  
    code = opcode->opcode;
  
--- 1522,1530 ----
  
    /* The relative branch conversion is not supported for
       brclr and brset.  */
!   gas_assert ((opcode->format & M6811_OP_BITMASK) == 0);
!   gas_assert (nb_operands == 1);
!   gas_assert (operands[0].reg1 == REG_NONE && operands[0].reg2 == REG_NONE);
  
    code = opcode->opcode;
  
*************** build_dbranch_insn (struct m68hc11_opcod
*** 1672,1680 ****
  
    /* The relative branch conversion is not supported for
       brclr and brset.  */
!   assert ((opcode->format & M6811_OP_BITMASK) == 0);
!   assert (nb_operands == 2);
!   assert (operands[0].reg1 != REG_NONE);
  
    code = opcode->opcode & 0x0FF;
  
--- 1672,1680 ----
  
    /* The relative branch conversion is not supported for
       brclr and brset.  */
!   gas_assert ((opcode->format & M6811_OP_BITMASK) == 0);
!   gas_assert (nb_operands == 2);
!   gas_assert (operands[0].reg1 != REG_NONE);
  
    code = opcode->opcode & 0x0FF;
  
*************** s_m68hc11_mark_symbol (int mark)
*** 2618,2624 ****
        bfdsym = symbol_get_bfdsym (symbolP);
        elfsym = elf_symbol_from (bfd_asymbol_bfd (bfdsym), bfdsym);
  
!       assert (elfsym);
  
        /* Mark the symbol far (using rtc for function return).  */
        elfsym->internal_elf_sym.st_other |= mark;
--- 2618,2624 ----
        bfdsym = symbol_get_bfdsym (symbolP);
        elfsym = elf_symbol_from (bfd_asymbol_bfd (bfdsym), bfdsym);
  
!       gas_assert (elfsym);
  
        /* Mark the symbol far (using rtc for function return).  */
        elfsym->internal_elf_sym.st_other |= mark;
*************** md_convert_frag (bfd *abfd ATTRIBUTE_UNU
*** 2823,2829 ****
  
      case ENCODE_RELAX (STATE_PC_RELATIVE, STATE_WORD):
        /* This relax is only for bsr and bra.  */
!       assert (IS_OPCODE (fragP->fr_opcode[0], M6811_BSR)
  	      || IS_OPCODE (fragP->fr_opcode[0], M6811_BRA)
  	      || IS_OPCODE (fragP->fr_opcode[0], M6812_BSR));
  
--- 2823,2829 ----
  
      case ENCODE_RELAX (STATE_PC_RELATIVE, STATE_WORD):
        /* This relax is only for bsr and bra.  */
!       gas_assert (IS_OPCODE (fragP->fr_opcode[0], M6811_BSR)
  	      || IS_OPCODE (fragP->fr_opcode[0], M6811_BRA)
  	      || IS_OPCODE (fragP->fr_opcode[0], M6812_BSR));
  
*************** md_estimate_size_before_relax (fragS *fr
*** 2964,2970 ****
  	    case STATE_PC_RELATIVE:
  
  	      /* This relax is only for bsr and bra.  */
! 	      assert (IS_OPCODE (fragP->fr_opcode[0], M6811_BSR)
  		      || IS_OPCODE (fragP->fr_opcode[0], M6811_BRA)
  		      || IS_OPCODE (fragP->fr_opcode[0], M6812_BSR));
  
--- 2964,2970 ----
  	    case STATE_PC_RELATIVE:
  
  	      /* This relax is only for bsr and bra.  */
! 	      gas_assert (IS_OPCODE (fragP->fr_opcode[0], M6811_BSR)
  		      || IS_OPCODE (fragP->fr_opcode[0], M6811_BRA)
  		      || IS_OPCODE (fragP->fr_opcode[0], M6812_BSR));
  
*************** md_estimate_size_before_relax (fragS *fr
*** 2984,2990 ****
  	      break;
  
  	    case STATE_CONDITIONAL_BRANCH:
! 	      assert (current_architecture & cpu6811);
  
  	      fragP->fr_opcode[0] ^= 1;	/* Reverse sense of branch.  */
  	      fragP->fr_opcode[1] = 3;	/* Skip next jmp insn (3 bytes).  */
--- 2984,2990 ----
  	      break;
  
  	    case STATE_CONDITIONAL_BRANCH:
! 	      gas_assert (current_architecture & cpu6811);
  
  	      fragP->fr_opcode[0] ^= 1;	/* Reverse sense of branch.  */
  	      fragP->fr_opcode[1] = 3;	/* Skip next jmp insn (3 bytes).  */
*************** md_estimate_size_before_relax (fragS *fr
*** 3000,3006 ****
  	      break;
  
  	    case STATE_INDEXED_OFFSET:
! 	      assert (current_architecture & cpu6812);
  
                if (fragP->fr_symbol
                    && S_GET_SEGMENT (fragP->fr_symbol) == absolute_section)
--- 3000,3006 ----
  	      break;
  
  	    case STATE_INDEXED_OFFSET:
! 	      gas_assert (current_architecture & cpu6812);
  
                if (fragP->fr_symbol
                    && S_GET_SEGMENT (fragP->fr_symbol) == absolute_section)
*************** md_estimate_size_before_relax (fragS *fr
*** 3022,3028 ****
  	      break;
  
  	    case STATE_INDEXED_PCREL:
! 	      assert (current_architecture & cpu6812);
  
                if (fragP->fr_symbol
                    && S_GET_SEGMENT (fragP->fr_symbol) == absolute_section)
--- 3022,3028 ----
  	      break;
  
  	    case STATE_INDEXED_PCREL:
! 	      gas_assert (current_architecture & cpu6812);
  
                if (fragP->fr_symbol
                    && S_GET_SEGMENT (fragP->fr_symbol) == absolute_section)
*************** md_estimate_size_before_relax (fragS *fr
*** 3045,3051 ****
  	      break;
  
  	    case STATE_XBCC_BRANCH:
! 	      assert (current_architecture & cpu6812);
  
  	      fragP->fr_opcode[0] ^= 0x20;	/* Reverse sense of branch.  */
  	      fragP->fr_opcode[1] = 3;	/* Skip next jmp insn (3 bytes).  */
--- 3045,3051 ----
  	      break;
  
  	    case STATE_XBCC_BRANCH:
! 	      gas_assert (current_architecture & cpu6812);
  
  	      fragP->fr_opcode[0] ^= 0x20;	/* Reverse sense of branch.  */
  	      fragP->fr_opcode[1] = 3;	/* Skip next jmp insn (3 bytes).  */
*************** md_estimate_size_before_relax (fragS *fr
*** 3061,3067 ****
  	      break;
  
  	    case STATE_CONDITIONAL_BRANCH_6812:
! 	      assert (current_architecture & cpu6812);
  
  	      /* Translate into a lbcc branch.  */
  	      fragP->fr_opcode[1] = fragP->fr_opcode[0];
--- 3061,3067 ----
  	      break;
  
  	    case STATE_CONDITIONAL_BRANCH_6812:
! 	      gas_assert (current_architecture & cpu6812);
  
  	      /* Translate into a lbcc branch.  */
  	      fragP->fr_opcode[1] = fragP->fr_opcode[0];
*************** md_estimate_size_before_relax (fragS *fr
*** 3086,3092 ****
  	{
  	case STATE_PC_RELATIVE:
  	  /* This relax is only for bsr and bra.  */
! 	  assert (IS_OPCODE (fragP->fr_opcode[0], M6811_BSR)
  		  || IS_OPCODE (fragP->fr_opcode[0], M6811_BRA)
  		  || IS_OPCODE (fragP->fr_opcode[0], M6812_BSR));
  
--- 3086,3092 ----
  	{
  	case STATE_PC_RELATIVE:
  	  /* This relax is only for bsr and bra.  */
! 	  gas_assert (IS_OPCODE (fragP->fr_opcode[0], M6811_BSR)
  		  || IS_OPCODE (fragP->fr_opcode[0], M6811_BRA)
  		  || IS_OPCODE (fragP->fr_opcode[0], M6812_BSR));
  
*************** md_estimate_size_before_relax (fragS *fr
*** 3094,3127 ****
  	  break;
  
  	case STATE_CONDITIONAL_BRANCH:
! 	  assert (current_architecture & cpu6811);
  
  	  fragP->fr_subtype = ENCODE_RELAX (STATE_CONDITIONAL_BRANCH,
  					    STATE_BYTE);
  	  break;
  
  	case STATE_INDEXED_OFFSET:
! 	  assert (current_architecture & cpu6812);
  
  	  fragP->fr_subtype = ENCODE_RELAX (STATE_INDEXED_OFFSET,
  					    STATE_BITS5);
  	  break;
  
  	case STATE_INDEXED_PCREL:
! 	  assert (current_architecture & cpu6812);
  
  	  fragP->fr_subtype = ENCODE_RELAX (STATE_INDEXED_PCREL,
  					    STATE_BITS5);
  	  break;
  
  	case STATE_XBCC_BRANCH:
! 	  assert (current_architecture & cpu6812);
  
  	  fragP->fr_subtype = ENCODE_RELAX (STATE_XBCC_BRANCH, STATE_BYTE);
  	  break;
  
  	case STATE_CONDITIONAL_BRANCH_6812:
! 	  assert (current_architecture & cpu6812);
  
  	  fragP->fr_subtype = ENCODE_RELAX (STATE_CONDITIONAL_BRANCH_6812,
  					    STATE_BYTE);
--- 3094,3127 ----
  	  break;
  
  	case STATE_CONDITIONAL_BRANCH:
! 	  gas_assert (current_architecture & cpu6811);
  
  	  fragP->fr_subtype = ENCODE_RELAX (STATE_CONDITIONAL_BRANCH,
  					    STATE_BYTE);
  	  break;
  
  	case STATE_INDEXED_OFFSET:
! 	  gas_assert (current_architecture & cpu6812);
  
  	  fragP->fr_subtype = ENCODE_RELAX (STATE_INDEXED_OFFSET,
  					    STATE_BITS5);
  	  break;
  
  	case STATE_INDEXED_PCREL:
! 	  gas_assert (current_architecture & cpu6812);
  
  	  fragP->fr_subtype = ENCODE_RELAX (STATE_INDEXED_PCREL,
  					    STATE_BITS5);
  	  break;
  
  	case STATE_XBCC_BRANCH:
! 	  gas_assert (current_architecture & cpu6812);
  
  	  fragP->fr_subtype = ENCODE_RELAX (STATE_XBCC_BRANCH, STATE_BYTE);
  	  break;
  
  	case STATE_CONDITIONAL_BRANCH_6812:
! 	  gas_assert (current_architecture & cpu6812);
  
  	  fragP->fr_subtype = ENCODE_RELAX (STATE_CONDITIONAL_BRANCH_6812,
  					    STATE_BYTE);
diff -crp src.head/gas/config/tc-m68k.c src.assert/gas/config/tc-m68k.c
*** src.head/gas/config/tc-m68k.c	Tue Jun 16 09:07:25 2009
--- src.assert/gas/config/tc-m68k.c	Tue Jun 16 09:39:05 2009
*************** tc_gen_reloc (asection *section ATTRIBUT
*** 1339,1345 ****
  #endif
  
    reloc->howto = bfd_reloc_type_lookup (stdoutput, code);
!   assert (reloc->howto != 0);
  
    return reloc;
  }
--- 1339,1345 ----
  #endif
  
    reloc->howto = bfd_reloc_type_lookup (stdoutput, code);
!   gas_assert (reloc->howto != 0);
  
    return reloc;
  }
*************** m68k_ip (char *instring)
*** 1492,1498 ****
  
  	  /* Make a copy of the operands of this insn so that
  	     we can modify them safely, should we want to.  */
! 	  assert (opsfound <= (int) ARRAY_SIZE (operands_backup));
  	  for (i = 0; i < opsfound; i++)
  	    operands_backup[i] = the_ins.operands[i];
  
--- 1492,1498 ----
  
  	  /* Make a copy of the operands of this insn so that
  	     we can modify them safely, should we want to.  */
! 	  gas_assert (opsfound <= (int) ARRAY_SIZE (operands_backup));
  	  for (i = 0; i < opsfound; i++)
  	    operands_backup[i] = the_ins.operands[i];
  
*************** md_convert_frag_1 (fragS *fragP)
*** 5164,5177 ****
        fragP->fr_fix += 4;
        break;
      case TAB (PCINDEX, BYTE):
!       assert (fragP->fr_fix >= 2);
        buffer_address[-2] &= ~1;
        fixP = fix_new (fragP, fragP->fr_fix - 1, 1, fragP->fr_symbol,
  		      fragP->fr_offset, 1, RELAX_RELOC_PC8);
        fixP->fx_pcrel_adjust = 1;
        break;
      case TAB (PCINDEX, SHORT):
!       assert (fragP->fr_fix >= 2);
        buffer_address[-2] |= 0x1;
        buffer_address[-1] = 0x20;
        fixP = fix_new (fragP, (int) (fragP->fr_fix), 2, fragP->fr_symbol,
--- 5164,5177 ----
        fragP->fr_fix += 4;
        break;
      case TAB (PCINDEX, BYTE):
!       gas_assert (fragP->fr_fix >= 2);
        buffer_address[-2] &= ~1;
        fixP = fix_new (fragP, fragP->fr_fix - 1, 1, fragP->fr_symbol,
  		      fragP->fr_offset, 1, RELAX_RELOC_PC8);
        fixP->fx_pcrel_adjust = 1;
        break;
      case TAB (PCINDEX, SHORT):
!       gas_assert (fragP->fr_fix >= 2);
        buffer_address[-2] |= 0x1;
        buffer_address[-1] = 0x20;
        fixP = fix_new (fragP, (int) (fragP->fr_fix), 2, fragP->fr_symbol,
*************** md_convert_frag_1 (fragS *fragP)
*** 5180,5186 ****
        fragP->fr_fix += 2;
        break;
      case TAB (PCINDEX, LONG):
!       assert (fragP->fr_fix >= 2);
        buffer_address[-2] |= 0x1;
        buffer_address[-1] = 0x30;
        fixP = fix_new (fragP, (int) (fragP->fr_fix), 4, fragP->fr_symbol,
--- 5180,5186 ----
        fragP->fr_fix += 2;
        break;
      case TAB (PCINDEX, LONG):
!       gas_assert (fragP->fr_fix >= 2);
        buffer_address[-2] |= 0x1;
        buffer_address[-1] = 0x30;
        fixP = fix_new (fragP, (int) (fragP->fr_fix), 4, fragP->fr_symbol,
Only in src.assert/gas/config: tc-m68k.c.orig
diff -crp src.head/gas/config/tc-maxq.c src.assert/gas/config/tc-maxq.c
*** src.head/gas/config/tc-maxq.c	Tue Jun 16 09:07:25 2009
--- src.assert/gas/config/tc-maxq.c	Tue Jun 16 09:39:05 2009
*************** tc_gen_reloc (asection *section ATTRIBUT
*** 276,282 ****
  
        /* Set howto to a garbage value so that we can keep going.  */
        rel->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_32);
!       assert (rel->howto != NULL);
      }
  
    return rel;
--- 276,282 ----
  
        /* Set howto to a garbage value so that we can keep going.  */
        rel->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_32);
!       gas_assert (rel->howto != NULL);
      }
  
    return rel;
diff -crp src.head/gas/config/tc-mcore.c src.assert/gas/config/tc-mcore.c
*** src.head/gas/config/tc-mcore.c	Tue Jun 16 09:07:25 2009
--- src.assert/gas/config/tc-mcore.c	Tue Jun 16 09:39:05 2009
*************** md_pcrel_from_section (fixS * fixp, segT
*** 2135,2141 ****
  	  || (S_GET_SEGMENT (fixp->fx_addsy) != sec)))
  
    {
!     assert (fixp->fx_size == 2);	/* must be an insn */
      return fixp->fx_size;
    }
  #endif
--- 2135,2141 ----
  	  || (S_GET_SEGMENT (fixp->fx_addsy) != sec)))
  
    {
!     gas_assert (fixp->fx_size == 2);	/* must be an insn */
      return fixp->fx_size;
    }
  #endif
*************** tc_gen_reloc (asection * section ATTRIBU
*** 2201,2207 ****
  
        /* Set howto to a garbage value so that we can keep going.  */
        rel->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_32);
!       assert (rel->howto != NULL);
      }
  
    return rel;
--- 2201,2207 ----
  
        /* Set howto to a garbage value so that we can keep going.  */
        rel->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_32);
!       gas_assert (rel->howto != NULL);
      }
  
    return rel;
diff -crp src.head/gas/config/tc-mep.c src.assert/gas/config/tc-mep.c
*** src.head/gas/config/tc-mep.c	Tue Jun 16 09:07:25 2009
--- src.assert/gas/config/tc-mep.c	Tue Jun 16 09:39:05 2009
*************** md_convert_frag (bfd *abfd  ATTRIBUTE_UN
*** 1698,1704 ****
    if (S_GET_SEGMENT (fragP->fr_symbol) != sec
        || operand == MEP_OPERAND_PCABS24A2)
      {
!       assert (fragP->fr_cgen.insn != 0);
        gas_cgen_record_fixup (fragP,
  			     where,
  			     fragP->fr_cgen.insn,
--- 1698,1704 ----
    if (S_GET_SEGMENT (fragP->fr_symbol) != sec
        || operand == MEP_OPERAND_PCABS24A2)
      {
!       gas_assert (fragP->fr_cgen.insn != 0);
        gas_cgen_record_fixup (fragP,
  			     where,
  			     fragP->fr_cgen.insn,
*************** mep_frob_file ()
*** 1870,1876 ****
        segment_info_type * seginfo;
        int pass;
  
!       assert (FX_OPINFO_R_TYPE (l->fixp) == BFD_RELOC_HI16
  	      || FX_OPINFO_R_TYPE (l->fixp) == BFD_RELOC_LO16);
  
        /* Check quickly whether the next fixup happens to be a matching low.  */
--- 1870,1876 ----
        segment_info_type * seginfo;
        int pass;
  
!       gas_assert (FX_OPINFO_R_TYPE (l->fixp) == BFD_RELOC_HI16
  	      || FX_OPINFO_R_TYPE (l->fixp) == BFD_RELOC_LO16);
  
        /* Check quickly whether the next fixup happens to be a matching low.  */
*************** mep_frob_file ()
*** 1910,1916 ****
  		  for (pf = &seginfo->fix_root;
  		       * pf != l->fixp;
  		       pf = & (* pf)->fx_next)
! 		    assert (* pf != NULL);
  
  		  * pf = l->fixp->fx_next;
  
--- 1910,1916 ----
  		  for (pf = &seginfo->fix_root;
  		       * pf != l->fixp;
  		       pf = & (* pf)->fx_next)
! 		    gas_assert (* pf != NULL);
  
  		  * pf = l->fixp->fx_next;
  
Only in src.assert/gas/config: tc-mep.c.orig
diff -crp src.head/gas/config/tc-mips.c src.assert/gas/config/tc-mips.c
*** src.head/gas/config/tc-mips.c	Tue Jun 16 09:07:25 2009
--- src.assert/gas/config/tc-mips.c	Tue Jun 16 09:39:05 2009
*************** insn_uses_reg (const struct mips_cl_insn
*** 2217,2223 ****
  {
    if (class == MIPS16_REG)
      {
!       assert (mips_opts.mips16);
        reg = mips16_to_32_reg_map[reg];
        class = MIPS_GR_REG;
      }
--- 2217,2223 ----
  {
    if (class == MIPS16_REG)
      {
!       gas_assert (mips_opts.mips16);
        reg = mips16_to_32_reg_map[reg];
        class = MIPS_GR_REG;
      }
*************** insn_uses_reg (const struct mips_cl_insn
*** 2228,2234 ****
  
    if (class == MIPS_FP_REG)
      {
!       assert (! mips_opts.mips16);
        /* If we are called with either $f0 or $f1, we must check $f0.
  	 This is not optimal, because it will introduce an unnecessary
  	 NOP between "lwc1 $f0" and "swc1 $f1".  To fix this we would
--- 2228,2234 ----
  
    if (class == MIPS_FP_REG)
      {
!       gas_assert (! mips_opts.mips16);
        /* If we are called with either $f0 or $f1, we must check $f0.
  	 This is not optimal, because it will introduce an unnecessary
  	 NOP between "lwc1 $f0" and "swc1 $f1".  To fix this we would
*************** mips_move_labels (void)
*** 2317,2323 ****
  
    for (l = si->label_list; l != NULL; l = l->next)
      {
!       assert (S_GET_SEGMENT (l->label) == now_seg);
        symbol_set_frag (l->label, frag_now);
        val = (valueT) frag_now_fix ();
        /* mips16 text labels are stored as odd.  */
--- 2317,2323 ----
  
    for (l = si->label_list; l != NULL; l = l->next)
      {
!       gas_assert (S_GET_SEGMENT (l->label) == now_seg);
        symbol_set_frag (l->label, frag_now);
        val = (valueT) frag_now_fix ();
        /* mips16 text labels are stored as odd.  */
*************** relax_close_frag (void)
*** 2407,2413 ****
  static void
  relax_start (symbolS *symbol)
  {
!   assert (mips_relax.sequence == 0);
    mips_relax.sequence = 1;
    mips_relax.symbol = symbol;
  }
--- 2407,2413 ----
  static void
  relax_start (symbolS *symbol)
  {
!   gas_assert (mips_relax.sequence == 0);
    mips_relax.sequence = 1;
    mips_relax.symbol = symbol;
  }
*************** relax_start (symbolS *symbol)
*** 2418,2424 ****
  static void
  relax_switch (void)
  {
!   assert (mips_relax.sequence == 1);
    mips_relax.sequence = 2;
  }
  
--- 2418,2424 ----
  static void
  relax_switch (void)
  {
!   gas_assert (mips_relax.sequence == 1);
    mips_relax.sequence = 2;
  }
  
*************** relax_switch (void)
*** 2427,2433 ****
  static void
  relax_end (void)
  {
!   assert (mips_relax.sequence == 2);
    relax_close_frag ();
    mips_relax.sequence = 0;
  }
--- 2427,2433 ----
  static void
  relax_end (void)
  {
!   gas_assert (mips_relax.sequence == 2);
    relax_close_frag ();
    mips_relax.sequence = 0;
  }
*************** append_insn (struct mips_cl_insn *ip, ex
*** 2788,2794 ****
      {
        /* Work out how many nops in prev_nop_frag are needed by IP.  */
        int nops = nops_for_insn_or_target (history, ip);
!       assert (nops <= prev_nop_frag_holds);
  
        /* Enforce NOPS as a minimum.  */
        if (nops > prev_nop_frag_required)
--- 2788,2794 ----
      {
        /* Work out how many nops in prev_nop_frag are needed by IP.  */
        int nops = nops_for_insn_or_target (history, ip);
!       gas_assert (nops <= prev_nop_frag_holds);
  
        /* Enforce NOPS as a minimum.  */
        if (nops > prev_nop_frag_required)
*************** append_insn (struct mips_cl_insn *ip, ex
*** 2855,2861 ****
    else if (*reloc_type > BFD_RELOC_UNUSED)
      {
        /* We need to set up a variant frag.  */
!       assert (mips_opts.mips16 && address_expr != NULL);
        add_relaxed_insn (ip, 4, 0,
  			RELAX_MIPS16_ENCODE
  			(*reloc_type - BFD_RELOC_UNUSED,
--- 2855,2861 ----
    else if (*reloc_type > BFD_RELOC_UNUSED)
      {
        /* We need to set up a variant frag.  */
!       gas_assert (mips_opts.mips16 && address_expr != NULL);
        add_relaxed_insn (ip, 4, 0,
  			RELAX_MIPS16_ENCODE
  			(*reloc_type - BFD_RELOC_UNUSED,
*************** macro_build (expressionS *ep, const char
*** 3552,3559 ****
    r[1] = BFD_RELOC_UNUSED;
    r[2] = BFD_RELOC_UNUSED;
    mo = (struct mips_opcode *) hash_find (op_hash, name);
!   assert (mo);
!   assert (strcmp (name, mo->name) == 0);
  
    while (1)
      {
--- 3552,3559 ----
    r[1] = BFD_RELOC_UNUSED;
    r[2] = BFD_RELOC_UNUSED;
    mo = (struct mips_opcode *) hash_find (op_hash, name);
!   gas_assert (mo);
!   gas_assert (strcmp (name, mo->name) == 0);
  
    while (1)
      {
*************** macro_build (expressionS *ep, const char
*** 3565,3572 ****
  	break;
  
        ++mo;
!       assert (mo->name);
!       assert (strcmp (name, mo->name) == 0);
      }
  
    create_insn (&insn, mo);
--- 3565,3572 ----
  	break;
  
        ++mo;
!       gas_assert (mo->name);
!       gas_assert (strcmp (name, mo->name) == 0);
      }
  
    create_insn (&insn, mo);
*************** macro_build (expressionS *ep, const char
*** 3691,3697 ****
  	case 'j':
  	case 'o':
  	  macro_read_relocs (&args, r);
! 	  assert (*r == BFD_RELOC_GPREL16
  		  || *r == BFD_RELOC_MIPS_LITERAL
  		  || *r == BFD_RELOC_MIPS_HIGHER
  		  || *r == BFD_RELOC_HI16_S
--- 3691,3697 ----
  	case 'j':
  	case 'o':
  	  macro_read_relocs (&args, r);
! 	  gas_assert (*r == BFD_RELOC_GPREL16
  		  || *r == BFD_RELOC_MIPS_LITERAL
  		  || *r == BFD_RELOC_MIPS_HIGHER
  		  || *r == BFD_RELOC_HI16_S
*************** macro_build (expressionS *ep, const char
*** 3707,3713 ****
  
  	case 'u':
  	  macro_read_relocs (&args, r);
! 	  assert (ep != NULL
  		  && (ep->X_op == O_constant
  		      || (ep->X_op == O_symbol
  			  && (*r == BFD_RELOC_MIPS_HIGHEST
--- 3707,3713 ----
  
  	case 'u':
  	  macro_read_relocs (&args, r);
! 	  gas_assert (ep != NULL
  		  && (ep->X_op == O_constant
  		      || (ep->X_op == O_symbol
  			  && (*r == BFD_RELOC_MIPS_HIGHEST
*************** macro_build (expressionS *ep, const char
*** 3719,3725 ****
  	  continue;
  
  	case 'p':
! 	  assert (ep != NULL);
  
  	  /*
  	   * This allows macro() to pass an immediate expression for
--- 3719,3725 ----
  	  continue;
  
  	case 'p':
! 	  gas_assert (ep != NULL);
  
  	  /*
  	   * This allows macro() to pass an immediate expression for
*************** macro_build (expressionS *ep, const char
*** 3744,3750 ****
  	  continue;
  
  	case 'a':
! 	  assert (ep != NULL);
  	  *r = BFD_RELOC_MIPS_JMP;
  	  continue;
  
--- 3744,3750 ----
  	  continue;
  
  	case 'a':
! 	  gas_assert (ep != NULL);
  	  *r = BFD_RELOC_MIPS_JMP;
  	  continue;
  
*************** macro_build (expressionS *ep, const char
*** 3762,3768 ****
        break;
      }
    va_end (args);
!   assert (*r == BFD_RELOC_UNUSED ? ep == NULL : ep != NULL);
  
    append_insn (&insn, ep, r);
  }
--- 3762,3768 ----
        break;
      }
    va_end (args);
!   gas_assert (*r == BFD_RELOC_UNUSED ? ep == NULL : ep != NULL);
  
    append_insn (&insn, ep, r);
  }
*************** mips16_macro_build (expressionS *ep, con
*** 3777,3790 ****
      = {BFD_RELOC_UNUSED, BFD_RELOC_UNUSED, BFD_RELOC_UNUSED};
  
    mo = (struct mips_opcode *) hash_find (mips16_op_hash, name);
!   assert (mo);
!   assert (strcmp (name, mo->name) == 0);
  
    while (strcmp (fmt, mo->args) != 0 || mo->pinfo == INSN_MACRO)
      {
        ++mo;
!       assert (mo->name);
!       assert (strcmp (name, mo->name) == 0);
      }
  
    create_insn (&insn, mo);
--- 3777,3790 ----
      = {BFD_RELOC_UNUSED, BFD_RELOC_UNUSED, BFD_RELOC_UNUSED};
  
    mo = (struct mips_opcode *) hash_find (mips16_op_hash, name);
!   gas_assert (mo);
!   gas_assert (strcmp (name, mo->name) == 0);
  
    while (strcmp (fmt, mo->args) != 0 || mo->pinfo == INSN_MACRO)
      {
        ++mo;
!       gas_assert (mo->name);
!       gas_assert (strcmp (name, mo->name) == 0);
      }
  
    create_insn (&insn, mo);
*************** mips16_macro_build (expressionS *ep, con
*** 3858,3864 ****
  	case 'p':
  	case 'q':
  	  {
! 	    assert (ep != NULL);
  
  	    if (ep->X_op != O_constant)
  	      *r = (int) BFD_RELOC_UNUSED + c;
--- 3858,3864 ----
  	case 'p':
  	case 'q':
  	  {
! 	    gas_assert (ep != NULL);
  
  	    if (ep->X_op != O_constant)
  	      *r = (int) BFD_RELOC_UNUSED + c;
*************** mips16_macro_build (expressionS *ep, con
*** 3881,3887 ****
        break;
      }
  
!   assert (*r == BFD_RELOC_UNUSED ? ep == NULL : ep != NULL);
  
    append_insn (&insn, ep, r);
  }
--- 3881,3887 ----
        break;
      }
  
!   gas_assert (*r == BFD_RELOC_UNUSED ? ep == NULL : ep != NULL);
  
    append_insn (&insn, ep, r);
  }
*************** macro_build_lui (expressionS *ep, int re
*** 3947,3953 ****
    const char *name = "lui";
    const char *fmt = "t,u";
  
!   assert (! mips_opts.mips16);
  
    high_expr = *ep;
  
--- 3947,3953 ----
    const char *name = "lui";
    const char *fmt = "t,u";
  
!   gas_assert (! mips_opts.mips16);
  
    high_expr = *ep;
  
*************** macro_build_lui (expressionS *ep, int re
*** 3960,3969 ****
      }
    else
      {
!       assert (ep->X_op == O_symbol);
        /* _gp_disp is a special case, used from s_cpload.
  	 __gnu_local_gp is used if mips_no_shared.  */
!       assert (mips_pic == NO_PIC
  	      || (! HAVE_NEWABI
  		  && strcmp (S_GET_NAME (ep->X_add_symbol), "_gp_disp") == 0)
  	      || (! mips_in_shared
--- 3960,3969 ----
      }
    else
      {
!       gas_assert (ep->X_op == O_symbol);
        /* _gp_disp is a special case, used from s_cpload.
  	 __gnu_local_gp is used if mips_no_shared.  */
!       gas_assert (mips_pic == NO_PIC
  	      || (! HAVE_NEWABI
  		  && strcmp (S_GET_NAME (ep->X_add_symbol), "_gp_disp") == 0)
  	      || (! mips_in_shared
*************** macro_build_lui (expressionS *ep, int re
*** 3973,3980 ****
      }
  
    mo = hash_find (op_hash, name);
!   assert (strcmp (name, mo->name) == 0);
!   assert (strcmp (fmt, mo->args) == 0);
    create_insn (&insn, mo);
  
    insn.insn_opcode = insn.insn_mo->match;
--- 3973,3980 ----
      }
  
    mo = hash_find (op_hash, name);
!   gas_assert (strcmp (name, mo->name) == 0);
!   gas_assert (strcmp (fmt, mo->args) == 0);
    create_insn (&insn, mo);
  
    insn.insn_opcode = insn.insn_mo->match;
*************** static void
*** 3995,4001 ****
  macro_build_ldst_constoffset (expressionS *ep, const char *op,
  			      int treg, int breg, int dbl)
  {
!   assert (ep->X_op == O_constant);
  
    /* Sign-extending 32-bit constants makes their handling easier.  */
    if (!dbl)
--- 3995,4001 ----
  macro_build_ldst_constoffset (expressionS *ep, const char *op,
  			      int treg, int breg, int dbl)
  {
!   gas_assert (ep->X_op == O_constant);
  
    /* Sign-extending 32-bit constants makes their handling easier.  */
    if (!dbl)
*************** load_register (int reg, expressionS *ep,
*** 4148,4154 ****
  
    if (ep->X_op != O_big)
      {
!       assert (ep->X_op == O_constant);
  
        /* Sign-extending 32-bit constants makes their handling easier.  */
        if (!dbl)
--- 4148,4154 ----
  
    if (ep->X_op != O_big)
      {
!       gas_assert (ep->X_op == O_constant);
  
        /* Sign-extending 32-bit constants makes their handling easier.  */
        if (!dbl)
*************** load_register (int reg, expressionS *ep,
*** 4202,4208 ****
      }
    else
      {
!       assert (ep->X_add_number > 2);
        if (ep->X_add_number == 3)
  	generic_bignum[3] = 0;
        else if (ep->X_add_number > 4)
--- 4202,4208 ----
      }
    else
      {
!       gas_assert (ep->X_add_number > 2);
        if (ep->X_add_number == 3)
  	generic_bignum[3] = 0;
        else if (ep->X_add_number > 4)
*************** macro (struct mips_cl_insn *ip)
*** 4749,4755 ****
    bfd_reloc_code_real_type r;
    int hold_mips_optimize;
  
!   assert (! mips_opts.mips16);
  
    treg = (ip->insn_opcode >> 16) & 0x1f;
    dreg = (ip->insn_opcode >> 11) & 0x1f;
--- 4749,4755 ----
    bfd_reloc_code_real_type r;
    int hold_mips_optimize;
  
!   gas_assert (! mips_opts.mips16);
  
    treg = (ip->insn_opcode >> 16) & 0x1f;
    dreg = (ip->insn_opcode >> 11) & 0x1f;
*************** macro (struct mips_cl_insn *ip)
*** 5755,5761 ****
  		    dreg = tempreg;
  		  else
  		    {
! 		      assert (tempreg == AT);
  		      macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t",
  				   treg, AT, breg);
  		      dreg = treg;
--- 5755,5761 ----
  		    dreg = tempreg;
  		  else
  		    {
! 		      gas_assert (tempreg == AT);
  		      macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t",
  				   treg, AT, breg);
  		      dreg = treg;
*************** macro (struct mips_cl_insn *ip)
*** 5896,5902 ****
  		dreg = tempreg;
  	      else
  		{
! 		  assert (tempreg == AT);
  		  load_delay_nop ();
  		  macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t",
  			       treg, AT, breg);
--- 5896,5902 ----
  		dreg = tempreg;
  	      else
  		{
! 		  gas_assert (tempreg == AT);
  		  load_delay_nop ();
  		  macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t",
  			       treg, AT, breg);
*************** macro (struct mips_cl_insn *ip)
*** 5939,5945 ****
  		{
  		  /* We must add in the base register now, as in the
  		     external symbol case.  */
! 		  assert (tempreg == AT);
  		  load_delay_nop ();
  		  macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t",
  			       treg, AT, breg);
--- 5939,5945 ----
  		{
  		  /* We must add in the base register now, as in the
  		     external symbol case.  */
! 		  gas_assert (tempreg == AT);
  		  load_delay_nop ();
  		  macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t",
  			       treg, AT, breg);
*************** macro (struct mips_cl_insn *ip)
*** 6035,6041 ****
  		dreg = tempreg;
  	      else
  		{
! 		  assert (tempreg == AT);
  		  macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t",
  			       treg, AT, breg);
  		  dreg = treg;
--- 6035,6041 ----
  		dreg = tempreg;
  	      else
  		{
! 		  gas_assert (tempreg == AT);
  		  macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t",
  			       treg, AT, breg);
  		  dreg = treg;
*************** macro (struct mips_cl_insn *ip)
*** 6685,6691 ****
  	     16 bits, because we have no way to load the upper 16 bits
  	     (actually, we could handle them for the subset of cases
  	     in which we are not using $at).  */
! 	  assert (offset_expr.X_op == O_symbol);
  	  if (HAVE_NEWABI)
  	    {
  	      macro_build (&offset_expr, ADDRESS_LOAD_INSN, "t,o(b)", tempreg,
--- 6685,6691 ----
  	     16 bits, because we have no way to load the upper 16 bits
  	     (actually, we could handle them for the subset of cases
  	     in which we are not using $at).  */
! 	  gas_assert (offset_expr.X_op == O_symbol);
  	  if (HAVE_NEWABI)
  	    {
  	      macro_build (&offset_expr, ADDRESS_LOAD_INSN, "t,o(b)", tempreg,
*************** macro (struct mips_cl_insn *ip)
*** 6735,6741 ****
  	     16 bits, because we have no way to load the upper 16 bits
  	     (actually, we could handle them for the subset of cases
  	     in which we are not using $at).  */
! 	  assert (offset_expr.X_op == O_symbol);
  	  expr1.X_add_number = offset_expr.X_add_number;
  	  offset_expr.X_add_number = 0;
  	  if (expr1.X_add_number < -0x8000
--- 6735,6741 ----
  	     16 bits, because we have no way to load the upper 16 bits
  	     (actually, we could handle them for the subset of cases
  	     in which we are not using $at).  */
! 	  gas_assert (offset_expr.X_op == O_symbol);
  	  expr1.X_add_number = offset_expr.X_add_number;
  	  offset_expr.X_add_number = 0;
  	  if (expr1.X_add_number < -0x8000
*************** macro (struct mips_cl_insn *ip)
*** 6774,6780 ****
  	     Otherwise, for local symbols, we want:
  	       lw	$tempreg,<sym>($gp)	(BFD_RELOC_MIPS_GOT_PAGE)
  	       <op>	$treg,<sym>($tempreg)   (BFD_RELOC_MIPS_GOT_OFST)  */
! 	  assert (offset_expr.X_op == O_symbol);
  	  expr1.X_add_number = offset_expr.X_add_number;
  	  offset_expr.X_add_number = 0;
  	  if (expr1.X_add_number < -0x8000
--- 6774,6780 ----
  	     Otherwise, for local symbols, we want:
  	       lw	$tempreg,<sym>($gp)	(BFD_RELOC_MIPS_GOT_PAGE)
  	       <op>	$treg,<sym>($tempreg)   (BFD_RELOC_MIPS_GOT_OFST)  */
! 	  gas_assert (offset_expr.X_op == O_symbol);
  	  expr1.X_add_number = offset_expr.X_add_number;
  	  offset_expr.X_add_number = 0;
  	  if (expr1.X_add_number < -0x8000
*************** macro (struct mips_cl_insn *ip)
*** 6827,6833 ****
  	}
        else
  	{
! 	  assert (offset_expr.X_op == O_symbol
  		  && strcmp (segment_name (S_GET_SEGMENT
  					   (offset_expr.X_add_symbol)),
  			     ".lit4") == 0
--- 6827,6833 ----
  	}
        else
  	{
! 	  gas_assert (offset_expr.X_op == O_symbol
  		  && strcmp (segment_name (S_GET_SEGMENT
  					   (offset_expr.X_add_symbol)),
  			     ".lit4") == 0
*************** macro (struct mips_cl_insn *ip)
*** 6869,6875 ****
  		    move_register (lreg, 0);
  		  else
  		    {
! 		      assert (offset_expr.X_op == O_constant);
  		      load_register (lreg, &offset_expr, 0);
  		    }
  		}
--- 6869,6875 ----
  		    move_register (lreg, 0);
  		  else
  		    {
! 		      gas_assert (offset_expr.X_op == O_constant);
  		      load_register (lreg, &offset_expr, 0);
  		    }
  		}
*************** macro (struct mips_cl_insn *ip)
*** 6924,6930 ****
  	  load_register (AT, &imm_expr, HAVE_64BIT_FPRS);
  	  if (HAVE_64BIT_FPRS)
  	    {
! 	      assert (HAVE_64BIT_GPRS);
  	      macro_build (NULL, "dmtc1", "t,S", AT, treg);
  	    }
  	  else
--- 6924,6930 ----
  	  load_register (AT, &imm_expr, HAVE_64BIT_FPRS);
  	  if (HAVE_64BIT_FPRS)
  	    {
! 	      gas_assert (HAVE_64BIT_GPRS);
  	      macro_build (NULL, "dmtc1", "t,S", AT, treg);
  	    }
  	  else
*************** macro (struct mips_cl_insn *ip)
*** 6934,6940 ****
  		macro_build (NULL, "mtc1", "t,G", 0, treg);
  	      else
  		{
! 		  assert (offset_expr.X_op == O_constant);
  		  load_register (AT, &offset_expr, 0);
  		  macro_build (NULL, "mtc1", "t,G", AT, treg);
  		}
--- 6934,6940 ----
  		macro_build (NULL, "mtc1", "t,G", 0, treg);
  	      else
  		{
! 		  gas_assert (offset_expr.X_op == O_constant);
  		  load_register (AT, &offset_expr, 0);
  		  macro_build (NULL, "mtc1", "t,G", AT, treg);
  		}
*************** macro (struct mips_cl_insn *ip)
*** 6942,6948 ****
  	  break;
  	}
  
!       assert (offset_expr.X_op == O_symbol
  	      && offset_expr.X_add_number == 0);
        s = segment_name (S_GET_SEGMENT (offset_expr.X_add_symbol));
        if (strcmp (s, ".lit8") == 0)
--- 6942,6948 ----
  	  break;
  	}
  
!       gas_assert (offset_expr.X_op == O_symbol
  	      && offset_expr.X_add_number == 0);
        s = segment_name (S_GET_SEGMENT (offset_expr.X_add_symbol));
        if (strcmp (s, ".lit8") == 0)
*************** macro (struct mips_cl_insn *ip)
*** 6959,6965 ****
  	}
        else
  	{
! 	  assert (strcmp (s, RDATA_SECTION_NAME) == 0);
  	  used_at = 1;
  	  if (mips_pic != NO_PIC)
  	    macro_build (&offset_expr, ADDRESS_LOAD_INSN, "t,o(b)", AT,
--- 6959,6965 ----
  	}
        else
  	{
! 	  gas_assert (strcmp (s, RDATA_SECTION_NAME) == 0);
  	  used_at = 1;
  	  if (mips_pic != NO_PIC)
  	    macro_build (&offset_expr, ADDRESS_LOAD_INSN, "t,o(b)", AT,
*************** macro (struct mips_cl_insn *ip)
*** 6986,6992 ****
  	 to adjust when loading from memory.  */
        r = BFD_RELOC_LO16;
      dob:
!       assert (mips_opts.isa == ISA_MIPS1);
        macro_build (&offset_expr, "lwc1", "T,o(b)",
  		   target_big_endian ? treg + 1 : treg, r, breg);
        /* FIXME: A possible overflow which I don't know how to deal
--- 6986,6992 ----
  	 to adjust when loading from memory.  */
        r = BFD_RELOC_LO16;
      dob:
!       gas_assert (mips_opts.isa == ISA_MIPS1);
        macro_build (&offset_expr, "lwc1", "T,o(b)",
  		   target_big_endian ? treg + 1 : treg, r, breg);
        /* FIXME: A possible overflow which I don't know how to deal
*************** macro (struct mips_cl_insn *ip)
*** 7297,7303 ****
      case M_SD_OB:
        s = "sw";
      sd_ob:
!       assert (HAVE_32BIT_ADDRESSES);
        macro_build (&offset_expr, s, "t,o(b)", treg, BFD_RELOC_LO16, breg);
        offset_expr.X_add_number += 4;
        macro_build (&offset_expr, s, "t,o(b)", treg + 1, BFD_RELOC_LO16, breg);
--- 7297,7303 ----
      case M_SD_OB:
        s = "sw";
      sd_ob:
!       gas_assert (HAVE_32BIT_ADDRESSES);
        macro_build (&offset_expr, s, "t,o(b)", treg, BFD_RELOC_LO16, breg);
        offset_expr.X_add_number += 4;
        macro_build (&offset_expr, s, "t,o(b)", treg + 1, BFD_RELOC_LO16, breg);
*************** macro2 (struct mips_cl_insn *ip)
*** 7673,7679 ****
        break;
  
      case M_S_DOB:
!       assert (mips_opts.isa == ISA_MIPS1);
        /* Even on a big endian machine $fn comes before $fn+1.  We have
  	 to adjust when storing to memory.  */
        macro_build (&offset_expr, "swc1", "T,o(b)",
--- 7673,7679 ----
        break;
  
      case M_S_DOB:
!       gas_assert (mips_opts.isa == ISA_MIPS1);
        /* Even on a big endian machine $fn comes before $fn+1.  We have
  	 to adjust when storing to memory.  */
        macro_build (&offset_expr, "swc1", "T,o(b)",
*************** macro2 (struct mips_cl_insn *ip)
*** 7967,7973 ****
  
      case M_TRUNCWS:
      case M_TRUNCWD:
!       assert (mips_opts.isa == ISA_MIPS1);
        used_at = 1;
        sreg = (ip->insn_opcode >> 11) & 0x1f;	/* floating reg */
        dreg = (ip->insn_opcode >> 06) & 0x1f;	/* floating reg */
--- 7967,7973 ----
  
      case M_TRUNCWS:
      case M_TRUNCWD:
!       gas_assert (mips_opts.isa == ISA_MIPS1);
        used_at = 1;
        sreg = (ip->insn_opcode >> 11) & 0x1f;	/* floating reg */
        dreg = (ip->insn_opcode >> 06) & 0x1f;	/* floating reg */
*************** mips_ip (char *str, struct mips_cl_insn 
*** 8701,8707 ****
      {
        bfd_boolean ok;
  
!       assert (strcmp (insn->name, str) == 0);
  
        ok = is_opcode_valid (insn, FALSE);
        if (! ok)
--- 8701,8707 ----
      {
        bfd_boolean ok;
  
!       gas_assert (strcmp (insn->name, str) == 0);
  
        ok = is_opcode_valid (insn, FALSE);
        if (! ok)
*************** mips_ip (char *str, struct mips_cl_insn 
*** 8997,9003 ****
  		 we must have a left paren.  */
  	      /* This is dependent on the next operand specifier
  		 is a base register specification.  */
! 	      assert (args[1] == 'b' || args[1] == '5'
  		      || args[1] == '-' || args[1] == '4');
  	      if (*s == '\0')
  		return;
--- 8997,9003 ----
  		 we must have a left paren.  */
  	      /* This is dependent on the next operand specifier
  		 is a base register specification.  */
! 	      gas_assert (args[1] == 'b' || args[1] == '5'
  		      || args[1] == '-' || args[1] == '4');
  	      if (*s == '\0')
  		return;
*************** do_msbd:
*** 9762,9768 ****
  		    length = f64 ? 8 : 4;
  		  }
  
! 		assert (length == (unsigned) (f64 ? 8 : 4));
  
  		if (*args == 'f'
  		    || (*args == 'l'
--- 9762,9768 ----
  		    length = f64 ? 8 : 4;
  		  }
  
! 		gas_assert (length == (unsigned) (f64 ? 8 : 4));
  
  		if (*args == 'f'
  		    || (*args == 'l'
*************** do_msbd:
*** 9860,9866 ****
  			newname = RDATA_SECTION_NAME;
  			break;
  		      case 'l':
! 			assert (g_switch_value >= 4);
  			newname = ".lit4";
  			break;
  		      }
--- 9860,9866 ----
  			newname = RDATA_SECTION_NAME;
  			break;
  		      case 'l':
! 			gas_assert (g_switch_value >= 4);
  			newname = ".lit4";
  			break;
  		      }
*************** mips16_ip (char *str, struct mips_cl_ins
*** 10163,10169 ****
      {
        bfd_boolean ok;
  
!       assert (strcmp (insn->name, str) == 0);
  
        ok = is_opcode_valid_16 (insn);
        if (! ok)
--- 10163,10169 ----
      {
        bfd_boolean ok;
  
!       gas_assert (strcmp (insn->name, str) == 0);
  
        ok = is_opcode_valid_16 (insn);
        if (! ok)
*************** mips16_immed (char *file, unsigned int l
*** 10862,10868 ****
    while (op->type != type)
      {
        ++op;
!       assert (op < mips16_immed_operands + MIPS16_NUM_IMMED);
      }
  
    if (op->unsp)
--- 10862,10868 ----
    while (op->type != type)
      {
        ++op;
!       gas_assert (op < mips16_immed_operands + MIPS16_NUM_IMMED);
      }
  
    if (op->unsp)
*************** mips_frob_file (void)
*** 12109,12115 ****
        bfd_boolean matched_lo_p;
        fixS **hi_pos, **lo_pos, **pos;
  
!       assert (reloc_needs_lo_p (l->fixp->fx_r_type));
  
        /* If a GOT16 relocation turns out to be against a global symbol,
  	 there isn't supposed to be a matching LO.  */
--- 12109,12115 ----
        bfd_boolean matched_lo_p;
        fixS **hi_pos, **lo_pos, **pos;
  
!       gas_assert (reloc_needs_lo_p (l->fixp->fx_r_type));
  
        /* If a GOT16 relocation turns out to be against a global symbol,
  	 there isn't supposed to be a matching LO.  */
*************** md_apply_fix (fixS *fixP, valueT *valP, 
*** 12205,12211 ****
    if (! howto)
      return;
  
!   assert (fixP->fx_size == 4
  	  || fixP->fx_r_type == BFD_RELOC_16
  	  || fixP->fx_r_type == BFD_RELOC_64
  	  || fixP->fx_r_type == BFD_RELOC_CTOR
--- 12205,12211 ----
    if (! howto)
      return;
  
!   gas_assert (fixP->fx_size == 4
  	  || fixP->fx_r_type == BFD_RELOC_16
  	  || fixP->fx_r_type == BFD_RELOC_64
  	  || fixP->fx_r_type == BFD_RELOC_CTOR
*************** md_apply_fix (fixS *fixP, valueT *valP, 
*** 12216,12222 ****
  
    buf = (bfd_byte *) (fixP->fx_frag->fr_literal + fixP->fx_where);
  
!   assert (!fixP->fx_pcrel || fixP->fx_r_type == BFD_RELOC_16_PCREL_S2);
  
    /* Don't treat parts of a composite relocation as done.  There are two
       reasons for this:
--- 12216,12222 ----
  
    buf = (bfd_byte *) (fixP->fx_frag->fr_literal + fixP->fx_where);
  
!   gas_assert (!fixP->fx_pcrel || fixP->fx_r_type == BFD_RELOC_16_PCREL_S2);
  
    /* Don't treat parts of a composite relocation as done.  There are two
       reasons for this:
*************** mips_align (int to, int *fill, symbolS *
*** 12438,12444 ****
    record_alignment (now_seg, to);
    if (label != NULL)
      {
!       assert (S_GET_SEGMENT (label) == now_seg);
        symbol_set_frag (label, frag_now);
        S_SET_VALUE (label, (valueT) frag_now_fix ());
      }
--- 12438,12444 ----
    record_alignment (now_seg, to);
    if (label != NULL)
      {
!       gas_assert (S_GET_SEGMENT (label) == now_seg);
        symbol_set_frag (label, frag_now);
        S_SET_VALUE (label, (valueT) frag_now_fix ());
      }
*************** nopic_need_relax (symbolS *sym, int befo
*** 13698,13704 ****
  	  const char *segname;
  
  	  segname = segment_name (S_GET_SEGMENT (sym));
! 	  assert (strcmp (segname, ".lit8") != 0
  		  && strcmp (segname, ".lit4") != 0);
  	  change = (strcmp (segname, ".sdata") != 0
  		    && strcmp (segname, ".sbss") != 0
--- 13698,13704 ----
  	  const char *segname;
  
  	  segname = segment_name (S_GET_SEGMENT (sym));
! 	  gas_assert (strcmp (segname, ".lit8") != 0
  		  && strcmp (segname, ".lit4") != 0);
  	  change = (strcmp (segname, ".sdata") != 0
  		    && strcmp (segname, ".sbss") != 0
*************** mips16_extended_frag (fragS *fragp, asec
*** 13775,13781 ****
    while (op->type != type)
      {
        ++op;
!       assert (op < mips16_immed_operands + MIPS16_NUM_IMMED);
      }
  
    if (op->unsp)
--- 13775,13781 ----
    while (op->type != type)
      {
        ++op;
!       gas_assert (op < mips16_immed_operands + MIPS16_NUM_IMMED);
      }
  
    if (op->unsp)
*************** tc_gen_reloc (asection *section ATTRIBUT
*** 14158,14164 ****
  
    if (fixp->fx_pcrel)
      {
!       assert (fixp->fx_r_type == BFD_RELOC_16_PCREL_S2);
  
        /* At this point, fx_addnumber is "symbol offset - pcrel address".
  	 Relocations want only the symbol offset.  */
--- 14158,14164 ----
  
    if (fixp->fx_pcrel)
      {
!       gas_assert (fixp->fx_r_type == BFD_RELOC_16_PCREL_S2);
  
        /* At this point, fx_addnumber is "symbol offset - pcrel address".
  	 Relocations want only the symbol offset.  */
*************** md_convert_frag (bfd *abfd ATTRIBUTE_UNU
*** 14288,14301 ****
  		  /* bc[0-3][tf]l? and bc1any[24][ft] instructions can
  		     have the condition reversed by tweaking a single
  		     bit, and their opcodes all have 0x4???????.  */
! 		  assert ((insn & 0xf1000000) == 0x41000000);
  		  insn ^= 0x00010000;
  		  break;
  
  		case 0:
  		  /* bltz	0x04000000	bgez	0x04010000
  		     bltzal	0x04100000	bgezal	0x04110000  */
! 		  assert ((insn & 0xfc0e0000) == 0x04000000);
  		  insn ^= 0x00010000;
  		  break;
  
--- 14288,14301 ----
  		  /* bc[0-3][tf]l? and bc1any[24][ft] instructions can
  		     have the condition reversed by tweaking a single
  		     bit, and their opcodes all have 0x4???????.  */
! 		  gas_assert ((insn & 0xf1000000) == 0x41000000);
  		  insn ^= 0x00010000;
  		  break;
  
  		case 0:
  		  /* bltz	0x04000000	bgez	0x04010000
  		     bltzal	0x04100000	bgezal	0x04110000  */
! 		  gas_assert ((insn & 0xfc0e0000) == 0x04000000);
  		  insn ^= 0x00010000;
  		  break;
  
*************** md_convert_frag (bfd *abfd ATTRIBUTE_UNU
*** 14313,14319 ****
  	  if (RELAX_BRANCH_LINK (fragp->fr_subtype))
  	    {
  	      /* Clear the and-link bit.  */
! 	      assert ((insn & 0xfc1c0000) == 0x04100000);
  
  	      /* bltzal		0x04100000	bgezal	0x04110000
  		 bltzall	0x04120000	bgezall	0x04130000  */
--- 14313,14319 ----
  	  if (RELAX_BRANCH_LINK (fragp->fr_subtype))
  	    {
  	      /* Clear the and-link bit.  */
! 	      gas_assert ((insn & 0xfc1c0000) == 0x04100000);
  
  	      /* bltzal		0x04100000	bgezal	0x04110000
  		 bltzall	0x04120000	bgezall	0x04130000  */
*************** md_convert_frag (bfd *abfd ATTRIBUTE_UNU
*** 14437,14443 ****
  	    }
  	}
  
!       assert (buf == (bfd_byte *)fragp->fr_literal
  	      + fragp->fr_fix + fragp->fr_var);
  
        fragp->fr_fix += fragp->fr_var;
--- 14437,14443 ----
  	    }
  	}
  
!       gas_assert (buf == (bfd_byte *)fragp->fr_literal
  	      + fragp->fr_fix + fragp->fr_var);
  
        fragp->fr_fix += fragp->fr_var;
*************** s_mips_end (int x ATTRIBUTE_UNUSED)
*** 14935,14941 ****
  
    if (p != NULL)
      {
!       assert (S_GET_NAME (p));
        if (strcmp (S_GET_NAME (p), S_GET_NAME (cur_proc_ptr->func_sym)))
  	as_warn (_(".end symbol does not match .ent symbol."));
  
--- 14935,14941 ----
  
    if (p != NULL)
      {
!       gas_assert (S_GET_NAME (p));
        if (strcmp (S_GET_NAME (p), S_GET_NAME (cur_proc_ptr->func_sym)))
  	as_warn (_(".end symbol does not match .ent symbol."));
  
*************** s_mips_end (int x ATTRIBUTE_UNUSED)
*** 14977,14983 ****
        md_flush_pending_output ();
  #endif
  
!       assert (pdr_seg);
        subseg_set (pdr_seg, 0);
  
        /* Write the symbol.  */
--- 14977,14983 ----
        md_flush_pending_output ();
  #endif
  
!       gas_assert (pdr_seg);
        subseg_set (pdr_seg, 0);
  
        /* Write the symbol.  */
Only in src.assert/gas/config: tc-mips.c.orig
diff -crp src.head/gas/config/tc-mmix.c src.assert/gas/config/tc-mmix.c
*** src.head/gas/config/tc-mmix.c	Tue Jun 16 09:07:25 2009
--- src.assert/gas/config/tc-mmix.c	Tue Jun 16 09:39:05 2009
*************** tc_gen_reloc (asection *section ATTRIBUT
*** 2842,2848 ****
      }
  
    relP = (arelent *) xmalloc (sizeof (arelent));
!   assert (relP != 0);
    relP->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
    *relP->sym_ptr_ptr = baddsy;
    relP->address = fixP->fx_frag->fr_address + fixP->fx_where;
--- 2842,2848 ----
      }
  
    relP = (arelent *) xmalloc (sizeof (arelent));
!   gas_assert (relP != 0);
    relP->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
    *relP->sym_ptr_ptr = baddsy;
    relP->address = fixP->fx_frag->fr_address + fixP->fx_where;
diff -crp src.head/gas/config/tc-mn10300.c src.assert/gas/config/tc-mn10300.c
*** src.head/gas/config/tc-mn10300.c	Tue Jun 16 09:07:25 2009
--- src.assert/gas/config/tc-mn10300.c	Tue Jun 16 09:39:05 2009
*************** md_apply_fix (fixS * fixP, valueT * valP
*** 2322,2328 ****
    int size = 0;
    int value = (int) * valP;
  
!   assert (fixP->fx_r_type < BFD_RELOC_UNUSED);
  
    /* This should never happen.  */
    if (seg->flags & SEC_ALLOC)
--- 2322,2328 ----
    int size = 0;
    int value = (int) * valP;
  
!   gas_assert (fixP->fx_r_type < BFD_RELOC_UNUSED);
  
    /* This should never happen.  */
    if (seg->flags & SEC_ALLOC)
diff -crp src.head/gas/config/tc-moxie.c src.assert/gas/config/tc-moxie.c
*** src.head/gas/config/tc-moxie.c	Tue Jun 16 09:07:25 2009
--- src.assert/gas/config/tc-moxie.c	Wed Jun 17 13:46:52 2009
*************** tc_gen_reloc (asection *section ATTRIBUT
*** 713,719 ****
      }
  
    relP = xmalloc (sizeof (arelent));
!   assert (relP != 0);
    relP->sym_ptr_ptr = xmalloc (sizeof (asymbol *));
    *relP->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy);
    relP->address = fixP->fx_frag->fr_address + fixP->fx_where;
--- 713,719 ----
      }
  
    relP = xmalloc (sizeof (arelent));
!   gas_assert (relP != 0);
    relP->sym_ptr_ptr = xmalloc (sizeof (asymbol *));
    *relP->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy);
    relP->address = fixP->fx_frag->fr_address + fixP->fx_where;
diff -crp src.head/gas/config/tc-ns32k.c src.assert/gas/config/tc-ns32k.c
*** src.head/gas/config/tc-ns32k.c	Tue Jun 16 09:07:25 2009
--- src.assert/gas/config/tc-ns32k.c	Tue Jun 16 09:39:05 2009
*************** get_addr_mode (char *ptr, addr_modeS *ad
*** 712,718 ****
        addr_modeP->am_size += 1;
      }
  
!   assert (addr_modeP->mode >= 0); 
    if (disp_test[(unsigned int) addr_modeP->mode])
      {
        char c;
--- 712,718 ----
        addr_modeP->am_size += 1;
      }
  
!   gas_assert (addr_modeP->mode >= 0); 
    if (disp_test[(unsigned int) addr_modeP->mode])
      {
        char c;
*************** get_addr_mode (char *ptr, addr_modeS *ad
*** 725,731 ****
        /* There was a displacement, probe for length  specifying suffix.  */
        addr_modeP->pcrel = 0;
  
!       assert(addr_modeP->mode >= 0);
        if (disp_test[(unsigned int) addr_modeP->mode])
  	{
  	  /* There is a displacement.  */
--- 725,731 ----
        /* There was a displacement, probe for length  specifying suffix.  */
        addr_modeP->pcrel = 0;
  
!       gas_assert (addr_modeP->mode >= 0);
        if (disp_test[(unsigned int) addr_modeP->mode])
  	{
  	  /* There is a displacement.  */
diff -crp src.head/gas/config/tc-pj.c src.assert/gas/config/tc-pj.c
*** src.head/gas/config/tc-pj.c	Tue Jun 16 09:07:25 2009
--- src.assert/gas/config/tc-pj.c	Tue Jun 16 09:39:05 2009
*************** tc_gen_reloc (asection *section ATTRIBUT
*** 490,496 ****
  		    bfd_get_reloc_code_name (r_type));
        /* Set howto to a garbage value so that we can keep going.  */
        rel->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_32);
!       assert (rel->howto != NULL);
      }
  
    return rel;
--- 490,496 ----
  		    bfd_get_reloc_code_name (r_type));
        /* Set howto to a garbage value so that we can keep going.  */
        rel->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_32);
!       gas_assert (rel->howto != NULL);
      }
  
    return rel;
diff -crp src.head/gas/config/tc-ppc.c src.assert/gas/config/tc-ppc.c
*** src.head/gas/config/tc-ppc.c	Tue Jun 16 09:07:25 2009
--- src.assert/gas/config/tc-ppc.c	Tue Jun 16 09:39:05 2009
*************** md_assemble (char *str)
*** 2527,2533 ****
  		 explain.  */
  	      if (ex.X_op == O_symbol)
  		{
! 		  assert (ex.X_add_symbol != NULL);
  		  if (symbol_get_bfdsym (ex.X_add_symbol)->section
  		      != tocdata_section)
  		    {
--- 2527,2533 ----
  		 explain.  */
  	      if (ex.X_op == O_symbol)
  		{
! 		  gas_assert (ex.X_add_symbol != NULL);
  		  if (symbol_get_bfdsym (ex.X_add_symbol)->section
  		      != tocdata_section)
  		    {
*************** md_apply_fix (fixS *fixP, valueT *valP, 
*** 5819,5825 ****
  	/* Nothing else to do here.  */
  	return;
  
!       assert (fixP->fx_addsy != NULL);
  
        /* Determine a BFD reloc value based on the operand information.
  	 We are only prepared to turn a few of the operands into
--- 5819,5825 ----
  	/* Nothing else to do here.  */
  	return;
  
!       gas_assert (fixP->fx_addsy != NULL);
  
        /* Determine a BFD reloc value based on the operand information.
  	 We are only prepared to turn a few of the operands into
Only in src.assert/gas/config: tc-ppc.c.orig
diff -crp src.head/gas/config/tc-s390.c src.assert/gas/config/tc-s390.c
*** src.head/gas/config/tc-s390.c	Tue Jun 16 09:07:25 2009
--- src.assert/gas/config/tc-s390.c	Tue Jun 16 09:39:05 2009
*************** tc_gen_reloc (asection *seg ATTRIBUTE_UN
*** 2220,2226 ****
  		    bfd_get_reloc_code_name (code));
        /* Set howto to a garbage value so that we can keep going.  */
        reloc->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_32);
!       assert (reloc->howto != NULL);
      }
    reloc->addend = fixp->fx_offset;
  
--- 2220,2226 ----
  		    bfd_get_reloc_code_name (code));
        /* Set howto to a garbage value so that we can keep going.  */
        reloc->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_32);
!       gas_assert (reloc->howto != NULL);
      }
    reloc->addend = fixp->fx_offset;
  
diff -crp src.head/gas/config/tc-score.c src.assert/gas/config/tc-score.c
*** src.head/gas/config/tc-score.c	Tue Jun 16 09:07:25 2009
--- src.assert/gas/config/tc-score.c	Wed Jun 17 13:34:45 2009
*************** s3_do_macro_la_rdi32 (char *str)
*** 4286,4292 ****
  		}
  	      else
  		{
! 		  assert (s3_inst.reloc.exp.X_add_symbol);
  		  s3_build_la_pic (reg_rd, s3_inst.reloc.exp);
  		}
  
--- 4286,4292 ----
  		}
  	      else
  		{
! 		  gas_assert (s3_inst.reloc.exp.X_add_symbol);
  		  s3_build_la_pic (reg_rd, s3_inst.reloc.exp);
  		}
  
*************** s3_do_macro_bcmp (char *str)
*** 4555,4561 ****
                }
              else
                {
!                 assert (s3_inst.reloc.exp.X_add_symbol);
                }
              /* Set bwarn as -1, so macro instruction itself will not be generated frag.  */
              s3_inst.bwarn = -1;
--- 4555,4561 ----
                }
              else
                {
!                 gas_assert (s3_inst.reloc.exp.X_add_symbol);
                }
              /* Set bwarn as -1, so macro instruction itself will not be generated frag.  */
              s3_inst.bwarn = -1;
*************** s3_do_macro_bcmp (char *str)
*** 4589,4595 ****
          }
        else
          {
!           assert (s3_inst.reloc.exp.X_add_symbol);
          }
        inst_main.relax_size = inst_expand[0].size + inst_expand[1].size;
        inst_main.type = Insn_BCMP;
--- 4589,4595 ----
          }
        else
          {
!           gas_assert (s3_inst.reloc.exp.X_add_symbol);
          }
        inst_main.relax_size = inst_expand[0].size + inst_expand[1].size;
        inst_main.type = Insn_BCMP;
*************** s3_do_macro_bcmpz (char *str)
*** 4704,4710 ****
              }
            else
              {
!               assert (s3_inst.reloc.exp.X_add_symbol);
              }
            /* Set bwarn as -1, so macro instruction itself will not be generated frag.  */
            s3_inst.bwarn = -1;
--- 4704,4710 ----
              }
            else
              {
!               gas_assert (s3_inst.reloc.exp.X_add_symbol);
              }
            /* Set bwarn as -1, so macro instruction itself will not be generated frag.  */
            s3_inst.bwarn = -1;
*************** s3_do_macro_bcmpz (char *str)
*** 4737,4743 ****
          }
        else
          {
!           assert (s3_inst.reloc.exp.X_add_symbol);
          }
        inst_main.relax_size = inst_expand[0].size + inst_expand[1].size;
        inst_main.type = Insn_BCMP;
--- 4737,4743 ----
          }
        else
          {
!           gas_assert (s3_inst.reloc.exp.X_add_symbol);
          }
        inst_main.relax_size = inst_expand[0].size + inst_expand[1].size;
        inst_main.type = Insn_BCMP;
*************** s3_s_score_end (int x ATTRIBUTE_UNUSED)
*** 5825,5831 ****
      }
    if (p != NULL)
      {
!       assert (S_GET_NAME (p));
        if (strcmp (S_GET_NAME (p), S_GET_NAME (s3_cur_proc_ptr->isym)))
          as_warn (_(".end symbol does not match .ent symbol."));
        if (debug_type == DEBUG_STABS)
--- 5825,5831 ----
      }
    if (p != NULL)
      {
!       gas_assert (S_GET_NAME (p));
        if (strcmp (S_GET_NAME (p), S_GET_NAME (s3_cur_proc_ptr->isym)))
          as_warn (_(".end symbol does not match .ent symbol."));
        if (debug_type == DEBUG_STABS)
*************** s3_s_score_end (int x ATTRIBUTE_UNUSED)
*** 5843,5849 ****
    else
      {
        dot = frag_now_fix ();
!       assert (s3_pdr_seg);
        subseg_set (s3_pdr_seg, 0);
        /* Write the symbol.  */
        exp.X_op = O_symbol;
--- 5843,5849 ----
    else
      {
        dot = frag_now_fix ();
!       gas_assert (s3_pdr_seg);
        subseg_set (s3_pdr_seg, 0);
        /* Write the symbol.  */
        exp.X_op = O_symbol;
*************** s3_apply_fix (fixS *fixP, valueT *valP, 
*** 7103,7109 ****
  
    char *buf = fixP->fx_frag->fr_literal + fixP->fx_where;
  
!   assert (fixP->fx_r_type < BFD_RELOC_UNUSED);
    if (fixP->fx_addsy == 0 && !fixP->fx_pcrel)
      {
        if (fixP->fx_r_type != BFD_RELOC_SCORE_DUMMY_HI16)
--- 7103,7109 ----
  
    char *buf = fixP->fx_frag->fr_literal + fixP->fx_where;
  
!   gas_assert (fixP->fx_r_type < BFD_RELOC_UNUSED);
    if (fixP->fx_addsy == 0 && !fixP->fx_pcrel)
      {
        if (fixP->fx_r_type != BFD_RELOC_SCORE_DUMMY_HI16)
*************** s3_gen_reloc (asection * section ATTRIBU
*** 7446,7452 ****
  
        retval[1]->addend = 0;
        retval[1]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_LO16);
!       assert (retval[1]->howto != NULL);
  
        fixp->fx_r_type = BFD_RELOC_HI16_S;
      }
--- 7446,7452 ----
  
        retval[1]->addend = 0;
        retval[1]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_LO16);
!       gas_assert (retval[1]->howto != NULL);
  
        fixp->fx_r_type = BFD_RELOC_HI16_S;
      }
Only in src.assert/gas/config: tc-score.c.orig
Only in src.assert/gas/config: tc-score.c.rej
diff -crp src.head/gas/config/tc-score7.c src.assert/gas/config/tc-score7.c
*** src.head/gas/config/tc-score7.c	Tue Jun 16 09:07:25 2009
--- src.assert/gas/config/tc-score7.c	Wed Jun 17 13:05:17 2009
*************** s7_do_macro_la_rdi32 (char *str)
*** 4382,4388 ****
  		}
  	      else
  		{
! 		  assert (s7_inst.reloc.exp.X_add_symbol);
  		  s7_build_la_pic (reg_rd, s7_inst.reloc.exp);
  		}
  
--- 4382,4388 ----
  		}
  	      else
  		{
! 		  gas_assert (s7_inst.reloc.exp.X_add_symbol);
  		  s7_build_la_pic (reg_rd, s7_inst.reloc.exp);
  		}
  
*************** s7_s_score_end (int x ATTRIBUTE_UNUSED)
*** 5676,5682 ****
      }
    if (p != NULL)
      {
!       assert (S_GET_NAME (p));
        if (strcmp (S_GET_NAME (p), S_GET_NAME (s7_cur_proc_ptr->isym)))
          as_warn (_(".end symbol does not match .ent symbol."));
        if (debug_type == DEBUG_STABS)
--- 5676,5682 ----
      }
    if (p != NULL)
      {
!       gas_assert (S_GET_NAME (p));
        if (strcmp (S_GET_NAME (p), S_GET_NAME (s7_cur_proc_ptr->isym)))
          as_warn (_(".end symbol does not match .ent symbol."));
        if (debug_type == DEBUG_STABS)
*************** s7_s_score_end (int x ATTRIBUTE_UNUSED)
*** 5694,5700 ****
    else
      {
        dot = frag_now_fix ();
!       assert (s7_pdr_seg);
        subseg_set (s7_pdr_seg, 0);
        /* Write the symbol.  */
        exp.X_op = O_symbol;
--- 5694,5700 ----
    else
      {
        dot = frag_now_fix ();
!       gas_assert (s7_pdr_seg);
        subseg_set (s7_pdr_seg, 0);
        /* Write the symbol.  */
        exp.X_op = O_symbol;
*************** s7_apply_fix (fixS *fixP, valueT *valP, 
*** 6658,6664 ****
  
    char *buf = fixP->fx_frag->fr_literal + fixP->fx_where;
  
!   assert (fixP->fx_r_type < BFD_RELOC_UNUSED);
    if (fixP->fx_addsy == 0 && !fixP->fx_pcrel)
      {
        if (fixP->fx_r_type != BFD_RELOC_SCORE_DUMMY_HI16)
--- 6658,6664 ----
  
    char *buf = fixP->fx_frag->fr_literal + fixP->fx_where;
  
!   gas_assert (fixP->fx_r_type < BFD_RELOC_UNUSED);
    if (fixP->fx_addsy == 0 && !fixP->fx_pcrel)
      {
        if (fixP->fx_r_type != BFD_RELOC_SCORE_DUMMY_HI16)
*************** s7_gen_reloc (asection * section ATTRIBU
*** 6932,6938 ****
  
        retval[1]->addend = 0;
        retval[1]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_LO16);
!       assert (retval[1]->howto != NULL);
  
        fixp->fx_r_type = BFD_RELOC_HI16_S;
      }
--- 6932,6938 ----
  
        retval[1]->addend = 0;
        retval[1]->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_LO16);
!       gas_assert (retval[1]->howto != NULL);
  
        fixp->fx_r_type = BFD_RELOC_HI16_S;
      }
diff -crp src.head/gas/config/tc-sh.c src.assert/gas/config/tc-sh.c
*** src.head/gas/config/tc-sh.c	Tue Jun 16 09:07:25 2009
--- src.assert/gas/config/tc-sh.c	Tue Jun 16 09:39:05 2009
*************** tc_gen_reloc (asection *section ATTRIBUT
*** 4375,4381 ****
  		    bfd_get_reloc_code_name (r_type));
        /* Set howto to a garbage value so that we can keep going.  */
        rel->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_32);
!       assert (rel->howto != NULL);
      }
  #ifdef OBJ_ELF
    else if (rel->howto->type == R_SH_IND12W)
--- 4375,4381 ----
  		    bfd_get_reloc_code_name (r_type));
        /* Set howto to a garbage value so that we can keep going.  */
        rel->howto = bfd_reloc_type_lookup (stdoutput, BFD_RELOC_32);
!       gas_assert (rel->howto != NULL);
      }
  #ifdef OBJ_ELF
    else if (rel->howto->type == R_SH_IND12W)
diff -crp src.head/gas/config/tc-sparc.c src.assert/gas/config/tc-sparc.c
*** src.head/gas/config/tc-sparc.c	Tue Jun 16 09:07:25 2009
--- src.assert/gas/config/tc-sparc.c	Tue Jun 16 09:39:05 2009
*************** md_assemble (char *str)
*** 1356,1362 ****
  	   The workaround is to add an fmovs of the destination register to
  	   itself just after the instruction.  This was true on machines
  	   with Weitek 1165 float chips, such as the Sun-4/260 and /280.  */
! 	assert (the_insn.reloc == BFD_RELOC_NONE);
  	the_insn.opcode = FMOVS_INSN | rd | RD (rd);
  	output_insn (insn, &the_insn);
  	return;
--- 1356,1362 ----
  	   The workaround is to add an fmovs of the destination register to
  	   itself just after the instruction.  This was true on machines
  	   with Weitek 1165 float chips, such as the Sun-4/260 and /280.  */
! 	gas_assert (the_insn.reloc == BFD_RELOC_NONE);
  	the_insn.opcode = FMOVS_INSN | rd | RD (rd);
  	output_insn (insn, &the_insn);
  	return;
*************** sparc_ip (char *str, const struct sparc_
*** 2745,2751 ****
  		sparc_ffs (SPARC_OPCODE_SUPPORTED (max_architecture)
  			   & needed_arch_mask);
  
! 	      assert (needed_architecture <= SPARC_OPCODE_ARCH_MAX);
  	      if (warn_on_bump
  		  && needed_architecture > warn_after_architecture)
  		{
--- 2745,2751 ----
  		sparc_ffs (SPARC_OPCODE_SUPPORTED (max_architecture)
  			   & needed_arch_mask);
  
! 	      gas_assert (needed_architecture <= SPARC_OPCODE_ARCH_MAX);
  	      if (warn_on_bump
  		  && needed_architecture > warn_after_architecture)
  		{
*************** md_apply_fix (fixS *fixP, valueT *valP, 
*** 2959,2965 ****
    offsetT val = * (offsetT *) valP;
    long insn;
  
!   assert (fixP->fx_r_type < BFD_RELOC_UNUSED);
  
    fixP->fx_addnumber = val;	/* Remember value for emit_reloc.  */
  
--- 2959,2965 ----
    offsetT val = * (offsetT *) valP;
    long insn;
  
!   gas_assert (fixP->fx_r_type < BFD_RELOC_UNUSED);
  
    fixP->fx_addnumber = val;	/* Remember value for emit_reloc.  */
  
*************** sparc_cons_align (int nbytes)
*** 4196,4202 ****
    if (nalign == 0)
      return;
  
!   assert (nalign > 0);
  
    if (now_seg == absolute_section)
      {
--- 4196,4202 ----
    if (nalign == 0)
      return;
  
!   gas_assert (nalign > 0);
  
    if (now_seg == absolute_section)
      {
Only in src.assert/gas/config: tc-sparc.c.orig
diff -crp src.head/gas/config/tc-spu.c src.assert/gas/config/tc-spu.c
*** src.head/gas/config/tc-spu.c	Tue Jun 16 09:07:25 2009
--- src.assert/gas/config/tc-spu.c	Tue Jun 16 09:39:05 2009
*************** md_assemble (char *op)
*** 273,279 ****
    struct spu_insn insn;
    int i;
  
!   assert (op);
  
    /* skip over instruction to find parameters */
  
--- 273,279 ----
    struct spu_insn insn;
    int i;
  
!   gas_assert (op);
  
    /* skip over instruction to find parameters */
  
Only in src.assert/gas/config: tc-spu.c.orig
diff -crp src.head/gas/config/tc-tic30.c src.assert/gas/config/tc-tic30.c
*** src.head/gas/config/tc-tic30.c	Tue Jun 16 09:07:25 2009
--- src.assert/gas/config/tc-tic30.c	Tue Jun 16 09:39:05 2009
*************** tc_gen_reloc (asection *section ATTRIBUT
*** 1388,1394 ****
  #undef F
  
    rel = xmalloc (sizeof (* rel));
!   assert (rel != 0);
    rel->sym_ptr_ptr = xmalloc (sizeof (asymbol *));
    *rel->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy);
    rel->address = fixP->fx_frag->fr_address + fixP->fx_where;
--- 1388,1394 ----
  #undef F
  
    rel = xmalloc (sizeof (* rel));
!   gas_assert (rel != 0);
    rel->sym_ptr_ptr = xmalloc (sizeof (asymbol *));
    *rel->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy);
    rel->address = fixP->fx_frag->fr_address + fixP->fx_where;
*************** md_assemble (char *line)
*** 2003,2006 ****
    debug ("Final opcode: %08X\n", insn.opcode);
    debug ("\n");
  }
- 
--- 2003,2005 ----
diff -crp src.head/gas/config/tc-vax.c src.assert/gas/config/tc-vax.c
*** src.head/gas/config/tc-vax.c	Tue Jun 16 09:07:25 2009
--- src.assert/gas/config/tc-vax.c	Tue Jun 16 09:39:05 2009
*************** tc_gen_reloc (asection *section ATTRIBUT
*** 2400,2406 ****
  #endif
  
    reloc->howto = bfd_reloc_type_lookup (stdoutput, code);
!   assert (reloc->howto != 0);
  
    return reloc;
  }
--- 2400,2406 ----
  #endif
  
    reloc->howto = bfd_reloc_type_lookup (stdoutput, code);
!   gas_assert (reloc->howto != 0);
  
    return reloc;
  }
Only in src.assert/gas/config: tc-vax.c.orig
diff -crp src.head/gas/config/tc-xtensa.c src.assert/gas/config/tc-xtensa.c
*** src.head/gas/config/tc-xtensa.c	Tue Jun 16 09:07:25 2009
--- src.assert/gas/config/tc-xtensa.c	Tue Jun 16 09:39:05 2009
*************** use_transform (void)
*** 1055,1061 ****
  {
    /* After md_end, you should be checking frag by frag, rather
       than state directives.  */
!   assert (!past_xtensa_end);
    return directive_state[directive_transform];
  }
  
--- 1055,1061 ----
  {
    /* After md_end, you should be checking frag by frag, rather
       than state directives.  */
!   gas_assert (!past_xtensa_end);
    return directive_state[directive_transform];
  }
  
*************** do_align_targets (void)
*** 1066,1072 ****
    /* Do not use this function after md_end; just look at align_targets
       instead.  There is no target-align directive, so alignment is either
       enabled for all frags or not done at all.  */
!   assert (!past_xtensa_end);
    return align_targets && use_transform ();
  }
  
--- 1066,1072 ----
    /* Do not use this function after md_end; just look at align_targets
       instead.  There is no target-align directive, so alignment is either
       enabled for all frags or not done at all.  */
!   gas_assert (!past_xtensa_end);
    return align_targets && use_transform ();
  }
  
*************** xtensa_begin_directive (int ignore ATTRI
*** 1252,1258 ****
        /* Allocate the literal state for this section and push
  	 onto the directive stack.  */
        ls = xmalloc (sizeof (lit_state));
!       assert (ls);
  
        *ls = default_lit_sections;
        directive_push (directive_literal_prefix, negated, ls);
--- 1252,1258 ----
        /* Allocate the literal state for this section and push
  	 onto the directive stack.  */
        ls = xmalloc (sizeof (lit_state));
!       gas_assert (ls);
  
        *ls = default_lit_sections;
        directive_push (directive_literal_prefix, negated, ls);
*************** xtensa_end_directive (int ignore ATTRIBU
*** 1377,1383 ****
  	    case directive_literal_prefix:
  	      /* Restore the default collection sections from saved state.  */
  	      s = (lit_state *) state;
! 	      assert (s);
  	      default_lit_sections = *s;
  
  	      /* Free the state storage.  */
--- 1377,1383 ----
  	    case directive_literal_prefix:
  	      /* Restore the default collection sections from saved state.  */
  	      s = (lit_state *) state;
! 	      gas_assert (s);
  	      default_lit_sections = *s;
  
  	      /* Free the state storage.  */
*************** xtensa_literal_prefix (void)
*** 1501,1507 ****
  
    /* Get a null-terminated copy of the name.  */
    name = xmalloc (len + 1);
!   assert (name);
    strncpy (name, input_line_pointer, len);
    name[len] = 0;
  
--- 1501,1507 ----
  
    /* Get a null-terminated copy of the name.  */
    name = xmalloc (len + 1);
!   gas_assert (name);
    strncpy (name, input_line_pointer, len);
    name[len] = 0;
  
*************** map_suffix_reloc_to_operator (bfd_reloc_
*** 1696,1702 ****
  	  break;
  	}
      }
!   assert (operator != (unsigned char) -1);
    return operator;
  }
  
--- 1696,1702 ----
  	  break;
  	}
      }
!   gas_assert (operator != (unsigned char) -1);
    return operator;
  }
  
*************** expression_maybe_register (xtensa_opcode
*** 1826,1832 ****
        if (t == absolute_section
  	  && xtensa_operand_is_PCrelative (isa, opc, opnd) == 1)
  	{
! 	  assert (tok->X_op == O_constant);
  	  tok->X_op = O_symbol;
  	  tok->X_add_symbol = &abs_symbol;
  	}
--- 1826,1832 ----
        if (t == absolute_section
  	  && xtensa_operand_is_PCrelative (isa, opc, opnd) == 1)
  	{
! 	  gas_assert (tok->X_op == O_constant);
  	  tok->X_op = O_symbol;
  	  tok->X_add_symbol = &abs_symbol;
  	}
*************** parse_arguments (TInsn *insn, int num_ar
*** 2014,2020 ****
  	  input_line_pointer++;
  	  if (num_regs == 0)
  	    goto err;
! 	  assert (opnd_cnt > 0);
  	  num_regs--;
  	  opnd_rf = xtensa_operand_regfile (isa, opcode, last_opnd_cnt);
  	  if (next_reg
--- 2014,2020 ----
  	  input_line_pointer++;
  	  if (num_regs == 0)
  	    goto err;
! 	  gas_assert (opnd_cnt > 0);
  	  num_regs--;
  	  opnd_rf = xtensa_operand_regfile (isa, opcode, last_opnd_cnt);
  	  if (next_reg
*************** parse_arguments (TInsn *insn, int num_ar
*** 2029,2035 ****
  	      as_warn (_("too many arguments"));
  	      goto err;
  	    }
! 	  assert (opnd_cnt < MAX_INSN_ARGS);
  
  	  expression_maybe_register (opcode, opnd_cnt, tok);
  	  next_reg = tok->X_add_number + 1;
--- 2029,2035 ----
  	      as_warn (_("too many arguments"));
  	      goto err;
  	    }
! 	  gas_assert (opnd_cnt < MAX_INSN_ARGS);
  
  	  expression_maybe_register (opcode, opnd_cnt, tok);
  	  next_reg = tok->X_add_number + 1;
*************** xtensa_translate_zero_immed (char *old_o
*** 2356,2362 ****
    offsetT val;
  
    opname = *popname;
!   assert (opname[0] != '_');
  
    if (strcmp (opname, old_op) != 0)
      return 0;
--- 2356,2362 ----
    offsetT val;
  
    opname = *popname;
!   gas_assert (opname[0] != '_');
  
    if (strcmp (opname, old_op) != 0)
      return 0;
*************** xg_instruction_matches_rule (TInsn *insn
*** 2832,2838 ****
  	{
  	case OP_CONSTANT:
  	  /* The expression must be the constant.  */
! 	  assert (cond->op_num < insn->ntok);
  	  exp1 = &insn->tok[cond->op_num];
  	  if (expr_is_const (exp1))
  	    {
--- 2832,2838 ----
  	{
  	case OP_CONSTANT:
  	  /* The expression must be the constant.  */
! 	  gas_assert (cond->op_num < insn->ntok);
  	  exp1 = &insn->tok[cond->op_num];
  	  if (expr_is_const (exp1))
  	    {
*************** xg_instruction_matches_rule (TInsn *insn
*** 2871,2878 ****
  	  break;
  
  	case OP_OPERAND:
! 	  assert (cond->op_num < insn->ntok);
! 	  assert (cond->op_data < insn->ntok);
  	  exp1 = &insn->tok[cond->op_num];
  	  exp2 = &insn->tok[cond->op_data];
  
--- 2871,2878 ----
  	  break;
  
  	case OP_OPERAND:
! 	  gas_assert (cond->op_num < insn->ntok);
! 	  gas_assert (cond->op_data < insn->ntok);
  	  exp1 = &insn->tok[cond->op_num];
  	  exp2 = &insn->tok[cond->op_data];
  
*************** xg_instruction_match (TInsn *insn)
*** 2974,2980 ****
  {
    TransitionTable *table = xg_build_simplify_table (&transition_rule_cmp);
    TransitionList *l;
!   assert (insn->opcode < table->num_opcodes);
  
    /* Walk through all of the possible transitions.  */
    for (l = table->table[insn->opcode]; l != NULL; l = l->next)
--- 2974,2980 ----
  {
    TransitionTable *table = xg_build_simplify_table (&transition_rule_cmp);
    TransitionList *l;
!   gas_assert (insn->opcode < table->num_opcodes);
  
    /* Walk through all of the possible transitions.  */
    for (l = table->table[insn->opcode]; l != NULL; l = l->next)
*************** xg_is_single_relaxable_insn (TInsn *insn
*** 3017,3024 ****
    TransitionList *l;
    TransitionRule *match = 0;
  
!   assert (insn->insn_type == ITYPE_INSN);
!   assert (insn->opcode < table->num_opcodes);
  
    for (l = table->table[insn->opcode]; l != NULL; l = l->next)
      {
--- 3017,3024 ----
    TransitionList *l;
    TransitionRule *match = 0;
  
!   gas_assert (insn->insn_type == ITYPE_INSN);
!   gas_assert (insn->opcode < table->num_opcodes);
  
    for (l = table->table[insn->opcode]; l != NULL; l = l->next)
      {
*************** xg_get_max_insn_widen_size (xtensa_opcod
*** 3052,3058 ****
    TransitionList *l;
    int max_size = xg_get_single_size (opcode);
  
!   assert (opcode < table->num_opcodes);
  
    for (l = table->table[opcode]; l != NULL; l = l->next)
      {
--- 3052,3058 ----
    TransitionList *l;
    int max_size = xg_get_single_size (opcode);
  
!   gas_assert (opcode < table->num_opcodes);
  
    for (l = table->table[opcode]; l != NULL; l = l->next)
      {
*************** xg_get_max_insn_widen_size (xtensa_opcod
*** 3065,3071 ****
        build_list = rule->to_instr;
        if (is_unique_insn_expansion (rule))
  	{
! 	  assert (build_list->typ == INSTR_INSTR);
  	  this_size = xg_get_max_insn_widen_size (build_list->opcode);
  	}
        else
--- 3065,3071 ----
        build_list = rule->to_instr;
        if (is_unique_insn_expansion (rule))
  	{
! 	  gas_assert (build_list->typ == INSTR_INSTR);
  	  this_size = xg_get_max_insn_widen_size (build_list->opcode);
  	}
        else
*************** xg_get_max_insn_widen_literal_size (xten
*** 3098,3104 ****
    TransitionList *l;
    int max_size = 0;
  
!   assert (opcode < table->num_opcodes);
  
    for (l = table->table[opcode]; l != NULL; l = l->next)
      {
--- 3098,3104 ----
    TransitionList *l;
    int max_size = 0;
  
!   gas_assert (opcode < table->num_opcodes);
  
    for (l = table->table[opcode]; l != NULL; l = l->next)
      {
*************** xg_get_max_insn_widen_literal_size (xten
*** 3111,3117 ****
        build_list = rule->to_instr;
        if (is_unique_insn_expansion (rule))
  	{
! 	  assert (build_list->typ == INSTR_INSTR);
  	  this_size = xg_get_max_insn_widen_literal_size (build_list->opcode);
  	}
        else
--- 3111,3117 ----
        build_list = rule->to_instr;
        if (is_unique_insn_expansion (rule))
  	{
! 	  gas_assert (build_list->typ == INSTR_INSTR);
  	  this_size = xg_get_max_insn_widen_literal_size (build_list->opcode);
  	}
        else
*************** xg_is_relaxable_insn (TInsn *insn, int l
*** 3143,3150 ****
    TransitionTable *table = xg_build_widen_table (&transition_rule_cmp);
    TransitionList *l;
  
!   assert (insn->insn_type == ITYPE_INSN);
!   assert (insn->opcode < table->num_opcodes);
  
    for (l = table->table[insn->opcode]; l != NULL; l = l->next)
      {
--- 3143,3150 ----
    TransitionTable *table = xg_build_widen_table (&transition_rule_cmp);
    TransitionList *l;
  
!   gas_assert (insn->insn_type == ITYPE_INSN);
!   gas_assert (insn->opcode < table->num_opcodes);
  
    for (l = table->table[insn->opcode]; l != NULL; l = l->next)
      {
*************** xg_immeds_fit (const TInsn *insn)
*** 3229,3235 ****
    int i;
  
    int n = insn->ntok;
!   assert (insn->insn_type == ITYPE_INSN);
    for (i = 0; i < n; ++i)
      {
        const expressionS *expr = &insn->tok[i];
--- 3229,3235 ----
    int i;
  
    int n = insn->ntok;
!   gas_assert (insn->insn_type == ITYPE_INSN);
    for (i = 0; i < n; ++i)
      {
        const expressionS *expr = &insn->tok[i];
*************** xg_immeds_fit (const TInsn *insn)
*** 3246,3252 ****
  
  	default:
  	  /* The symbol should have a fixup associated with it.  */
! 	  assert (FALSE);
  	  break;
  	}
      }
--- 3246,3252 ----
  
  	default:
  	  /* The symbol should have a fixup associated with it.  */
! 	  gas_assert (FALSE);
  	  break;
  	}
      }
*************** xg_symbolic_immeds_fit (const TInsn *ins
*** 3272,3278 ****
    int i;
    int n = insn->ntok;
  
!   assert (insn->insn_type == ITYPE_INSN);
  
    for (i = 0; i < n; ++i)
      {
--- 3272,3278 ----
    int i;
    int n = insn->ntok;
  
!   gas_assert (insn->insn_type == ITYPE_INSN);
  
    for (i = 0; i < n; ++i)
      {
*************** xg_build_to_insn (TInsn *targ, TInsn *in
*** 3380,3386 ****
  	  int op_num = op->op_num;
  	  int op_data = op->op_data;
  
! 	  assert (op->op_num < MAX_INSN_ARGS);
  
  	  if (targ->ntok <= op_num)
  	    targ->ntok = op_num + 1;
--- 3380,3386 ----
  	  int op_num = op->op_num;
  	  int op_data = op->op_data;
  
! 	  gas_assert (op->op_num < MAX_INSN_ARGS);
  
  	  if (targ->ntok <= op_num)
  	    targ->ntok = op_num + 1;
*************** xg_build_to_insn (TInsn *targ, TInsn *in
*** 3391,3397 ****
  	      set_expr_const (&targ->tok[op_num], op_data);
  	      break;
  	    case OP_OPERAND:
! 	      assert (op_data < insn->ntok);
  	      copy_expr (&targ->tok[op_num], &insn->tok[op_data]);
  	      break;
  	    case OP_FREEREG:
--- 3391,3397 ----
  	      set_expr_const (&targ->tok[op_num], op_data);
  	      break;
  	    case OP_OPERAND:
! 	      gas_assert (op_data < insn->ntok);
  	      copy_expr (&targ->tok[op_num], &insn->tok[op_data]);
  	      break;
  	    case OP_FREEREG:
*************** xg_build_to_insn (TInsn *targ, TInsn *in
*** 3412,3418 ****
  	      break;
  	    case OP_OPERAND_HI16U:
  	    case OP_OPERAND_LOW16U:
! 	      assert (op_data < insn->ntok);
  	      if (expr_is_const (&insn->tok[op_data]))
  		{
  		  long val;
--- 3412,3418 ----
  	      break;
  	    case OP_OPERAND_HI16U:
  	    case OP_OPERAND_LOW16U:
! 	      gas_assert (op_data < insn->ntok);
  	      if (expr_is_const (&insn->tok[op_data]))
  		{
  		  long val;
*************** xg_build_to_insn (TInsn *targ, TInsn *in
*** 3428,3434 ****
  		  if (targ->opcode == XTENSA_UNDEFINED
  		      || (targ->opcode != xtensa_const16_opcode))
  		    return FALSE;
! 		  assert (op_data < insn->ntok);
  		  /* Need to build a O_lo16 or O_hi16.  */
  		  copy_expr (&targ->tok[op_num], &insn->tok[op_data]);
  		  if (targ->tok[op_num].X_op == O_symbol)
--- 3428,3434 ----
  		  if (targ->opcode == XTENSA_UNDEFINED
  		      || (targ->opcode != xtensa_const16_opcode))
  		    return FALSE;
! 		  gas_assert (op_data < insn->ntok);
  		  /* Need to build a O_lo16 or O_hi16.  */
  		  copy_expr (&targ->tok[op_num], &insn->tok[op_data]);
  		  if (targ->tok[op_num].X_op == O_symbol)
*************** xg_build_to_insn (TInsn *targ, TInsn *in
*** 3449,3455 ****
  		 OP_OPERAND_F32MINUS */
  	      if (xg_has_userdef_op_fn (op->typ))
  		{
! 		  assert (op_data < insn->ntok);
  		  if (expr_is_const (&insn->tok[op_data]))
  		    {
  		      long val;
--- 3449,3455 ----
  		 OP_OPERAND_F32MINUS */
  	      if (xg_has_userdef_op_fn (op->typ))
  		{
! 		  gas_assert (op_data < insn->ntok);
  		  if (expr_is_const (&insn->tok[op_data]))
  		    {
  		      long val;
*************** xg_build_to_insn (TInsn *targ, TInsn *in
*** 3463,3469 ****
  		    return FALSE; /* We cannot use a relocation for this.  */
  		  break;
  		}
! 	      assert (0);
  	      break;
  	    }
  	}
--- 3463,3469 ----
  		    return FALSE; /* We cannot use a relocation for this.  */
  		  break;
  		}
! 	      gas_assert (0);
  	      break;
  	    }
  	}
*************** xg_build_to_insn (TInsn *targ, TInsn *in
*** 3478,3484 ****
  	{
  	  int op_num = op->op_num;
  	  int op_data = op->op_data;
! 	  assert (op->op_num < MAX_INSN_ARGS);
  
  	  if (targ->ntok <= op_num)
  	    targ->ntok = op_num + 1;
--- 3478,3484 ----
  	{
  	  int op_num = op->op_num;
  	  int op_data = op->op_data;
! 	  gas_assert (op->op_num < MAX_INSN_ARGS);
  
  	  if (targ->ntok <= op_num)
  	    targ->ntok = op_num + 1;
*************** xg_build_to_insn (TInsn *targ, TInsn *in
*** 3486,3492 ****
  	  switch (op->typ)
  	    {
  	    case OP_OPERAND:
! 	      assert (op_data < insn->ntok);
  	      /* We can only pass resolvable literals through.  */
  	      if (!xg_valid_literal_expression (&insn->tok[op_data]))
  		return FALSE;
--- 3486,3492 ----
  	  switch (op->typ)
  	    {
  	    case OP_OPERAND:
! 	      gas_assert (op_data < insn->ntok);
  	      /* We can only pass resolvable literals through.  */
  	      if (!xg_valid_literal_expression (&insn->tok[op_data]))
  		return FALSE;
*************** xg_build_to_insn (TInsn *targ, TInsn *in
*** 3496,3502 ****
  	    case OP_CONSTANT:
  	    case OP_LABEL:
  	    default:
! 	      assert (0);
  	      break;
  	    }
  	}
--- 3496,3502 ----
  	    case OP_CONSTANT:
  	    case OP_LABEL:
  	    default:
! 	      gas_assert (0);
  	      break;
  	    }
  	}
*************** xg_build_to_insn (TInsn *targ, TInsn *in
*** 3508,3518 ****
        targ->insn_type = ITYPE_LABEL;
        targ->is_specific_opcode = FALSE;
        /* Literal with no ops is a label?  */
!       assert (op == NULL);
        break;
  
      default:
!       assert (0);
      }
  
    return TRUE;
--- 3508,3518 ----
        targ->insn_type = ITYPE_LABEL;
        targ->is_specific_opcode = FALSE;
        /* Literal with no ops is a label?  */
!       gas_assert (op == NULL);
        break;
  
      default:
!       gas_assert (0);
      }
  
    return TRUE;
*************** xg_expand_to_stack (IStack *istack, TIns
*** 3545,3552 ****
    TransitionTable *table = xg_build_widen_table (&transition_rule_cmp);
    TransitionList *l;
  
!   assert (insn->insn_type == ITYPE_INSN);
!   assert (insn->opcode < table->num_opcodes);
  
    for (l = table->table[insn->opcode]; l != NULL; l = l->next)
      {
--- 3545,3552 ----
    TransitionTable *table = xg_build_widen_table (&transition_rule_cmp);
    TransitionList *l;
  
!   gas_assert (insn->insn_type == ITYPE_INSN);
!   gas_assert (insn->opcode < table->num_opcodes);
  
    for (l = table->table[insn->opcode]; l != NULL; l = l->next)
      {
*************** xg_finish_frag (char *last_insn,
*** 3713,3719 ****
    xtensa_set_frag_assembly_state (frag_now);
  
    /* Just to make sure that we did not split it up.  */
!   assert (old_frag->fr_next == frag_now);
  }
  
  
--- 3713,3719 ----
    xtensa_set_frag_assembly_state (frag_now);
  
    /* Just to make sure that we did not split it up.  */
!   gas_assert (old_frag->fr_next == frag_now);
  }
  
  
*************** xg_build_token_insn (BuildInstr *instr_s
*** 3863,3876 ****
  	{
  	case OP_CONSTANT:
  	  /* The expression must be the constant.  */
! 	  assert (b_op->op_num < MAX_INSN_ARGS);
  	  exp = &new_insn->tok[b_op->op_num];
  	  set_expr_const (exp, b_op->op_data);
  	  break;
  
  	case OP_OPERAND:
! 	  assert (b_op->op_num < MAX_INSN_ARGS);
! 	  assert (b_op->op_data < (unsigned) old_insn->ntok);
  	  src_exp = &old_insn->tok[b_op->op_data];
  	  exp = &new_insn->tok[b_op->op_num];
  	  copy_expr (exp, src_exp);
--- 3863,3876 ----
  	{
  	case OP_CONSTANT:
  	  /* The expression must be the constant.  */
! 	  gas_assert (b_op->op_num < MAX_INSN_ARGS);
  	  exp = &new_insn->tok[b_op->op_num];
  	  set_expr_const (exp, b_op->op_data);
  	  break;
  
  	case OP_OPERAND:
! 	  gas_assert (b_op->op_num < MAX_INSN_ARGS);
! 	  gas_assert (b_op->op_data < (unsigned) old_insn->ntok);
  	  src_exp = &old_insn->tok[b_op->op_data];
  	  exp = &new_insn->tok[b_op->op_num];
  	  copy_expr (exp, src_exp);
*************** xg_build_token_insn (BuildInstr *instr_s
*** 3879,3889 ****
  	case OP_LITERAL:
  	case OP_LABEL:
  	  as_bad (_("can't handle generation of literal/labels yet"));
! 	  assert (0);
  
  	default:
  	  as_bad (_("can't handle undefined OP TYPE"));
! 	  assert (0);
  	}
      }
  
--- 3879,3889 ----
  	case OP_LITERAL:
  	case OP_LABEL:
  	  as_bad (_("can't handle generation of literal/labels yet"));
! 	  gas_assert (0);
  
  	default:
  	  as_bad (_("can't handle undefined OP TYPE"));
! 	  gas_assert (0);
  	}
      }
  
*************** xg_simplify_insn (TInsn *old_insn, TInsn
*** 3909,3916 ****
  
    insn_spec = rule->to_instr;
    /* There should only be one.  */
!   assert (insn_spec != NULL);
!   assert (insn_spec->next == NULL);
    if (insn_spec->next != NULL)
      return FALSE;
  
--- 3909,3916 ----
  
    insn_spec = rule->to_instr;
    /* There should only be one.  */
!   gas_assert (insn_spec != NULL);
!   gas_assert (insn_spec->next == NULL);
    if (insn_spec->next != NULL)
      return FALSE;
  
*************** xg_assemble_literal (/* const */ TInsn *
*** 4089,4096 ****
  
    set_expr_symbol_offset (&saved_loc, frag_now->fr_symbol, frag_now_fix ());
  
!   assert (insn->insn_type == ITYPE_LITERAL);
!   assert (insn->ntok == 1);	/* must be only one token here */
  
    xtensa_switch_to_literal_fragment (&state);
  
--- 4089,4096 ----
  
    set_expr_symbol_offset (&saved_loc, frag_now->fr_symbol, frag_now_fix ());
  
!   gas_assert (insn->insn_type == ITYPE_LITERAL);
!   gas_assert (insn->ntok == 1);	/* must be only one token here */
  
    xtensa_switch_to_literal_fragment (&state);
  
*************** xg_assemble_literal (/* const */ TInsn *
*** 4140,4146 ****
        break;
      }
  
!   assert (frag_now->tc_frag_data.literal_frag == NULL);
    frag_now->tc_frag_data.literal_frag = get_literal_pool_location (now_seg);
    frag_now->fr_symbol = xtensa_create_literal_symbol (now_seg, frag_now);
    lit_sym = frag_now->fr_symbol;
--- 4140,4146 ----
        break;
      }
  
!   gas_assert (frag_now->tc_frag_data.literal_frag == NULL);
    frag_now->tc_frag_data.literal_frag = get_literal_pool_location (now_seg);
    frag_now->fr_symbol = xtensa_create_literal_symbol (now_seg, frag_now);
    lit_sym = frag_now->fr_symbol;
*************** xg_assemble_literal_space (/* const */ i
*** 4160,4166 ****
    offsetT litalign = 2;		/* 2^2 = 4 */
    fragS *lit_saved_frag;
  
!   assert (size % 4 == 0);
  
    xtensa_switch_to_literal_fragment (&state);
  
--- 4160,4166 ----
    offsetT litalign = 2;		/* 2^2 = 4 */
    fragS *lit_saved_frag;
  
!   gas_assert (size % 4 == 0);
  
    xtensa_switch_to_literal_fragment (&state);
  
*************** xg_resolve_literals (TInsn *insn, symbol
*** 4307,4313 ****
    int i;
    if (lit_sym == 0)
      return;
!   assert (insn->insn_type == ITYPE_INSN);
    for (i = 0; i < insn->ntok; i++)
      if (insn->tok[i].X_add_symbol == sym)
        insn->tok[i].X_add_symbol = lit_sym;
--- 4307,4313 ----
    int i;
    if (lit_sym == 0)
      return;
!   gas_assert (insn->insn_type == ITYPE_INSN);
    for (i = 0; i < insn->ntok; i++)
      if (insn->tok[i].X_add_symbol == sym)
        insn->tok[i].X_add_symbol = lit_sym;
*************** update_next_frag_state (fragS *fragP)
*** 4578,4584 ****
  		   || next_fragP->fr_subtype == RELAX_UNREACHABLE)))
  	next_fragP = next_fragP->fr_next;
  
!       assert (next_fragP->fr_type == rs_machine_dependent
  	      && (next_fragP->fr_subtype == RELAX_MAYBE_UNREACHABLE
  		  || next_fragP->fr_subtype == RELAX_UNREACHABLE));
  
--- 4578,4584 ----
  		   || next_fragP->fr_subtype == RELAX_UNREACHABLE)))
  	next_fragP = next_fragP->fr_next;
  
!       gas_assert (next_fragP->fr_type == rs_machine_dependent
  	      && (next_fragP->fr_subtype == RELAX_MAYBE_UNREACHABLE
  		  || next_fragP->fr_subtype == RELAX_UNREACHABLE));
  
*************** update_next_frag_state (fragS *fragP)
*** 4589,4595 ****
  		   || new_target->fr_subtype == RELAX_DESIRE_ALIGN)))
  	new_target = new_target->fr_next;
  
!       assert (new_target->fr_type == rs_machine_dependent
  	      && (new_target->fr_subtype == RELAX_MAYBE_DESIRE_ALIGN
  		  || new_target->fr_subtype == RELAX_DESIRE_ALIGN));
      }
--- 4589,4595 ----
  		   || new_target->fr_subtype == RELAX_DESIRE_ALIGN)))
  	new_target = new_target->fr_next;
  
!       gas_assert (new_target->fr_type == rs_machine_dependent
  	      && (new_target->fr_subtype == RELAX_MAYBE_DESIRE_ALIGN
  		  || new_target->fr_subtype == RELAX_DESIRE_ALIGN));
      }
*************** build_nop (TInsn *tinsn, int size)
*** 4739,4745 ****
        else
  	tinsn->opcode = xtensa_nop_opcode;
  
!       assert (tinsn->opcode != XTENSA_UNDEFINED);
      }
  }
  
--- 4739,4745 ----
        else
  	tinsn->opcode = xtensa_nop_opcode;
  
!       gas_assert (tinsn->opcode != XTENSA_UNDEFINED);
      }
  }
  
*************** get_expanded_loop_offset (xtensa_opcode 
*** 4777,4783 ****
    /* This is the OFFSET of the loop instruction in the expanded loop.
       This MUST correspond directly to the specification of the loop
       expansion.  It will be validated on fragment conversion.  */
!   assert (opcode != XTENSA_UNDEFINED);
    if (opcode == xtensa_loop_opcode)
      return 0;
    if (opcode == xtensa_loopnez_opcode)
--- 4777,4783 ----
    /* This is the OFFSET of the loop instruction in the expanded loop.
       This MUST correspond directly to the specification of the loop
       expansion.  It will be validated on fragment conversion.  */
!   gas_assert (opcode != XTENSA_UNDEFINED);
    if (opcode == xtensa_loop_opcode)
      return 0;
    if (opcode == xtensa_loopnez_opcode)
*************** md_apply_fix (fixS *fixP, valueT *valP, 
*** 5892,5898 ****
  	     by the linker, and it makes the object file disassembly
  	     readable when all branch targets are encoded in relocations.  */
  
! 	  assert (fixP->fx_addsy);
  	  if (S_GET_SEGMENT (fixP->fx_addsy) == seg
  	      && !S_FORCE_RELOC (fixP->fx_addsy, 1))
  	    {
--- 5892,5898 ----
  	     by the linker, and it makes the object file disassembly
  	     readable when all branch targets are encoded in relocations.  */
  
! 	  gas_assert (fixP->fx_addsy);
  	  if (S_GET_SEGMENT (fixP->fx_addsy) == seg
  	      && !S_FORCE_RELOC (fixP->fx_addsy, 1))
  	    {
*************** tc_gen_reloc (asection *section ATTRIBUT
*** 5972,5978 ****
  
    /* Make sure none of our internal relocations make it this far.
       They'd better have been fully resolved by this point.  */
!   assert ((int) fixp->fx_r_type > 0);
  
    reloc->addend = fixp->fx_offset;
  
--- 5972,5978 ----
  
    /* Make sure none of our internal relocations make it this far.
       They'd better have been fully resolved by this point.  */
!   gas_assert ((int) fixp->fx_r_type > 0);
  
    reloc->addend = fixp->fx_offset;
  
*************** release_resources (resource_table *rt, x
*** 6111,6117 ****
      {
        xtensa_funcUnit unit = (rt->opcode_unit_use) (rt->data, opcode, i);
        int stage = (rt->opcode_unit_stage) (rt->data, opcode, i);
!       assert (rt->units[stage + cycle][unit] > 0);
        rt->units[stage + cycle][unit]--;
      }
  }
--- 6111,6117 ----
      {
        xtensa_funcUnit unit = (rt->opcode_unit_use) (rt->data, opcode, i);
        int stage = (rt->opcode_unit_stage) (rt->data, opcode, i);
!       gas_assert (rt->units[stage + cycle][unit] > 0);
        rt->units[stage + cycle][unit]--;
      }
  }
*************** finish_vinsn (vliw_insn *vinsn)
*** 6293,6304 ****
  	      TInsn *insn = &slotstack.insn[j];
  	      if (insn->insn_type == ITYPE_LITERAL)
  		{
! 		  assert (lit_sym == NULL);
  		  lit_sym = xg_assemble_literal (insn);
  		}
  	      else
  		{
! 		  assert (insn->insn_type == ITYPE_INSN);
  		  if (lit_sym)
  		    xg_resolve_literals (insn, lit_sym);
  		  if (j != slotstack.ninsn - 1)
--- 6293,6304 ----
  	      TInsn *insn = &slotstack.insn[j];
  	      if (insn->insn_type == ITYPE_LITERAL)
  		{
! 		  gas_assert (lit_sym == NULL);
  		  lit_sym = xg_assemble_literal (insn);
  		}
  	      else
  		{
! 		  gas_assert (insn->insn_type == ITYPE_INSN);
  		  if (lit_sym)
  		    xg_resolve_literals (insn, lit_sym);
  		  if (j != slotstack.ninsn - 1)
*************** find_vinsn_conflicts (vliw_insn *vinsn)
*** 6399,6405 ****
    int branches = 0;
    xtensa_isa isa = xtensa_default_isa;
  
!   assert (!past_xtensa_end);
  
    for (i = 0 ; i < vinsn->num_slots; i++)
      {
--- 6399,6405 ----
    int branches = 0;
    xtensa_isa isa = xtensa_default_isa;
  
!   gas_assert (!past_xtensa_end);
  
    for (i = 0 ; i < vinsn->num_slots; i++)
      {
*************** bundle_tinsn (TInsn *tinsn, vliw_insn *v
*** 6781,6787 ****
    int slot, chosen_slot;
  
    vinsn->format = xg_get_single_format (tinsn->opcode);
!   assert (vinsn->format != XTENSA_UNDEFINED);
    vinsn->num_slots = xtensa_format_num_slots (isa, vinsn->format);
  
    chosen_slot = xg_get_single_slot (tinsn->opcode);
--- 6781,6787 ----
    int slot, chosen_slot;
  
    vinsn->format = xg_get_single_format (tinsn->opcode);
!   gas_assert (vinsn->format != XTENSA_UNDEFINED);
    vinsn->num_slots = xtensa_format_num_slots (isa, vinsn->format);
  
    chosen_slot = xg_get_single_slot (tinsn->opcode);
*************** emit_single_op (TInsn *orig_insn)
*** 6835,6841 ****
        switch (insn->insn_type)
  	{
  	case ITYPE_LITERAL:
! 	  assert (lit_sym == NULL);
  	  lit_sym = xg_assemble_literal (insn);
  	  break;
  	case ITYPE_LABEL:
--- 6835,6841 ----
        switch (insn->insn_type)
  	{
  	case ITYPE_LITERAL:
! 	  gas_assert (lit_sym == NULL);
  	  lit_sym = xg_assemble_literal (insn);
  	  break;
  	case ITYPE_LABEL:
*************** emit_single_op (TInsn *orig_insn)
*** 6844,6852 ****
  	    char *label = xmalloc (strlen (FAKE_LABEL_NAME) + 12);
  	    sprintf (label, "%s_rl_%x", FAKE_LABEL_NAME, relaxed_sym_idx++);
  	    colon (label);
! 	    assert (label_sym == NULL);
  	    label_sym = symbol_find_or_make (label);
! 	    assert (label_sym);
  	    free (label);
  	  }
  	  break;
--- 6844,6852 ----
  	    char *label = xmalloc (strlen (FAKE_LABEL_NAME) + 12);
  	    sprintf (label, "%s_rl_%x", FAKE_LABEL_NAME, relaxed_sym_idx++);
  	    colon (label);
! 	    gas_assert (label_sym == NULL);
  	    label_sym = symbol_find_or_make (label);
! 	    gas_assert (label_sym);
  	    free (label);
  	  }
  	  break;
*************** emit_single_op (TInsn *orig_insn)
*** 6864,6870 ****
  	  }
  	  break;
  	default:
! 	  assert (0);
  	  break;
  	}
      }
--- 6864,6870 ----
  	  }
  	  break;
  	default:
! 	  gas_assert (0);
  	  break;
  	}
      }
*************** xg_assemble_vliw_tokens (vliw_insn *vins
*** 7059,7065 ****
        frag_now->tc_frag_data.free_reg[slot] = tinsn->extra_arg;
  
        if (tinsn->subtype == RELAX_NARROW)
! 	assert (vinsn->num_slots == 1);
        if (xtensa_opcode_is_jump (isa, tinsn->opcode) == 1)
  	is_jump = TRUE;
        if (xtensa_opcode_is_branch (isa, tinsn->opcode) == 1)
--- 7059,7065 ----
        frag_now->tc_frag_data.free_reg[slot] = tinsn->extra_arg;
  
        if (tinsn->subtype == RELAX_NARROW)
! 	gas_assert (vinsn->num_slots == 1);
        if (xtensa_opcode_is_jump (isa, tinsn->opcode) == 1)
  	is_jump = TRUE;
        if (xtensa_opcode_is_branch (isa, tinsn->opcode) == 1)
*************** xg_assemble_vliw_tokens (vliw_insn *vins
*** 7119,7125 ****
      {
        if (is_jump)
  	{
! 	  assert (finish_frag);
  	  frag_var (rs_machine_dependent,
  		    UNREACHABLE_MAX_WIDTH, UNREACHABLE_MAX_WIDTH,
  		    RELAX_UNREACHABLE,
--- 7119,7125 ----
      {
        if (is_jump)
  	{
! 	  gas_assert (finish_frag);
  	  frag_var (rs_machine_dependent,
  		    UNREACHABLE_MAX_WIDTH, UNREACHABLE_MAX_WIDTH,
  		    RELAX_UNREACHABLE,
*************** xg_assemble_vliw_tokens (vliw_insn *vins
*** 7128,7134 ****
  	}
        else if (is_branch && do_align_targets ())
  	{
! 	  assert (finish_frag);
  	  frag_var (rs_machine_dependent,
  		    UNREACHABLE_MAX_WIDTH, UNREACHABLE_MAX_WIDTH,
  		    RELAX_MAYBE_UNREACHABLE,
--- 7128,7134 ----
  	}
        else if (is_branch && do_align_targets ())
  	{
! 	  gas_assert (finish_frag);
  	  frag_var (rs_machine_dependent,
  		    UNREACHABLE_MAX_WIDTH, UNREACHABLE_MAX_WIDTH,
  		    RELAX_MAYBE_UNREACHABLE,
*************** xtensa_fix_close_loop_end_frags (void)
*** 7729,7735 ****
  		  }
  		frag_wane (fragP);
  	      }
! 	    assert (fragP->fr_type != rs_machine_dependent
  		    || fragP->fr_subtype != RELAX_ADD_NOP_IF_CLOSE_LOOP_END);
  	  }
        }
--- 7729,7735 ----
  		  }
  		frag_wane (fragP);
  	      }
! 	    gas_assert (fragP->fr_type != rs_machine_dependent
  		    || fragP->fr_subtype != RELAX_ADD_NOP_IF_CLOSE_LOOP_END);
  	  }
        }
*************** unrelaxed_frag_max_size (fragS *fragP)
*** 7805,7811 ****
        break;
      default:
        /* We had darn well better know how big it is.  */
!       assert (0);
        break;
      }
  
--- 7805,7811 ----
        break;
      default:
        /* We had darn well better know how big it is.  */
!       gas_assert (0);
        break;
      }
  
*************** xtensa_fix_short_loop_frags (void)
*** 7859,7865 ****
  		tinsn_from_chars (&t_insn, loop_frag->fr_opcode, 0);
  		current_target = symbol_get_frag (fragP->fr_symbol);
  		current_opcode = t_insn.opcode;
! 		assert (xtensa_opcode_is_loop (xtensa_default_isa,
  					       current_opcode) == 1);
  	      }
  
--- 7859,7865 ----
  		tinsn_from_chars (&t_insn, loop_frag->fr_opcode, 0);
  		current_target = symbol_get_frag (fragP->fr_symbol);
  		current_opcode = t_insn.opcode;
! 		gas_assert (xtensa_opcode_is_loop (xtensa_default_isa,
  					       current_opcode) == 1);
  	      }
  
*************** get_text_align_power (unsigned target_si
*** 8222,8228 ****
  {
    if (target_size <= 4)
      return 2;
!   assert (target_size == 8);
    return 3;
  }
  
--- 8222,8228 ----
  {
    if (target_size <= 4)
      return 2;
!   gas_assert (target_size == 8);
    return 3;
  }
  
*************** get_text_align_fill_size (addressT addre
*** 8258,8264 ****
    bfd_boolean skip_one = FALSE;
  
    alignment = (1 << align_pow);
!   assert (target_size > 0 && alignment >= (addressT) target_size);
  
    if (!use_nops)
      {
--- 8258,8264 ----
    bfd_boolean skip_one = FALSE;
  
    alignment = (1 << align_pow);
!   gas_assert (target_size > 0 && alignment >= (addressT) target_size);
  
    if (!use_nops)
      {
*************** get_text_align_fill_size (addressT addre
*** 8288,8294 ****
  	  == (address + fill + target_size - 1) >> align_pow)
  	return fill;
      }
!   assert (0);
    return 0;
  }
  
--- 8288,8294 ----
  	  == (address + fill + target_size - 1) >> align_pow)
  	return fill;
      }
!   gas_assert (0);
    return 0;
  }
  
*************** branch_align_power (segT sec)
*** 8308,8314 ****
  	return 3;
      }
    else
!     assert (xtensa_fetch_width == 4);
  
    return 2;
  }
--- 8308,8314 ----
  	return 3;
      }
    else
!     gas_assert (xtensa_fetch_width == 4);
  
    return 2;
  }
*************** get_text_align_nop_count (offsetT fill_s
*** 8323,8333 ****
  
    if (use_no_density)
      {
!       assert (fill_size % 3 == 0);
        return (fill_size / 3);
      }
  
!   assert (fill_size != 1);	/* Bad argument.  */
  
    while (fill_size > 1)
      {
--- 8323,8333 ----
  
    if (use_no_density)
      {
!       gas_assert (fill_size % 3 == 0);
        return (fill_size / 3);
      }
  
!   gas_assert (fill_size != 1);	/* Bad argument.  */
  
    while (fill_size > 1)
      {
*************** get_text_align_nop_count (offsetT fill_s
*** 8337,8343 ****
        fill_size -= insn_size;
        count++;
      }
!   assert (fill_size != 1);	/* Bad algorithm.  */
    return count;
  }
  
--- 8337,8343 ----
        fill_size -= insn_size;
        count++;
      }
!   gas_assert (fill_size != 1);	/* Bad algorithm.  */
    return count;
  }
  
*************** get_text_align_nth_nop_size (offsetT fil
*** 8352,8358 ****
    if (use_no_density)
      return 3;
  
!   assert (fill_size != 1);	/* Bad argument.  */
  
    while (fill_size > 1)
      {
--- 8352,8358 ----
    if (use_no_density)
      return 3;
  
!   gas_assert (fill_size != 1);	/* Bad argument.  */
  
    while (fill_size > 1)
      {
*************** get_text_align_nth_nop_size (offsetT fil
*** 8364,8370 ****
        if (n + 1 == count)
  	return insn_size;
      }
!   assert (0);
    return 0;
  }
  
--- 8364,8370 ----
        if (n + 1 == count)
  	return insn_size;
      }
!   gas_assert (0);
    return 0;
  }
  
*************** get_noop_aligned_address (fragS *fragP, 
*** 8398,8405 ****
    xtensa_opcode opcode;
    bfd_boolean is_loop;
  
!   assert (fragP->fr_type == rs_machine_dependent);
!   assert (fragP->fr_subtype == RELAX_ALIGN_NEXT_OPCODE);
  
    /* Find the loop frag.  */
    first_insn = next_non_empty_frag (fragP);
--- 8398,8405 ----
    xtensa_opcode opcode;
    bfd_boolean is_loop;
  
!   gas_assert (fragP->fr_type == rs_machine_dependent);
!   gas_assert (fragP->fr_subtype == RELAX_ALIGN_NEXT_OPCODE);
  
    /* Find the loop frag.  */
    first_insn = next_non_empty_frag (fragP);
*************** get_noop_aligned_address (fragS *fragP, 
*** 8407,8413 ****
    first_insn = next_non_empty_frag (first_insn);
  
    is_loop = next_frag_opcode_is_loop (fragP, &opcode);
!   assert (is_loop);
    loop_insn_size = xg_get_single_size (opcode);
  
    pre_opcode_bytes = next_frag_pre_opcode_bytes (fragP);
--- 8407,8413 ----
    first_insn = next_non_empty_frag (first_insn);
  
    is_loop = next_frag_opcode_is_loop (fragP, &opcode);
!   gas_assert (is_loop);
    loop_insn_size = xg_get_single_size (opcode);
  
    pre_opcode_bytes = next_frag_pre_opcode_bytes (fragP);
*************** get_aligned_diff (fragS *fragP, addressT
*** 8462,8468 ****
    offsetT branch_align;
    fragS *loop_frag;
  
!   assert (fragP->fr_type == rs_machine_dependent);
    switch (fragP->fr_subtype)
      {
      case RELAX_DESIRE_ALIGN:
--- 8462,8468 ----
    offsetT branch_align;
    fragS *loop_frag;
  
!   gas_assert (fragP->fr_type == rs_machine_dependent);
    switch (fragP->fr_subtype)
      {
      case RELAX_DESIRE_ALIGN:
*************** get_aligned_diff (fragS *fragP, addressT
*** 8479,8485 ****
  
        *max_diff = (opt_diff + branch_align
  		   - (target_size + ((address + opt_diff) % branch_align)));
!       assert (*max_diff >= opt_diff);
        return opt_diff;
  
      case RELAX_ALIGN_NEXT_OPCODE:
--- 8479,8485 ----
  
        *max_diff = (opt_diff + branch_align
  		   - (target_size + ((address + opt_diff) % branch_align)));
!       gas_assert (*max_diff >= opt_diff);
        return opt_diff;
  
      case RELAX_ALIGN_NEXT_OPCODE:
*************** get_aligned_diff (fragS *fragP, addressT
*** 8491,8497 ****
        target_size = get_loop_align_size (next_frag_format_size (loop_frag));
        loop_insn_offset = 0;
        is_loop = next_frag_opcode_is_loop (fragP, &loop_opcode);
!       assert (is_loop);
  
        /* If the loop has been expanded then the LOOP instruction
  	 could be at an offset from this fragment.  */
--- 8491,8497 ----
        target_size = get_loop_align_size (next_frag_format_size (loop_frag));
        loop_insn_offset = 0;
        is_loop = next_frag_opcode_is_loop (fragP, &loop_opcode);
!       gas_assert (is_loop);
  
        /* If the loop has been expanded then the LOOP instruction
  	 could be at an offset from this fragment.  */
*************** get_aligned_diff (fragS *fragP, addressT
*** 8511,8523 ****
        *max_diff = xtensa_fetch_width
  	- ((target_address + opt_diff) % xtensa_fetch_width)
  	- target_size + opt_diff;
!       assert (*max_diff >= opt_diff);
        return opt_diff;
  
      default:
        break;
      }
!   assert (0);
    return 0;
  }
  
--- 8511,8523 ----
        *max_diff = xtensa_fetch_width
  	- ((target_address + opt_diff) % xtensa_fetch_width)
  	- target_size + opt_diff;
!       gas_assert (*max_diff >= opt_diff);
        return opt_diff;
  
      default:
        break;
      }
!   gas_assert (0);
    return 0;
  }
  
*************** xtensa_relax_frag (fragS *fragP, long st
*** 8581,8587 ****
      case RELAX_LITERAL_NR:
        lit_size = 4;
        fragP->fr_subtype = RELAX_LITERAL_FINAL;
!       assert (unreported == lit_size);
        memset (&fragP->fr_literal[fragP->fr_fix], 0, 4);
        fragP->fr_var -= lit_size;
        fragP->fr_fix += lit_size;
--- 8581,8587 ----
      case RELAX_LITERAL_NR:
        lit_size = 4;
        fragP->fr_subtype = RELAX_LITERAL_FINAL;
!       gas_assert (unreported == lit_size);
        memset (&fragP->fr_literal[fragP->fr_fix], 0, 4);
        fragP->fr_var -= lit_size;
        fragP->fr_fix += lit_size;
*************** relax_frag_for_align (fragS *fragP, long
*** 8719,8725 ****
    long stretch_me;
    long diff;
  
!   assert (fragP->fr_subtype == RELAX_FILL_NOP
  	  || fragP->fr_subtype == RELAX_UNREACHABLE
  	  || (fragP->fr_subtype == RELAX_SLOTS
  	      && fragP->tc_frag_data.slot_subtypes[0] == RELAX_NARROW));
--- 8719,8725 ----
    long stretch_me;
    long diff;
  
!   gas_assert (fragP->fr_subtype == RELAX_FILL_NOP
  	  || fragP->fr_subtype == RELAX_UNREACHABLE
  	  || (fragP->fr_subtype == RELAX_SLOTS
  	      && fragP->tc_frag_data.slot_subtypes[0] == RELAX_NARROW));
*************** future_alignment_required (fragS *fragP,
*** 8875,8882 ****
      {
        local_opt_diff = get_aligned_diff (fragP, address, &max_diff);
        opt_diff = local_opt_diff;
!       assert (opt_diff >= 0);
!       assert (max_diff >= opt_diff);
        if (max_diff == 0)
  	return 0;
  
--- 8875,8882 ----
      {
        local_opt_diff = get_aligned_diff (fragP, address, &max_diff);
        opt_diff = local_opt_diff;
!       gas_assert (opt_diff >= 0);
!       gas_assert (max_diff >= opt_diff);
        if (max_diff == 0)
  	return 0;
  
*************** future_alignment_required (fragS *fragP,
*** 8934,8940 ****
  	{
  	  if (this_frag->fr_subtype == RELAX_UNREACHABLE)
  	    {
! 	      assert (opt_diff <= UNREACHABLE_MAX_WIDTH);
  	      return opt_diff;
  	    }
  	  return 0;
--- 8934,8940 ----
  	{
  	  if (this_frag->fr_subtype == RELAX_UNREACHABLE)
  	    {
! 	      gas_assert (opt_diff <= UNREACHABLE_MAX_WIDTH);
  	      return opt_diff;
  	    }
  	  return 0;
*************** future_alignment_required (fragS *fragP,
*** 8956,8968 ****
  
        if (this_frag->fr_subtype == RELAX_SLOTS
  	  && this_frag->tc_frag_data.slot_subtypes[0] == RELAX_NARROW)
! 	assert (stretch_amount <= 1);
        else if (this_frag->fr_subtype == RELAX_FILL_NOP)
  	{
  	  if (this_frag->tc_frag_data.is_no_density)
! 	    assert (stretch_amount == 3 || stretch_amount == 0);
  	  else
! 	    assert (stretch_amount <= 3);
  	}
      }
    return stretch_amount;
--- 8956,8968 ----
  
        if (this_frag->fr_subtype == RELAX_SLOTS
  	  && this_frag->tc_frag_data.slot_subtypes[0] == RELAX_NARROW)
! 	gas_assert (stretch_amount <= 1);
        else if (this_frag->fr_subtype == RELAX_FILL_NOP)
  	{
  	  if (this_frag->tc_frag_data.is_no_density)
! 	    gas_assert (stretch_amount == 3 || stretch_amount == 0);
  	  else
! 	    gas_assert (stretch_amount <= 3);
  	}
      }
    return stretch_amount;
*************** bytes_to_stretch (fragS *this_frag,
*** 9016,9026 ****
  {
    int bytes_short = desired_diff - num_widens;
  
!   assert (desired_diff >= 0 && desired_diff < 8);
    if (desired_diff == 0)
      return 0;
  
!   assert (wide_nops > 0 || num_widens > 0);
  
    /* Always prefer widening to NOP-filling.  */
    if (bytes_short < 0)
--- 9016,9026 ----
  {
    int bytes_short = desired_diff - num_widens;
  
!   gas_assert (desired_diff >= 0 && desired_diff < 8);
    if (desired_diff == 0)
      return 0;
  
!   gas_assert (wide_nops > 0 || num_widens > 0);
  
    /* Always prefer widening to NOP-filling.  */
    if (bytes_short < 0)
*************** bytes_to_stretch (fragS *this_frag,
*** 9094,9100 ****
  	    return 3; /* case 7b */
  	  return 0;
  	default:
! 	  assert (0);
  	}
      }
    else
--- 9094,9100 ----
  	    return 3; /* case 7b */
  	  return 0;
  	default:
! 	  gas_assert (0);
  	}
      }
    else
*************** bytes_to_stretch (fragS *this_frag,
*** 9106,9112 ****
        switch (desired_diff)
  	{
  	case 1:
! 	  assert (0);
  	  return 0;
  	case 2:
  	case 3:
--- 9106,9112 ----
        switch (desired_diff)
  	{
  	case 1:
! 	  gas_assert (0);
  	  return 0;
  	case 2:
  	case 3:
*************** bytes_to_stretch (fragS *this_frag,
*** 9132,9142 ****
  	    return 1; /* case 7b */
  	  return 0;
  	default:
! 	  assert (0);
  	  return 0;
  	}
      }
!   assert (0);
    return 0;
  }
  
--- 9132,9142 ----
  	    return 1; /* case 7b */
  	  return 0;
  	default:
! 	  gas_assert (0);
  	  return 0;
  	}
      }
!   gas_assert (0);
    return 0;
  }
  
*************** relax_frag_immed (segT segP,
*** 9163,9169 ****
    int num_text_bytes, num_literal_bytes;
    int literal_diff, total_text_diff, this_text_diff;
  
!   assert (fragP->fr_opcode != NULL);
  
    xg_clear_vinsn (&cur_vinsn);
    vinsn_from_chars (&cur_vinsn, fragP->fr_opcode);
--- 9163,9169 ----
    int num_text_bytes, num_literal_bytes;
    int literal_diff, total_text_diff, this_text_diff;
  
!   gas_assert (fragP->fr_opcode != NULL);
  
    xg_clear_vinsn (&cur_vinsn);
    vinsn_from_chars (&cur_vinsn, fragP->fr_opcode);
*************** relax_frag_immed (segT segP,
*** 9200,9206 ****
    istack_init (&istack);
    num_steps = xg_assembly_relax (&istack, &tinsn, segP, fragP, frag_offset,
  				 min_steps, stretch);
!   assert (num_steps >= min_steps && num_steps <= RELAX_IMMED_MAXSTEPS);
  
    fragP->tc_frag_data.slot_subtypes[slot] = (int) RELAX_IMMED + num_steps;
  
--- 9200,9206 ----
    istack_init (&istack);
    num_steps = xg_assembly_relax (&istack, &tinsn, segP, fragP, frag_offset,
  				 min_steps, stretch);
!   gas_assert (num_steps >= min_steps && num_steps <= RELAX_IMMED_MAXSTEPS);
  
    fragP->tc_frag_data.slot_subtypes[slot] = (int) RELAX_IMMED + num_steps;
  
*************** relax_frag_immed (segT segP,
*** 9229,9235 ****
  	  num_steps = xg_assembly_relax (&istack, &tinsn, segP, fragP, 
  					 frag_offset + old_size,
  					 min_steps, stretch + old_size);
! 	  assert (num_steps >= min_steps && num_steps <= RELAX_IMMED_MAXSTEPS);
  
  	  fragP->tc_frag_data.slot_subtypes[slot] 
  	    = (int) RELAX_IMMED + num_steps;
--- 9229,9235 ----
  	  num_steps = xg_assembly_relax (&istack, &tinsn, segP, fragP, 
  					 frag_offset + old_size,
  					 min_steps, stretch + old_size);
! 	  gas_assert (num_steps >= min_steps && num_steps <= RELAX_IMMED_MAXSTEPS);
  
  	  fragP->tc_frag_data.slot_subtypes[slot] 
  	    = (int) RELAX_IMMED + num_steps;
*************** relax_frag_immed (segT segP,
*** 9246,9259 ****
    this_text_diff = total_text_diff - fragP->tc_frag_data.text_expansion[slot];
  
    /* It MUST get larger.  If not, we could get an infinite loop.  */
!   assert (num_text_bytes >= 0);
!   assert (literal_diff >= 0);
!   assert (total_text_diff >= 0);
  
    fragP->tc_frag_data.text_expansion[slot] = total_text_diff;
    fragP->tc_frag_data.literal_expansion[slot] = num_literal_bytes;
!   assert (fragP->tc_frag_data.text_expansion[slot] >= 0);
!   assert (fragP->tc_frag_data.literal_expansion[slot] >= 0);
  
    /* Find the associated expandable literal for this.  */
    if (literal_diff != 0)
--- 9246,9259 ----
    this_text_diff = total_text_diff - fragP->tc_frag_data.text_expansion[slot];
  
    /* It MUST get larger.  If not, we could get an infinite loop.  */
!   gas_assert (num_text_bytes >= 0);
!   gas_assert (literal_diff >= 0);
!   gas_assert (total_text_diff >= 0);
  
    fragP->tc_frag_data.text_expansion[slot] = total_text_diff;
    fragP->tc_frag_data.literal_expansion[slot] = num_literal_bytes;
!   gas_assert (fragP->tc_frag_data.text_expansion[slot] >= 0);
!   gas_assert (fragP->tc_frag_data.literal_expansion[slot] >= 0);
  
    /* Find the associated expandable literal for this.  */
    if (literal_diff != 0)
*************** relax_frag_immed (segT segP,
*** 9261,9272 ****
        fragS *lit_fragP = fragP->tc_frag_data.literal_frags[slot];
        if (lit_fragP)
  	{
! 	  assert (literal_diff == 4);
  	  lit_fragP->tc_frag_data.unreported_expansion += literal_diff;
  
  	  /* We expect that the literal section state has NOT been
  	     modified yet.  */
! 	  assert (lit_fragP->fr_type == rs_machine_dependent
  		  && lit_fragP->fr_subtype == RELAX_LITERAL);
  	  lit_fragP->fr_subtype = RELAX_LITERAL_NR;
  
--- 9261,9272 ----
        fragS *lit_fragP = fragP->tc_frag_data.literal_frags[slot];
        if (lit_fragP)
  	{
! 	  gas_assert (literal_diff == 4);
  	  lit_fragP->tc_frag_data.unreported_expansion += literal_diff;
  
  	  /* We expect that the literal section state has NOT been
  	     modified yet.  */
! 	  gas_assert (lit_fragP->fr_type == rs_machine_dependent
  		  && lit_fragP->fr_subtype == RELAX_LITERAL);
  	  lit_fragP->fr_subtype = RELAX_LITERAL_NR;
  
*************** md_convert_frag (bfd *abfd ATTRIBUTE_UNU
*** 9389,9395 ****
  
  	  fragS *f;
  	  fragp->fr_subtype = RELAX_LITERAL_FINAL;
! 	  assert (fragp->tc_frag_data.unreported_expansion == 4);
  	  memset (&fragp->fr_literal[fragp->fr_fix], 0, 4);
  	  fragp->fr_var -= 4;
  	  fragp->fr_fix += 4;
--- 9389,9395 ----
  
  	  fragS *f;
  	  fragp->fr_subtype = RELAX_LITERAL_FINAL;
! 	  gas_assert (fragp->tc_frag_data.unreported_expansion == 4);
  	  memset (&fragp->fr_literal[fragp->fr_fix], 0, 4);
  	  fragp->fr_var -= 4;
  	  fragp->fr_fix += 4;
*************** convert_frag_narrow (segT segP, fragS *f
*** 9442,9453 ****
    int size, old_size, diff;
    offsetT frag_offset;
  
!   assert (slot == 0);
    tinsn_from_chars (&tinsn, fragP->fr_opcode, 0);
  
    if (fragP->tc_frag_data.is_aligning_branch == 1)
      {
!       assert (fragP->tc_frag_data.text_expansion[0] == 1
  	      || fragP->tc_frag_data.text_expansion[0] == 0);
        convert_frag_immed (segP, fragP, fragP->tc_frag_data.text_expansion[0],
  			  fmt, slot);
--- 9442,9453 ----
    int size, old_size, diff;
    offsetT frag_offset;
  
!   gas_assert (slot == 0);
    tinsn_from_chars (&tinsn, fragP->fr_opcode, 0);
  
    if (fragP->tc_frag_data.is_aligning_branch == 1)
      {
!       gas_assert (fragP->tc_frag_data.text_expansion[0] == 1
  	      || fragP->tc_frag_data.text_expansion[0] == 0);
        convert_frag_immed (segP, fragP, fragP->tc_frag_data.text_expansion[0],
  			  fmt, slot);
*************** convert_frag_narrow (segT segP, fragS *f
*** 9461,9467 ****
        return;
      }
  
!   assert (fragP->fr_opcode != NULL);
  
    /* Frags in this relaxation state should only contain
       single instruction bundles.  */
--- 9461,9467 ----
        return;
      }
  
!   gas_assert (fragP->fr_opcode != NULL);
  
    /* Frags in this relaxation state should only contain
       single instruction bundles.  */
*************** convert_frag_narrow (segT segP, fragS *f
*** 9485,9492 ****
  		       frag_offset, TRUE);
  
    diff = size - old_size;
!   assert (diff >= 0);
!   assert (diff <= fragP->fr_var);
    fragP->fr_var -= diff;
    fragP->fr_fix += diff;
  
--- 9485,9492 ----
  		       frag_offset, TRUE);
  
    diff = size - old_size;
!   gas_assert (diff >= 0);
!   gas_assert (diff <= fragP->fr_var);
    fragP->fr_var -= diff;
    fragP->fr_fix += diff;
  
*************** convert_frag_fill_nop (fragS *fragP)
*** 9500,9506 ****
  {
    char *loc = &fragP->fr_literal[fragP->fr_fix];
    int size = fragP->tc_frag_data.text_expansion[0];
!   assert ((unsigned) size == (fragP->fr_next->fr_address
  			      - fragP->fr_address - fragP->fr_fix));
    if (size == 0)
      {
--- 9500,9506 ----
  {
    char *loc = &fragP->fr_literal[fragP->fr_fix];
    int size = fragP->tc_frag_data.text_expansion[0];
!   gas_assert ((unsigned) size == (fragP->fr_next->fr_address
  			      - fragP->fr_address - fragP->fr_fix));
    if (size == 0)
      {
*************** convert_frag_immed (segT segP,
*** 9538,9544 ****
    int bytes;
    bfd_boolean is_loop;
  
!   assert (fr_opcode != NULL);
  
    xg_clear_vinsn (&cur_vinsn);
  
--- 9538,9544 ----
    int bytes;
    bfd_boolean is_loop;
  
!   gas_assert (fr_opcode != NULL);
  
    xg_clear_vinsn (&cur_vinsn);
  
*************** convert_frag_immed (segT segP,
*** 9567,9573 ****
        else
  	{
  	  bytes += fragP->tc_frag_data.text_expansion[0];
! 	  assert (bytes == 2 || bytes == 3);
  	  build_nop (&cur_vinsn.slots[0], bytes);
  	  fragP->fr_fix += fragP->tc_frag_data.text_expansion[0];
  	}
--- 9567,9573 ----
        else
  	{
  	  bytes += fragP->tc_frag_data.text_expansion[0];
! 	  gas_assert (bytes == 2 || bytes == 3);
  	  build_nop (&cur_vinsn.slots[0], bytes);
  	  fragP->fr_fix += fragP->tc_frag_data.text_expansion[0];
  	}
*************** convert_frag_immed (segT segP,
*** 9639,9651 ****
  		      unreach = unreach->fr_next;
  		    }
  
! 		  assert (unreach->fr_type == rs_machine_dependent
  			  && (unreach->fr_subtype == RELAX_MAYBE_UNREACHABLE
  			      || unreach->fr_subtype == RELAX_UNREACHABLE));
  
  		  target_offset += unreach->tc_frag_data.text_expansion[0];
  		}
! 	      assert (gen_label == NULL);
  	      gen_label = symbol_new (FAKE_LABEL_NAME, now_seg,
  				      fr_opcode - fragP->fr_literal
  				      + target_offset, fragP);
--- 9639,9651 ----
  		      unreach = unreach->fr_next;
  		    }
  
! 		  gas_assert (unreach->fr_type == rs_machine_dependent
  			  && (unreach->fr_subtype == RELAX_MAYBE_UNREACHABLE
  			      || unreach->fr_subtype == RELAX_UNREACHABLE));
  
  		  target_offset += unreach->tc_frag_data.text_expansion[0];
  		}
! 	      gas_assert (gen_label == NULL);
  	      gen_label = symbol_new (FAKE_LABEL_NAME, now_seg,
  				      fr_opcode - fragP->fr_literal
  				      + target_offset, fragP);
*************** convert_frag_immed (segT segP,
*** 9681,9692 ****
  	    case ITYPE_LITERAL:
  	      lit_frag = fragP->tc_frag_data.literal_frags[slot];
  	      /* Already checked.  */
! 	      assert (lit_frag != NULL);
! 	      assert (lit_sym != NULL);
! 	      assert (tinsn->ntok == 1);
  	      /* Add a fixup.  */
  	      target_seg = S_GET_SEGMENT (lit_sym);
! 	      assert (target_seg);
  	      reloc_type = map_operator_to_reloc (tinsn->tok[0].X_op, TRUE);
  	      fix_new_exp_in_seg (target_seg, 0, lit_frag, 0, 4,
  				  &tinsn->tok[0], FALSE, reloc_type);
--- 9681,9692 ----
  	    case ITYPE_LITERAL:
  	      lit_frag = fragP->tc_frag_data.literal_frags[slot];
  	      /* Already checked.  */
! 	      gas_assert (lit_frag != NULL);
! 	      gas_assert (lit_sym != NULL);
! 	      gas_assert (tinsn->ntok == 1);
  	      /* Add a fixup.  */
  	      target_seg = S_GET_SEGMENT (lit_sym);
! 	      gas_assert (target_seg);
  	      reloc_type = map_operator_to_reloc (tinsn->tok[0].X_op, TRUE);
  	      fix_new_exp_in_seg (target_seg, 0, lit_frag, 0, 4,
  				  &tinsn->tok[0], FALSE, reloc_type);
*************** convert_frag_immed (segT segP,
*** 9737,9746 ****
  	}
  
        diff = total_size - old_size;
!       assert (diff >= 0);
        if (diff != 0)
  	expanded = TRUE;
!       assert (diff <= fragP->fr_var);
        fragP->fr_var -= diff;
        fragP->fr_fix += diff;
      }
--- 9737,9746 ----
  	}
  
        diff = total_size - old_size;
!       gas_assert (diff >= 0);
        if (diff != 0)
  	expanded = TRUE;
!       gas_assert (diff <= fragP->fr_var);
        fragP->fr_var -= diff;
        fragP->fr_fix += diff;
      }
*************** fix_new_exp_in_seg (segT new_seg,
*** 9793,9799 ****
    segT seg = now_seg;
    subsegT subseg = now_subseg;
  
!   assert (new_seg != 0);
    subseg_set (new_seg, new_subseg);
  
    new_fix = fix_new_exp (frag, where, size, exp, pcrel, r_type);
--- 9793,9799 ----
    segT seg = now_seg;
    subsegT subseg = now_subseg;
  
!   gas_assert (new_seg != 0);
    subseg_set (new_seg, new_subseg);
  
    new_fix = fix_new_exp (frag, where, size, exp, pcrel, r_type);
*************** convert_frag_immed_finish_loop (segT seg
*** 9847,9864 ****
    tinsn_from_chars (&loop_insn, fragP->fr_opcode + loop_offset, 0);
    tinsn_immed_from_frag (&loop_insn, fragP, 0);
  
!   assert (xtensa_opcode_is_loop (isa, loop_insn.opcode) == 1);
    addi_offset += loop_offset;
    addmi_offset += loop_offset;
  
!   assert (tinsn->ntok == 2);
    if (tinsn->tok[1].X_op == O_constant)
      target = tinsn->tok[1].X_add_number;
    else if (tinsn->tok[1].X_op == O_symbol)
      {
        /* Find the fragment.  */
        symbolS *sym = tinsn->tok[1].X_add_symbol;
!       assert (S_GET_SEGMENT (sym) == segP
  	      || S_GET_SEGMENT (sym) == absolute_section);
        target = (S_GET_VALUE (sym) + tinsn->tok[1].X_add_number);
      }
--- 9847,9864 ----
    tinsn_from_chars (&loop_insn, fragP->fr_opcode + loop_offset, 0);
    tinsn_immed_from_frag (&loop_insn, fragP, 0);
  
!   gas_assert (xtensa_opcode_is_loop (isa, loop_insn.opcode) == 1);
    addi_offset += loop_offset;
    addmi_offset += loop_offset;
  
!   gas_assert (tinsn->ntok == 2);
    if (tinsn->tok[1].X_op == O_constant)
      target = tinsn->tok[1].X_add_number;
    else if (tinsn->tok[1].X_op == O_symbol)
      {
        /* Find the fragment.  */
        symbolS *sym = tinsn->tok[1].X_add_symbol;
!       gas_assert (S_GET_SEGMENT (sym) == segP
  	      || S_GET_SEGMENT (sym) == absolute_section);
        target = (S_GET_VALUE (sym) + tinsn->tok[1].X_add_number);
      }
*************** convert_frag_immed_finish_loop (segT seg
*** 9884,9893 ****
  		  _("loop too long for LOOP instruction"));
  
    tinsn_from_chars (&addi_insn, fragP->fr_opcode + addi_offset, 0);
!   assert (addi_insn.opcode == xtensa_addi_opcode);
  
    tinsn_from_chars (&addmi_insn, fragP->fr_opcode + addmi_offset, 0);
!   assert (addmi_insn.opcode == xtensa_addmi_opcode);
  
    set_expr_const (&addi_insn.tok[2], loop_length_lo);
    tinsn_to_insnbuf (&addi_insn, insnbuf);
--- 9884,9893 ----
  		  _("loop too long for LOOP instruction"));
  
    tinsn_from_chars (&addi_insn, fragP->fr_opcode + addi_offset, 0);
!   gas_assert (addi_insn.opcode == xtensa_addi_opcode);
  
    tinsn_from_chars (&addmi_insn, fragP->fr_opcode + addmi_offset, 0);
!   gas_assert (addmi_insn.opcode == xtensa_addmi_opcode);
  
    set_expr_const (&addi_insn.tok[2], loop_length_lo);
    tinsn_to_insnbuf (&addi_insn, insnbuf);
*************** xtensa_move_seg_list_to_beginning (seg_l
*** 10040,10046 ****
        segT literal_section = head->seg;
  
        /* Move the literal section to the front of the section list.  */
!       assert (literal_section);
        if (literal_section != stdoutput->sections)
  	{
  	  bfd_section_list_remove (stdoutput, literal_section);
--- 10040,10046 ----
        segT literal_section = head->seg;
  
        /* Move the literal section to the front of the section list.  */
!       gas_assert (literal_section);
        if (literal_section != stdoutput->sections)
  	{
  	  bfd_section_list_remove (stdoutput, literal_section);
*************** xtensa_move_literals (void)
*** 10085,10096 ****
  
        while (!search_frag->tc_frag_data.literal_frag)
  	{
! 	  assert (search_frag->fr_fix == 0
  		  || search_frag->fr_type == rs_align);
  	  search_frag = search_frag->fr_next;
  	}
  
!       assert (search_frag->tc_frag_data.literal_frag->fr_subtype
  	      == RELAX_LITERAL_POOL_BEGIN);
        xtensa_switch_section_emit_state (&state, segment->seg, 0);
  
--- 10085,10096 ----
  
        while (!search_frag->tc_frag_data.literal_frag)
  	{
! 	  gas_assert (search_frag->fr_fix == 0
  		  || search_frag->fr_type == rs_align);
  	  search_frag = search_frag->fr_next;
  	}
  
!       gas_assert (search_frag->tc_frag_data.literal_frag->fr_subtype
  	      == RELAX_LITERAL_POOL_BEGIN);
        xtensa_switch_section_emit_state (&state, segment->seg, 0);
  
*************** xtensa_move_literals (void)
*** 10113,10121 ****
  	  if (search_frag->tc_frag_data.literal_frag)
  	    {
  	      literal_pool = search_frag->tc_frag_data.literal_frag;
! 	      assert (literal_pool->fr_subtype == RELAX_LITERAL_POOL_BEGIN);
  	      frchain_to = literal_pool->tc_frag_data.lit_frchain;
! 	      assert (frchain_to);
  	    }
  	  insert_after = literal_pool->tc_frag_data.literal_frag;
  	  dest_seg = insert_after->fr_next->tc_frag_data.lit_seg;
--- 10113,10121 ----
  	  if (search_frag->tc_frag_data.literal_frag)
  	    {
  	      literal_pool = search_frag->tc_frag_data.literal_frag;
! 	      gas_assert (literal_pool->fr_subtype == RELAX_LITERAL_POOL_BEGIN);
  	      frchain_to = literal_pool->tc_frag_data.lit_frchain;
! 	      gas_assert (frchain_to);
  	    }
  	  insert_after = literal_pool->tc_frag_data.literal_frag;
  	  dest_seg = insert_after->fr_next->tc_frag_data.lit_seg;
*************** xtensa_move_literals (void)
*** 10153,10159 ****
  	  frchain_from = seg_info (segment->seg)->frchainP;
  	  as_warn (_("fixes not all moved from %s"), segment->seg->name);
  
! 	  assert (frchain_from->fix_root == NULL);
  	}
        frchain_from->fix_tail = NULL;
        xtensa_restore_emit_state (&state);
--- 10153,10159 ----
  	  frchain_from = seg_info (segment->seg)->frchainP;
  	  as_warn (_("fixes not all moved from %s"), segment->seg->name);
  
! 	  gas_assert (frchain_from->fix_root == NULL);
  	}
        frchain_from->fix_tail = NULL;
        xtensa_restore_emit_state (&state);
*************** xtensa_reorder_seg_list (seg_list *head,
*** 10206,10212 ****
        segT literal_section = head->seg;
  
        /* Move the literal section after "after".  */
!       assert (literal_section);
        if (literal_section != after)
  	{
  	  bfd_section_list_remove (stdoutput, literal_section);
--- 10206,10212 ----
        segT literal_section = head->seg;
  
        /* Move the literal section after "after".  */
!       gas_assert (literal_section);
        if (literal_section != after)
  	{
  	  bfd_section_list_remove (stdoutput, literal_section);
*************** xtensa_reorder_segments (void)
*** 10241,10247 ****
    /* Now perform the final error check.  */
    for (sec = stdoutput->sections; sec != NULL; sec = sec->next)
      new_count++;
!   assert (new_count == old_count);
  }
  
  
--- 10241,10247 ----
    /* Now perform the final error check.  */
    for (sec = stdoutput->sections; sec != NULL; sec = sec->next)
      new_count++;
!   gas_assert (new_count == old_count);
  }
  
  
*************** xtensa_post_relax_hook (void)
*** 10521,10527 ****
  static bfd_boolean
  get_frag_is_literal (const fragS *fragP)
  {
!   assert (fragP != NULL);
    return fragP->tc_frag_data.is_literal;
  }
  
--- 10521,10527 ----
  static bfd_boolean
  get_frag_is_literal (const fragS *fragP)
  {
!   gas_assert (fragP != NULL);
    return fragP->tc_frag_data.is_literal;
  }
  
*************** xtensa_create_property_segments (frag_pr
*** 10603,10609 ****
  		  fixS *fix;
  
  		  /* Write the fixup.  */
! 		  assert (cur_block);
  		  fix = fix_new (frag_now, i * 8, 4,
  				 section_symbol (cur_block->sec),
  				 cur_block->offset,
--- 10603,10609 ----
  		  fixS *fix;
  
  		  /* Write the fixup.  */
! 		  gas_assert (cur_block);
  		  fix = fix_new (frag_now, i * 8, 4,
  				 section_symbol (cur_block->sec),
  				 cur_block->offset,
*************** xtensa_create_xproperty_segments (frag_f
*** 10701,10707 ****
  		  fixS *fix;
  
  		  /* Write the fixup.  */
! 		  assert (cur_block);
  		  fix = fix_new (frag_now, i * 12, 4,
  				 section_symbol (cur_block->sec),
  				 cur_block->offset,
--- 10701,10707 ----
  		  fixS *fix;
  
  		  /* Write the fixup.  */
! 		  gas_assert (cur_block);
  		  fix = fix_new (frag_now, i * 12, 4,
  				 section_symbol (cur_block->sec),
  				 cur_block->offset,
*************** init_op_placement_info_table (void)
*** 11113,11119 ****
  
    op_placement_table = (op_placement_info_table)
      xmalloc (sizeof (op_placement_info) * num_opcodes);
!   assert (xtensa_isa_num_formats (isa) < MAX_FORMATS);
  
    for (opcode = 0; opcode < num_opcodes; opcode++)
      {
--- 11113,11119 ----
  
    op_placement_table = (op_placement_info_table)
      xmalloc (sizeof (op_placement_info) * num_opcodes);
!   gas_assert (xtensa_isa_num_formats (isa) < MAX_FORMATS);
  
    for (opcode = 0; opcode < num_opcodes; opcode++)
      {
*************** TInsn *
*** 11219,11225 ****
  istack_top (IStack *stack)
  {
    int rec = stack->ninsn - 1;
!   assert (!istack_empty (stack));
    return &stack->insn[rec];
  }
  
--- 11219,11225 ----
  istack_top (IStack *stack)
  {
    int rec = stack->ninsn - 1;
!   gas_assert (!istack_empty (stack));
    return &stack->insn[rec];
  }
  
*************** void
*** 11231,11237 ****
  istack_push (IStack *stack, TInsn *insn)
  {
    int rec = stack->ninsn;
!   assert (!istack_full (stack));
    stack->insn[rec] = *insn;
    stack->ninsn++;
  }
--- 11231,11237 ----
  istack_push (IStack *stack, TInsn *insn)
  {
    int rec = stack->ninsn;
!   gas_assert (!istack_full (stack));
    stack->insn[rec] = *insn;
    stack->ninsn++;
  }
*************** istack_push_space (IStack *stack)
*** 11245,11251 ****
  {
    int rec = stack->ninsn;
    TInsn *insn;
!   assert (!istack_full (stack));
    insn = &stack->insn[rec];
    tinsn_init (insn);
    stack->ninsn++;
--- 11245,11251 ----
  {
    int rec = stack->ninsn;
    TInsn *insn;
!   gas_assert (!istack_full (stack));
    insn = &stack->insn[rec];
    tinsn_init (insn);
    stack->ninsn++;
*************** void
*** 11260,11266 ****
  istack_pop (IStack *stack)
  {
    int rec = stack->ninsn - 1;
!   assert (!istack_empty (stack));
    stack->ninsn--;
    tinsn_init (&stack->insn[rec]);
  }
--- 11260,11266 ----
  istack_pop (IStack *stack)
  {
    int rec = stack->ninsn - 1;
!   gas_assert (!istack_empty (stack));
    stack->ninsn--;
    tinsn_init (&stack->insn[rec]);
  }
*************** tinsn_has_symbolic_operands (const TInsn
*** 11283,11289 ****
    int i;
    int n = insn->ntok;
  
!   assert (insn->insn_type == ITYPE_INSN);
  
    for (i = 0; i < n; ++i)
      {
--- 11283,11289 ----
    int i;
    int n = insn->ntok;
  
!   gas_assert (insn->insn_type == ITYPE_INSN);
  
    for (i = 0; i < n; ++i)
      {
*************** tinsn_has_invalid_symbolic_operands (con
*** 11307,11313 ****
    int i;
    int n = insn->ntok;
  
!   assert (insn->insn_type == ITYPE_INSN);
  
    for (i = 0; i < n; ++i)
      {
--- 11307,11313 ----
    int i;
    int n = insn->ntok;
  
!   gas_assert (insn->insn_type == ITYPE_INSN);
  
    for (i = 0; i < n; ++i)
      {
*************** tinsn_has_complex_operands (const TInsn 
*** 11351,11357 ****
  {
    int i;
    int n = insn->ntok;
!   assert (insn->insn_type == ITYPE_INSN);
    for (i = 0; i < n; ++i)
      {
        switch (insn->tok[i].X_op)
--- 11351,11357 ----
  {
    int i;
    int n = insn->ntok;
!   gas_assert (insn->insn_type == ITYPE_INSN);
    for (i = 0; i < n; ++i)
      {
        switch (insn->tok[i].X_op)
*************** tinsn_to_slotbuf (xtensa_format fmt,
*** 11390,11396 ****
    int noperands = xtensa_opcode_num_operands (isa, opcode);
    int i;
  
!   assert (tinsn->insn_type == ITYPE_INSN);
    if (noperands != tinsn->ntok)
      as_fatal (_("operand number mismatch"));
  
--- 11390,11396 ----
    int noperands = xtensa_opcode_num_operands (isa, opcode);
    int i;
  
!   gas_assert (tinsn->insn_type == ITYPE_INSN);
    if (noperands != tinsn->ntok)
      as_fatal (_("operand number mismatch"));
  
*************** tinsn_immed_from_frag (TInsn *tinsn, fra
*** 11615,11621 ****
    if (fragP->tc_frag_data.slot_symbols[slot])
      {
        opnum = get_relaxable_immed (opcode);
!       assert (opnum >= 0);
        set_expr_symbol_offset (&tinsn->tok[opnum],
  			      fragP->tc_frag_data.slot_symbols[slot],
  			      fragP->tc_frag_data.slot_offsets[slot]);
--- 11615,11621 ----
    if (fragP->tc_frag_data.slot_symbols[slot])
      {
        opnum = get_relaxable_immed (opcode);
!       gas_assert (opnum >= 0);
        set_expr_symbol_offset (&tinsn->tok[opnum],
  			      fragP->tc_frag_data.slot_symbols[slot],
  			      fragP->tc_frag_data.slot_offsets[slot]);
*************** expr_is_const (const expressionS *s)
*** 11869,11875 ****
  offsetT
  get_expr_const (const expressionS *s)
  {
!   assert (expr_is_const (s));
    return s->X_add_number;
  }
  
--- 11869,11875 ----
  offsetT
  get_expr_const (const expressionS *s)
  {
!   gas_assert (expr_is_const (s));
    return s->X_add_number;
  }
  
*************** expr_is_register (const expressionS *s)
*** 11899,11905 ****
  offsetT
  get_expr_register (const expressionS *s)
  {
!   assert (expr_is_register (s));
    return s->X_add_number;
  }
  
--- 11899,11905 ----
  offsetT
  get_expr_register (const expressionS *s)
  {
!   gas_assert (expr_is_register (s));
    return s->X_add_number;
  }
  
Only in src.assert/gas/config: tc-xtensa.c.orig
diff -crp src.head/gas/config/xtensa-relax.c src.assert/gas/config/xtensa-relax.c
*** src.head/gas/config/xtensa-relax.c	Tue Jun 16 09:07:25 2009
--- src.assert/gas/config/xtensa-relax.c	Tue Jun 16 09:39:05 2009
*************** append_transition (TransitionTable *tt,
*** 525,532 ****
    TransitionList *tl = (TransitionList *) xmalloc (sizeof (TransitionList));
    TransitionList *prev;
    TransitionList **t_p;
!   assert (tt != NULL);
!   assert (opcode < tt->num_opcodes);
  
    prev = tt->table[opcode];
    tl->rule = t;
--- 525,532 ----
    TransitionList *tl = (TransitionList *) xmalloc (sizeof (TransitionList));
    TransitionList *prev;
    TransitionList **t_p;
!   gas_assert (tt != NULL);
!   gas_assert (opcode < tt->num_opcodes);
  
    prev = tt->table[opcode];
    tl->rule = t;
*************** op_is_constant (const opname_map_e *m1)
*** 899,905 ****
  static unsigned
  op_get_constant (const opname_map_e *m1)
  {
!   assert (m1->operand_name == NULL);
    return m1->constant_value;
  }
  
--- 899,905 ----
  static unsigned
  op_get_constant (const opname_map_e *m1)
  {
!   gas_assert (m1->operand_name == NULL);
    return m1->constant_value;
  }
  
Only in src.assert/gas/config: xtensa-relax.c.orig
diff -crp src.head/gas/dw2gencfi.c src.assert/gas/dw2gencfi.c
*** src.head/gas/dw2gencfi.c	Tue Jun 16 09:07:25 2009
--- src.assert/gas/dw2gencfi.c	Tue Jun 16 09:39:04 2009
*************** cfi_add_CFA_offset (unsigned regno, offs
*** 285,291 ****
  {
    unsigned int abs_data_align;
  
!   assert (DWARF2_CIE_DATA_ALIGNMENT != 0);
    cfi_add_CFA_insn_reg_offset (DW_CFA_offset, regno, offset);
  
    abs_data_align = (DWARF2_CIE_DATA_ALIGNMENT < 0
--- 285,291 ----
  {
    unsigned int abs_data_align;
  
!   gas_assert (DWARF2_CIE_DATA_ALIGNMENT != 0);
    cfi_add_CFA_insn_reg_offset (DW_CFA_offset, regno, offset);
  
    abs_data_align = (DWARF2_CIE_DATA_ALIGNMENT < 0
Only in src.assert/gas: dw2gencfi.c.orig
diff -crp src.head/gas/dwarf2dbg.c src.assert/gas/dwarf2dbg.c
*** src.head/gas/dwarf2dbg.c	Tue Jun 16 09:07:25 2009
--- src.assert/gas/dwarf2dbg.c	Tue Jun 16 09:39:04 2009
*************** emit_inc_line_addr (int line_delta, addr
*** 913,919 ****
  
    /* Line number sequences cannot go backward in addresses.  This means
       we've incorrectly ordered the statements in the sequence.  */
!   assert ((offsetT) addr_delta >= 0);
  
    /* Scale the address delta by the minimum instruction length.  */
    scale_addr_delta (&addr_delta);
--- 913,919 ----
  
    /* Line number sequences cannot go backward in addresses.  This means
       we've incorrectly ordered the statements in the sequence.  */
!   gas_assert ((offsetT) addr_delta >= 0);
  
    /* Scale the address delta by the minimum instruction length.  */
    scale_addr_delta (&addr_delta);
*************** emit_inc_line_addr (int line_delta, addr
*** 994,1000 ****
      *p++ = tmp;
  
   done:
!   assert (p == end);
  }
  
  /* Handy routine to combine calls to the above two routines.  */
--- 994,1000 ----
      *p++ = tmp;
  
   done:
!   gas_assert (p == end);
  }
  
  /* Handy routine to combine calls to the above two routines.  */
*************** emit_fixed_inc_line_addr (int line_delta
*** 1052,1058 ****
  
    /* Line number sequences cannot go backward in addresses.  This means
       we've incorrectly ordered the statements in the sequence.  */
!   assert ((offsetT) addr_delta >= 0);
  
    /* INT_MAX is a signal that this is actually a DW_LNE_end_sequence.  */
    if (line_delta != INT_MAX)
--- 1052,1058 ----
  
    /* Line number sequences cannot go backward in addresses.  This means
       we've incorrectly ordered the statements in the sequence.  */
!   gas_assert ((offsetT) addr_delta >= 0);
  
    /* INT_MAX is a signal that this is actually a DW_LNE_end_sequence.  */
    if (line_delta != INT_MAX)
*************** emit_fixed_inc_line_addr (int line_delta
*** 1074,1080 ****
        symbolS *to_sym;
        expressionS expr;
  
!       assert (exp->X_op = O_subtract);
        to_sym = exp->X_add_symbol;
  
        *p++ = DW_LNS_extended_op;
--- 1074,1080 ----
        symbolS *to_sym;
        expressionS expr;
  
!       gas_assert (exp->X_op = O_subtract);
        to_sym = exp->X_add_symbol;
  
        *p++ = DW_LNS_extended_op;
*************** emit_fixed_inc_line_addr (int line_delta
*** 1104,1110 ****
    else
      *p++ = DW_LNS_copy;
  
!   assert (p == end);
  }
  
  /* Generate a variant frag that we can use to relax address/line
--- 1104,1110 ----
    else
      *p++ = DW_LNS_copy;
  
!   gas_assert (p == end);
  }
  
  /* Generate a variant frag that we can use to relax address/line
*************** dwarf2dbg_convert_frag (fragS *frag)
*** 1183,1189 ****
    /* fr_var carries the max_chars that we created the fragment with.
       fr_subtype carries the current expected length.  We must, of
       course, have allocated enough memory earlier.  */
!   assert (frag->fr_var >= (int) frag->fr_subtype);
  
    if (DWARF2_USE_FIXED_ADVANCE_PC)
      emit_fixed_inc_line_addr (frag->fr_offset, addr_diff, frag,
--- 1183,1189 ----
    /* fr_var carries the max_chars that we created the fragment with.
       fr_subtype carries the current expected length.  We must, of
       course, have allocated enough memory earlier.  */
!   gas_assert (frag->fr_var >= (int) frag->fr_subtype);
  
    if (DWARF2_USE_FIXED_ADVANCE_PC)
      emit_fixed_inc_line_addr (frag->fr_offset, addr_diff, frag,
*************** dwarf2_finish (void)
*** 1757,1763 ****
        segT aranges_seg;
        segT ranges_seg;
  
!       assert (all_segs);
  
        info_seg = subseg_new (".debug_info", 0);
        abbrev_seg = subseg_new (".debug_abbrev", 0);
--- 1757,1763 ----
        segT aranges_seg;
        segT ranges_seg;
  
!       gas_assert (all_segs);
  
        info_seg = subseg_new (".debug_info", 0);
        abbrev_seg = subseg_new (".debug_abbrev", 0);
Only in src.assert/gas: dwarf2dbg.c.orig
diff -crp src.head/gas/ehopt.c src.assert/gas/ehopt.c
*** src.head/gas/ehopt.c	Tue Jun 16 09:07:26 2009
--- src.assert/gas/ehopt.c	Tue Jun 16 09:39:04 2009
*************** eh_frame_estimate_size_before_relax (fra
*** 474,480 ****
  
    diff = resolve_symbol_value (frag->fr_symbol);
  
!   assert (ca > 0);
    diff /= ca;
    if (diff < 0x40)
      ret = 0;
--- 474,480 ----
  
    diff = resolve_symbol_value (frag->fr_symbol);
  
!   gas_assert (ca > 0);
    diff /= ca;
    if (diff < 0x40)
      ret = 0;
*************** eh_frame_convert_frag (fragS *frag)
*** 521,543 ****
    diff = resolve_symbol_value (frag->fr_symbol);
  
    ca = frag->fr_subtype >> 3;
!   assert (ca > 0);
    diff /= ca;
    switch (frag->fr_subtype & 7)
      {
      case 0:
!       assert (diff < 0x40);
        loc4_frag->fr_literal[loc4_fix] = DW_CFA_advance_loc | diff;
        break;
  
      case 1:
!       assert (diff < 0x100);
        loc4_frag->fr_literal[loc4_fix] = DW_CFA_advance_loc1;
        frag->fr_literal[frag->fr_fix] = diff;
        break;
  
      case 2:
!       assert (diff < 0x10000);
        loc4_frag->fr_literal[loc4_fix] = DW_CFA_advance_loc2;
        md_number_to_chars (frag->fr_literal + frag->fr_fix, diff, 2);
        break;
--- 521,543 ----
    diff = resolve_symbol_value (frag->fr_symbol);
  
    ca = frag->fr_subtype >> 3;
!   gas_assert (ca > 0);
    diff /= ca;
    switch (frag->fr_subtype & 7)
      {
      case 0:
!       gas_assert (diff < 0x40);
        loc4_frag->fr_literal[loc4_fix] = DW_CFA_advance_loc | diff;
        break;
  
      case 1:
!       gas_assert (diff < 0x100);
        loc4_frag->fr_literal[loc4_fix] = DW_CFA_advance_loc1;
        frag->fr_literal[frag->fr_fix] = diff;
        break;
  
      case 2:
!       gas_assert (diff < 0x10000);
        loc4_frag->fr_literal[loc4_fix] = DW_CFA_advance_loc2;
        md_number_to_chars (frag->fr_literal + frag->fr_fix, diff, 2);
        break;
diff -crp src.head/gas/expr.c src.assert/gas/expr.c
*** src.head/gas/expr.c	Tue Jun 16 09:07:26 2009
--- src.assert/gas/expr.c	Tue Jun 16 09:47:09 2009
*************** integer_constant (int radix, expressionS
*** 411,417 ****
        if (num_little_digits > SIZE_OF_LARGE_NUMBER - 1)
  	num_little_digits = SIZE_OF_LARGE_NUMBER - 1;
  
!       assert (num_little_digits >= 4);
  
        if (num_little_digits != 8)
  	as_bad (_("a bignum with underscores must have exactly 4 words"));
--- 411,417 ----
        if (num_little_digits > SIZE_OF_LARGE_NUMBER - 1)
  	num_little_digits = SIZE_OF_LARGE_NUMBER - 1;
  
!       gas_assert (num_little_digits >= 4);
  
        if (num_little_digits != 8)
  	as_bad (_("a bignum with underscores must have exactly 4 words"));
*************** expr_set_precedence (void)
*** 1564,1570 ****
  void
  expr_set_rank (operatorT operator, operator_rankT rank)
  {
!   assert (operator >= O_md1 && operator < ARRAY_SIZE (op_rank));
    op_rank[operator] = rank;
  }
  
--- 1564,1570 ----
  void
  expr_set_rank (operatorT operator, operator_rankT rank)
  {
!   gas_assert (operator >= O_md1 && operator < ARRAY_SIZE (op_rank));
    op_rank[operator] = rank;
  }
  
*************** expr_begin (void)
*** 1579,1585 ****
    {
      expressionS e;
      e.X_op = O_max;
!     assert (e.X_op == O_max);
    }
  }
  
--- 1579,1585 ----
    {
      expressionS e;
      e.X_op = O_max;
!     gas_assert (e.X_op == O_max);
    }
  }
  
Only in src.assert/gas: expr.c.orig
diff -crp src.head/gas/frags.c src.assert/gas/frags.c
*** src.head/gas/frags.c	Tue Jun 16 09:07:26 2009
--- src.assert/gas/frags.c	Tue Jun 16 09:39:04 2009
*************** frag_new (int old_frags_var_max_size
*** 137,148 ****
    fragS *former_last_fragP;
    frchainS *frchP;
  
!   assert (frchain_now->frch_last == frag_now);
  
    /* Fix up old frag's fr_fix.  */
    frag_now->fr_fix = frag_now_fix_octets () - old_frags_var_max_size;
    /* Make sure its type is valid.  */
!   assert (frag_now->fr_type != 0);
  
    /* This will align the obstack so the next struct we allocate on it
       will begin at a correct boundary.  */
--- 137,148 ----
    fragS *former_last_fragP;
    frchainS *frchP;
  
!   gas_assert (frchain_now->frch_last == frag_now);
  
    /* Fix up old frag's fr_fix.  */
    frag_now->fr_fix = frag_now_fix_octets () - old_frags_var_max_size;
    /* Make sure its type is valid.  */
!   gas_assert (frag_now->fr_type != 0);
  
    /* This will align the obstack so the next struct we allocate on it
       will begin at a correct boundary.  */
*************** frag_new (int old_frags_var_max_size
*** 150,157 ****
    frchP = frchain_now;
    know (frchP);
    former_last_fragP = frchP->frch_last;
!   assert (former_last_fragP != 0);
!   assert (former_last_fragP == frag_now);
    frag_now = frag_alloc (&frchP->frch_obstack);
  
    as_where (&frag_now->fr_file, &frag_now->fr_line);
--- 150,157 ----
    frchP = frchain_now;
    know (frchP);
    former_last_fragP = frchP->frch_last;
!   gas_assert (former_last_fragP != 0);
!   gas_assert (former_last_fragP == frag_now);
    frag_now = frag_alloc (&frchP->frch_obstack);
  
    as_where (&frag_now->fr_file, &frag_now->fr_line);
*************** frag_new (int old_frags_var_max_size
*** 170,176 ****
    }
  #endif
  
!   assert (frchain_now->frch_last == frag_now);
  
    frag_now->fr_next = NULL;
  }
--- 170,176 ----
    }
  #endif
  
!   gas_assert (frchain_now->frch_last == frag_now);
  
    frag_now->fr_next = NULL;
  }
diff -crp src.head/gas/input-file.c src.assert/gas/input-file.c
*** src.head/gas/input-file.c	Tue Jun 16 09:07:26 2009
--- src.assert/gas/input-file.c	Tue Jun 16 09:39:04 2009
*************** input_file_open (char *filename, /* "" m
*** 124,130 ****
  
    preprocess = pre;
  
!   assert (filename != 0);	/* Filename may not be NULL.  */
    if (filename[0])
      {
        f_in = fopen (filename, FOPEN_RT);
--- 124,130 ----
  
    preprocess = pre;
  
!   gas_assert (filename != 0);	/* Filename may not be NULL.  */
    if (filename[0])
      {
        f_in = fopen (filename, FOPEN_RT);
diff -crp src.head/gas/read.c src.assert/gas/read.c
*** src.head/gas/read.c	Tue Jun 16 09:07:26 2009
--- src.assert/gas/read.c	Tue Jun 16 09:39:04 2009
*************** s_weakref (int ignore ATTRIBUTE_UNUSED)
*** 3489,3495 ****
  	{
  	  expressionS *expP = symbol_get_value_expression (symp);
  
! 	  assert (expP->X_op == O_symbol
  		  && expP->X_add_number == 0);
  	  symp = expP->X_add_symbol;
  	}
--- 3489,3495 ----
  	{
  	  expressionS *expP = symbol_get_value_expression (symp);
  
! 	  gas_assert (expP->X_op == O_symbol
  		  && expP->X_add_number == 0);
  	  symp = expP->X_add_symbol;
  	}
Only in src.assert/gas: read.c.orig
diff -crp src.head/gas/sb.c src.assert/gas/sb.c
*** src.head/gas/sb.c	Tue Jun 16 09:07:26 2009
--- src.assert/gas/sb.c	Tue Jun 16 09:39:04 2009
*************** sb_build (sb *ptr, int size)
*** 59,65 ****
    /* See if we can find one to allocate.  */
    sb_element *e;
  
!   assert (size < sb_max_power_two);
  
    e = free_list.size[size];
    if (!e)
--- 59,65 ----
    /* See if we can find one to allocate.  */
    sb_element *e;
  
!   gas_assert (size < sb_max_power_two);
  
    e = free_list.size[size];
    if (!e)
diff -crp src.head/gas/subsegs.c src.assert/gas/subsegs.c
*** src.head/gas/subsegs.c	Tue Jun 16 09:07:26 2009
--- src.assert/gas/subsegs.c	Tue Jun 16 09:39:04 2009
*************** subseg_set_rest (segT seg, subsegT subse
*** 84,90 ****
    if (frag_now && frchain_now)
      frchain_now->frch_frag_now = frag_now;
  
!   assert (frchain_now == 0
  	  || frchain_now->frch_last == frag_now);
  
    subseg_change (seg, (int) subseg);
--- 84,90 ----
    if (frag_now && frchain_now)
      frchain_now->frch_frag_now = frag_now;
  
!   gas_assert (frchain_now == 0
  	  || frchain_now->frch_last == frag_now);
  
    subseg_change (seg, (int) subseg);
*************** subseg_set_rest (segT seg, subsegT subse
*** 125,131 ****
    frchain_now = frcP;
    frag_now = frcP->frch_frag_now;
  
!   assert (frchain_now->frch_last == frag_now);
  }
  
  /*
--- 125,131 ----
    frchain_now = frcP;
    frag_now = frcP->frch_frag_now;
  
!   gas_assert (frchain_now->frch_last == frag_now);
  }
  
  /*
diff -crp src.head/gas/symbols.c src.assert/gas/symbols.c
*** src.head/gas/symbols.c	Tue Jun 16 09:07:26 2009
--- src.assert/gas/symbols.c	Tue Jun 16 09:39:04 2009
*************** local_symbol_convert (struct local_symbo
*** 217,223 ****
  {
    symbolS *ret;
  
!   assert (locsym->lsy_marker == NULL);
    if (local_symbol_converted_p (locsym))
      return local_symbol_get_real_symbol (locsym);
  
--- 217,223 ----
  {
    symbolS *ret;
  
!   gas_assert (locsym->lsy_marker == NULL);
    if (local_symbol_converted_p (locsym))
      return local_symbol_get_real_symbol (locsym);
  
*************** verify_symbol_chain (symbolS *rootP, sym
*** 879,889 ****
  
    for (; symbol_next (symbolP) != NULL; symbolP = symbol_next (symbolP))
      {
!       assert (symbolP->bsym != NULL);
!       assert (symbolP->sy_next->sy_previous == symbolP);
      }
  
!   assert (lastP == symbolP);
  }
  
  #ifdef OBJ_COMPLEX_RELC
--- 879,889 ----
  
    for (; symbol_next (symbolP) != NULL; symbolP = symbol_next (symbolP))
      {
!       gas_assert (symbolP->bsym != NULL);
!       gas_assert (symbolP->sy_next->sy_previous == symbolP);
      }
  
!   gas_assert (lastP == symbolP);
  }
  
  #ifdef OBJ_COMPLEX_RELC
*************** resolve_symbol_value (symbolS *symp)
*** 1144,1156 ****
  	do_symbol:
  	  if (S_IS_WEAKREFR (symp))
  	    {
! 	      assert (final_val == 0);
  	      if (S_IS_WEAKREFR (add_symbol))
  		{
! 		  assert (add_symbol->sy_value.X_op == O_symbol
  			  && add_symbol->sy_value.X_add_number == 0);
  		  add_symbol = add_symbol->sy_value.X_add_symbol;
! 		  assert (! S_IS_WEAKREFR (add_symbol));
  		  symp->sy_value.X_add_symbol = add_symbol;
  		}
  	    }
--- 1144,1156 ----
  	do_symbol:
  	  if (S_IS_WEAKREFR (symp))
  	    {
! 	      gas_assert (final_val == 0);
  	      if (S_IS_WEAKREFR (add_symbol))
  		{
! 		  gas_assert (add_symbol->sy_value.X_op == O_symbol
  			  && add_symbol->sy_value.X_add_number == 0);
  		  add_symbol = add_symbol->sy_value.X_add_symbol;
! 		  gas_assert (! S_IS_WEAKREFR (add_symbol));
  		  symp->sy_value.X_add_symbol = add_symbol;
  		}
  	    }
*************** symbol_relc_make_sym (symbolS * sym)
*** 2986,2992 ****
    char typetag;
    int sname_len;
  
!   assert (sym != NULL);
  
    /* Recurse to symbol_relc_make_expr if this symbol
       is defined as an expression or a plain value.  */
--- 2986,2992 ----
    char typetag;
    int sname_len;
  
!   gas_assert (sym != NULL);
  
    /* Recurse to symbol_relc_make_expr if this symbol
       is defined as an expression or a plain value.  */
*************** symbol_relc_make_expr (expressionS * exp
*** 3051,3057 ****
  
    operands[0] = operands[1] = operands[2] = NULL;
  
!   assert (exp != NULL);
  
    /* Match known operators -> fill in opstr, arity, operands[] and fall
       through to construct subexpression fragments; may instead return 
--- 3051,3057 ----
  
    operands[0] = operands[1] = operands[2] = NULL;
  
!   gas_assert (exp != NULL);
  
    /* Match known operators -> fill in opstr, arity, operands[] and fall
       through to construct subexpression fragments; may instead return 
*************** symbol_relc_make_expr (expressionS * exp
*** 3164,3170 ****
  			       + (arity >= 2 ? (strlen (operands[1]) + 1 ) : 0)
  			       + (arity >= 3 ? (strlen (operands[2]) + 0 ) : 0)
  			       + 1);
!       assert (concat_string != NULL);
        
        /* Format the thing.  */
        sprintf (concat_string, 
--- 3164,3170 ----
  			       + (arity >= 2 ? (strlen (operands[1]) + 1 ) : 0)
  			       + (arity >= 3 ? (strlen (operands[2]) + 0 ) : 0)
  			       + 1);
!       gas_assert (concat_string != NULL);
        
        /* Format the thing.  */
        sprintf (concat_string, 
Only in src.assert/gas: symbols.c.orig
diff -crp src.head/gas/write.c src.assert/gas/write.c
*** src.head/gas/write.c	Tue Jun 16 09:07:26 2009
--- src.assert/gas/write.c	Tue Jun 16 09:39:04 2009
*************** chain_frchains_together_1 (segT section,
*** 386,392 ****
      {
        prev_frag->fr_next = frchp->frch_root;
        prev_frag = frchp->frch_last;
!       assert (prev_frag->fr_type != 0);
        if (frchp->fix_root != (fixS *) NULL)
  	{
  	  if (seg_info (section)->fix_root == (fixS *) NULL)
--- 386,392 ----
      {
        prev_frag->fr_next = frchp->frch_root;
        prev_frag = frchp->frch_last;
!       gas_assert (prev_frag->fr_type != 0);
        if (frchp->fix_root != (fixS *) NULL)
  	{
  	  if (seg_info (section)->fix_root == (fixS *) NULL)
*************** chain_frchains_together_1 (segT section,
*** 396,403 ****
  	  prev_fix = frchp->fix_tail;
  	}
      }
!   assert (prev_frag->fr_type != 0);
!   assert (prev_frag != &dummy);
    prev_frag->fr_next = 0;
    return prev_frag;
  }
--- 396,403 ----
  	  prev_fix = frchp->fix_tail;
  	}
      }
!   gas_assert (prev_frag->fr_type != 0);
!   gas_assert (prev_frag != &dummy);
    prev_frag->fr_next = 0;
    return prev_frag;
  }
*************** cvt_frag_to_fill (segT sec ATTRIBUTE_UNU
*** 478,484 ****
      case rs_machine_dependent:
        md_convert_frag (stdoutput, sec, fragP);
  
!       assert (fragP->fr_next == NULL
  	      || ((offsetT) (fragP->fr_next->fr_address - fragP->fr_address)
  		  == fragP->fr_fix));
  
--- 478,484 ----
      case rs_machine_dependent:
        md_convert_frag (stdoutput, sec, fragP);
  
!       gas_assert (fragP->fr_next == NULL
  	      || ((offsetT) (fragP->fr_next->fr_address - fragP->fr_address)
  		  == fragP->fr_fix));
  
*************** size_seg (bfd *abfd, asection *sec, void
*** 566,580 ****
  
    flags &= ~SEC_RELOC;
    x = bfd_set_section_flags (abfd, sec, flags);
!   assert (x);
  
    newsize = md_section_align (sec, size);
    x = bfd_set_section_size (abfd, sec, newsize);
!   assert (x);
  
    /* If the size had to be rounded up, add some padding in the last
       non-empty frag.  */
!   assert (newsize >= size);
    if (size != newsize)
      {
        fragS *last = seginfo->frchainP->frch_last;
--- 566,580 ----
  
    flags &= ~SEC_RELOC;
    x = bfd_set_section_flags (abfd, sec, flags);
!   gas_assert (x);
  
    newsize = md_section_align (sec, size);
    x = bfd_set_section_size (abfd, sec, newsize);
!   gas_assert (x);
  
    /* If the size had to be rounded up, add some padding in the last
       non-empty frag.  */
!   gas_assert (newsize >= size);
    if (size != newsize)
      {
        fragS *last = seginfo->frchainP->frch_last;
*************** write_contents (bfd *abfd ATTRIBUTE_UNUS
*** 1299,1305 ****
        char *fill_literal;
        offsetT count;
  
!       assert (f->fr_type == rs_fill);
        if (f->fr_fix)
  	{
  	  x = bfd_set_section_contents (stdoutput, sec,
--- 1299,1305 ----
        char *fill_literal;
        offsetT count;
  
!       gas_assert (f->fr_type == rs_fill);
        if (f->fr_fix)
  	{
  	  x = bfd_set_section_contents (stdoutput, sec,
*************** write_contents (bfd *abfd ATTRIBUTE_UNUS
*** 1313,1319 ****
        fill_literal = f->fr_literal + f->fr_fix;
        fill_size = f->fr_var;
        count = f->fr_offset;
!       assert (count >= 0);
        if (fill_size && count)
  	{
  	  char buf[256];
--- 1313,1319 ----
        fill_literal = f->fr_literal + f->fr_fix;
        fill_size = f->fr_var;
        count = f->fr_offset;
!       gas_assert (count >= 0);
        if (fill_size && count)
  	{
  	  char buf[256];
*************** set_symtab (void)
*** 1410,1416 ****
    else
      asympp = 0;
    result = bfd_set_symtab (stdoutput, asympp, nsyms);
!   assert (result);
    symbol_table_frozen = 1;
  }
  
--- 1410,1416 ----
    else
      asympp = 0;
    result = bfd_set_symtab (stdoutput, asympp, nsyms);
!   gas_assert (result);
    symbol_table_frozen = 1;
  }
  

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]