This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

[assert] g*.c files


Hi,
this patch converts the non-generator g*.c files.  There are a couple of
issues with this patch that I'd like advice on, before committing.

1) gcc.c contains a number of 'if (expr) abort ()', where expr is testing
something about a spec string.  Should these really become asserts? or should
they become fatal_error?

2) ggc-{page,zone}.c & gimplify.c contain a number of
'if (simpleexpr) abort ()' protected by ENABLE_CHECKING.  My inclination is
to remove the ENABLE_CHECKING guard, and turn these into regular asserts.

nathan

--
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk

2004-09-08  Nathan Sidwell  <nathan@codesourcery.com>

	* gcc.c (add_sysrooted_prefix, execute, do_self_spec, do_spec_1,
	handle_braces, process_brace_body, main, used_arg,
	set_multilib_dir, print_multilib_info): Use gcc_assert and
	gcc_unreachable.
	gcov-io.c (gcov_open): Likewise.
	gcse.c (INSN_CUID, insert_set_in_table, find_avail_set,
	cprop_insn, do_local_cprop, local_cprop_pass, find_bypass_set,
	process_insert_insn, insert_insn_end_bb, pre_insert_copy_insn,
	hoist_code, extract_mentioned_regs_helper, compute_store_table,
	insert_store): Likewise.
	* ggc-common.c (ggc_splay_alloc, ggc_splay_dont_free,
	gt_pch_note_object, gt_pch_note_reorder, relocate_ptrs,
	ggc_record_overhead): Likewise.
	* ggc-page.c (alloc_page, free_page, ggc_set_mark, ggc_marked_p,
	init_ggc, ggc_push_context, ggc_recalculate_in_use_p,
	ggc_pop_context, clear_marks, validate_free_objects,
	ggc_pch_read): Likewise.
	* ggc-zone.c (ggc_allocated_p, free_chunk, ggc_set_mark,
	ggc_marked_p, ggc_get_size, init_ggc, destroy_ggc_zone,
	ggc_push_context, check_cookies, ggc_collect,
	ggc_print_statistics): Likewise.
	* gimple-low.c (lower_function_body, lower_stmt,
	lower_bind_expr): Likewise.
	* gimplify.c (gimple_tree_eq, push_gimplify_context,
	pop_gimplify_context, gimple_pop_condition, create_tmp_var,
	declare_tmp_vars, gimple_add_tmp_var, annotate_all_with_locus,
	mostly_copy_tree_r, gimplify_return_expr, gimplify_switch_expr,
	gimplify_case_label_expr, gimplify_exit_block_expr,
	canonicalize_component_ref, gimplify_compound_lval,
	gimplify_self_mod_expr, gimplify_call_expr,
	gimplify_init_ctor_eval, gimplify_init_constructor,
	gimplify_modify_expr, gimplify_save_expr, gimplify_target_expr,
	gimplify_expr, check_pointer_types_r,
	force_gimple_operand): Likewise.
	* global.c (global_alloc, build_insn_chain): Likewise.
	* graph.c (clean_graph_dump_file,
	finish_graph_dump_file): Likewise.

Index: gcc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gcc.c,v
retrieving revision 1.431
diff -c -3 -p -r1.431 gcc.c
*** gcc.c	4 Sep 2004 00:15:39 -0000	1.431
--- gcc.c	8 Sep 2004 12:58:57 -0000
*************** add_sysrooted_prefix (struct path_prefix
*** 2627,2634 ****
  		      /* enum prefix_priority */ int priority,
  		      int require_machine_suffix, int os_multilib)
  {
!   if (!IS_ABSOLUTE_PATH (prefix))
!     abort ();
  
    if (target_system_root)
      {
--- 2627,2633 ----
  		      /* enum prefix_priority */ int priority,
  		      int require_machine_suffix, int os_multilib)
  {
!   gcc_assert (IS_ABSOLUTE_PATH (prefix));
  
    if (target_system_root)
      {
*************** execute (void)
*** 2666,2673 ****
  
    struct command *commands;	/* each command buffer with above info.  */
  
!   if (processing_spec_function)
!     abort ();
  
    /* Count # of piped commands.  */
    for (n_commands = 1, i = 0; i < argbuf_index; i++)
--- 2665,2671 ----
  
    struct command *commands;	/* each command buffer with above info.  */
  
!   gcc_assert (!processing_spec_function);
  
    /* Count # of piped commands.  */
    for (n_commands = 1, i = 0; i < argbuf_index; i++)
*************** execute (void)
*** 2840,2847 ****
  	int pid;
  
  	pid = pwait (commands[i].pid, &status, 0);
! 	if (pid < 0)
! 	  abort ();
  
  #ifdef HAVE_GETRUSAGE
  	if (report_times)
--- 2838,2844 ----
  	int pid;
  
  	pid = pwait (commands[i].pid, &status, 0);
! 	gcc_assert (pid >= 0);
  
  #ifdef HAVE_GETRUSAGE
  	if (report_times)
*************** do_self_spec (const char *spec)
*** 4364,4371 ****
  	  struct switchstr *sw;
  
  	  /* Each switch should start with '-'.  */
! 	  if (argbuf[i][0] != '-')
! 	    abort ();
  
  	  sw = &switches[i + first];
  	  sw->part1 = &argbuf[i][1];
--- 4361,4367 ----
  	  struct switchstr *sw;
  
  	  /* Each switch should start with '-'.  */
! 	  gcc_assert (argbuf[i][0] == '-');
  
  	  sw = &switches[i + first];
  	  sw->part1 = &argbuf[i][1];
*************** do_spec_1 (const char *spec, int inswitc
*** 4730,4737 ****
  		  {
  		    p += 2;
  		    /* We don't support extra suffix characters after %O.  */
! 		    if (*p == '.' || ISALPHA ((unsigned char) *p))
! 		      abort ();
  		    if (suffix_length == 0)
  		      suffix = TARGET_OBJECT_SUFFIX;
  		    else
--- 4726,4732 ----
  		  {
  		    p += 2;
  		    /* We don't support extra suffix characters after %O.  */
! 		    gcc_assert (*p != '.' && !ISALPHA ((unsigned char) *p));
  		    if (suffix_length == 0)
  		      suffix = TARGET_OBJECT_SUFFIX;
  		    else
*************** do_spec_1 (const char *spec, int inswitc
*** 4927,4934 ****
  	    {
  	      int cur_index = argbuf_index;
  	      /* Handle the {...} following the %W.  */
! 	      if (*p != '{')
! 		abort ();
  	      p = handle_braces (p + 1);
  	      if (p == 0)
  		return -1;
--- 4922,4928 ----
  	    {
  	      int cur_index = argbuf_index;
  	      /* Handle the {...} following the %W.  */
! 	      gcc_assert (*p == '{');
  	      p = handle_braces (p + 1);
  	      if (p == 0)
  		return -1;
*************** do_spec_1 (const char *spec, int inswitc
*** 4958,4965 ****
  	      char *string;
  
  	      /* Skip past the option value and make a copy.  */
! 	      if (*p != '{')
! 		abort ();
  	      while (*p++ != '}')
  		;
  	      string = save_string (p1 + 1, p - p1 - 2);
--- 4952,4958 ----
  	      char *string;
  
  	      /* Skip past the option value and make a copy.  */
! 	      gcc_assert (*p == '{');
  	      while (*p++ != '}')
  		;
  	      string = save_string (p1 + 1, p - p1 - 2);
*************** handle_braces (const char *p)
*** 5535,5542 ****
  
    do
      {
!       if (a_must_be_last)
! 	abort ();
  
        /* Scan one "atom" (S in the description above of %{}, possibly
  	 with !, ., or * modifiers).  */
--- 5528,5534 ----
  
    do
      {
!       gcc_assert (!a_must_be_last);
  
        /* Scan one "atom" (S in the description above of %{}, possibly
  	 with !, ., or * modifiers).  */
*************** handle_braces (const char *p)
*** 5560,5591 ****
  	p++, a_is_starred = 1;
  
        SKIP_WHITE();
!       if (*p == '&' || *p == '}')
  	{
  	  /* Substitute the switch(es) indicated by the current atom.  */
  	  ordered_set = true;
! 	  if (disjunct_set || n_way_choice || a_is_negated || a_is_suffix
! 	      || atom == end_atom)
! 	    abort ();
  
  	  mark_matching_switches (atom, end_atom, a_is_starred);
  
  	  if (*p == '}')
  	    process_marked_switches ();
! 	}
!       else if (*p == '|' || *p == ':')
! 	{
  	  /* Substitute some text if the current atom appears as a switch
  	     or suffix.  */
  	  disjunct_set = true;
! 	  if (ordered_set)
! 	    abort ();
  
  	  if (atom == end_atom)
  	    {
! 	      if (!n_way_choice || disj_matched || *p == '|'
! 		  || a_is_negated || a_is_suffix || a_is_starred)
! 		abort ();
  
  	      /* An empty term may appear as the last choice of an
  		 N-way choice set; it means "otherwise".  */
--- 5552,5581 ----
  	p++, a_is_starred = 1;
  
        SKIP_WHITE();
!       switch (*p)
  	{
+ 	case '&': case '}':
  	  /* Substitute the switch(es) indicated by the current atom.  */
  	  ordered_set = true;
! 	  gcc_assert (!disjunct_set && !n_way_choice && !a_is_negated
! 		      && !a_is_suffix && atom != end_atom);
  
  	  mark_matching_switches (atom, end_atom, a_is_starred);
  
  	  if (*p == '}')
  	    process_marked_switches ();
! 	  break;
! 
! 	case '|': case ':':
  	  /* Substitute some text if the current atom appears as a switch
  	     or suffix.  */
  	  disjunct_set = true;
! 	  gcc_assert (!ordered_set);
  
  	  if (atom == end_atom)
  	    {
! 	      gcc_assert (n_way_choice && !disj_matched && *p != '|'
! 			  && !a_is_negated && !a_is_suffix && !a_is_starred);
  
  	      /* An empty term may appear as the last choice of an
  		 N-way choice set; it means "otherwise".  */
*************** handle_braces (const char *p)
*** 5595,5622 ****
  	    }
  	  else
  	    {
! 	       if (a_is_suffix && a_is_starred)
! 		 abort ();
  
! 	       if (!a_is_starred)
! 		 disj_starred = false;
  
! 	       /* Don't bother testing this atom if we already have a
!                   match.  */
! 	       if (!disj_matched && !n_way_matched)
! 		 {
! 		   if (a_is_suffix)
! 		     a_matched = input_suffix_matches (atom, end_atom);
! 		   else
! 		     a_matched = switch_matches (atom, end_atom, a_is_starred);
! 
! 		   if (a_matched != a_is_negated)
! 		     {
! 		       disj_matched = true;
! 		       d_atom = atom;
! 		       d_end_atom = end_atom;
! 		     }
! 		 }
  	    }
  
  	  if (*p == ':')
--- 5585,5611 ----
  	    }
  	  else
  	    {
! 	      gcc_assert (!a_is_suffix || !a_is_starred);
  
! 	      if (!a_is_starred)
! 		disj_starred = false;
  
! 	      /* Don't bother testing this atom if we already have a
!                  match.  */
! 	      if (!disj_matched && !n_way_matched)
! 		{
! 		  if (a_is_suffix)
! 		    a_matched = input_suffix_matches (atom, end_atom);
! 		  else
! 		    a_matched = switch_matches (atom, end_atom, a_is_starred);
! 		  
! 		  if (a_matched != a_is_negated)
! 		    {
! 		      disj_matched = true;
! 		      d_atom = atom;
! 		      d_end_atom = end_atom;
! 		    }
! 		}
  	    }
  
  	  if (*p == ':')
*************** handle_braces (const char *p)
*** 5639,5647 ****
  		  d_atom = d_end_atom = NULL;
  		}
  	    }
  	}
-       else
- 	abort ();
      }
    while (*p++ != '}');
  
--- 5628,5639 ----
  		  d_atom = d_end_atom = NULL;
  		}
  	    }
+ 
+ 	  break;
+ 
+ 	default:
+ 	  gcc_unreachable ();
  	}
      }
    while (*p++ != '}');
  
*************** process_brace_body (const char *p, const
*** 5685,5692 ****
  	break;
        else if (*p == '%' && p[1] == '*' && nesting_level == 1)
  	have_subst = true;
!       else if (*p == '\0')
! 	abort ();
        p++;
      }
  
--- 5677,5684 ----
  	break;
        else if (*p == '%' && p[1] == '*' && nesting_level == 1)
  	have_subst = true;
!       else
! 	gcc_assert (*p);
        p++;
      }
  
*************** process_brace_body (const char *p, const
*** 5694,5701 ****
    while (end_body[-1] == ' ' || end_body[-1] == '\t')
      end_body--;
  
!   if (have_subst && !starred)
!     abort ();
  
    if (matched)
      {
--- 5686,5692 ----
    while (end_body[-1] == ' ' || end_body[-1] == '\t')
      end_body--;
  
!   gcc_assert (!have_subst || starred);
  
    if (matched)
      {
*************** main (int argc, const char **argv)
*** 6454,6466 ****
  		{
  		  value = do_spec (input_file_compiler->spec);
  		  infiles[i].preprocessed = true;
! 		  if (have_o_argbuf_index)
! 		    infiles[i].name = argbuf[have_o_argbuf_index];
! 		  else
! 		    abort ();
! 		  infiles[i].incompiler = lookup_compiler (infiles[i].name,
! 						       strlen (infiles[i].name),
! 						       infiles[i].language);
  
  		  if (value < 0)
  		    this_file_error = 1;
--- 6445,6456 ----
  		{
  		  value = do_spec (input_file_compiler->spec);
  		  infiles[i].preprocessed = true;
! 		  gcc_assert (have_o_argbuf_index);
! 		  infiles[i].name = argbuf[have_o_argbuf_index];
! 		  infiles[i].incompiler
! 		    = lookup_compiler (infiles[i].name,
! 				       strlen (infiles[i].name),
! 				       infiles[i].language);
  
  		  if (value < 0)
  		    this_file_error = 1;
*************** used_arg (const char *p, int len)
*** 6920,6927 ****
  	  matches[i].str = q;
  	  while (*q != ' ')
  	    {
! 	      if (*q == '\0')
! 		abort ();
  	      q++;
  	    }
  	  matches[i].len = q - matches[i].str;
--- 6910,6916 ----
  	  matches[i].str = q;
  	  while (*q != ' ')
  	    {
! 	      gcc_assert (*q);
  	      q++;
  	    }
  	  matches[i].len = q - matches[i].str;
*************** used_arg (const char *p, int len)
*** 6929,6936 ****
  	  matches[i].replace = ++q;
  	  while (*q != ';' && *q != '\0')
  	    {
! 	      if (*q == ' ')
! 		abort ();
  	      q++;
  	    }
  	  matches[i].rep_len = q - matches[i].replace;
--- 6918,6924 ----
  	  matches[i].replace = ++q;
  	  while (*q != ';' && *q != '\0')
  	    {
! 	      gcc_assert (*q != ' ');
  	      q++;
  	    }
  	  matches[i].rep_len = q - matches[i].replace;
*************** set_multilib_dir (void)
*** 7109,7116 ****
        ok = 1;
        while (*p != ';')
  	{
! 	  if (*p == '\0')
! 	    abort ();
  
  	  if (! ok)
  	    {
--- 7097,7103 ----
        ok = 1;
        while (*p != ';')
  	{
! 	  gcc_assert (*p);
  
  	  if (! ok)
  	    {
*************** set_multilib_dir (void)
*** 7121,7128 ****
  	  this_arg = p;
  	  while (*p != ' ' && *p != ';')
  	    {
! 	      if (*p == '\0')
! 		abort ();
  	      ++p;
  	    }
  
--- 7108,7114 ----
  	  this_arg = p;
  	  while (*p != ' ' && *p != ';')
  	    {
! 	      gcc_assert (*p);
  	      ++p;
  	    }
  
*************** set_multilib_dir (void)
*** 7163,7170 ****
        this_path = p;
        while (*p != ' ')
  	{
! 	  if (*p == '\0')
! 	    abort ();
  	  ++p;
  	}
        this_path_len = p - this_path;
--- 7149,7155 ----
        this_path = p;
        while (*p != ' ')
  	{
! 	  gcc_assert (*p);
  	  ++p;
  	}
        this_path_len = p - this_path;
*************** set_multilib_dir (void)
*** 7175,7182 ****
        ++p;
        while (*p != ';')
  	{
! 	  if (*p == '\0')
! 	    abort ();
  
  	  if (! ok)
  	    {
--- 7160,7166 ----
        ++p;
        while (*p != ';')
  	{
! 	  gcc_assert (*p);
  
  	  if (! ok)
  	    {
*************** set_multilib_dir (void)
*** 7187,7194 ****
  	  this_arg = p;
  	  while (*p != ' ' && *p != ';')
  	    {
! 	      if (*p == '\0')
! 		abort ();
  	      ++p;
  	    }
  
--- 7171,7177 ----
  	  this_arg = p;
  	  while (*p != ' ' && *p != ';')
  	    {
! 	      gcc_assert (*p);
  	      ++p;
  	    }
  
*************** print_multilib_info (void)
*** 7300,7307 ****
        this_path = p;
        while (*p != ' ')
  	{
! 	  if (*p == '\0')
! 	    abort ();
  	  ++p;
  	}
  
--- 7283,7289 ----
        this_path = p;
        while (*p != ' ')
  	{
! 	  gcc_assert (*p);
  	  ++p;
  	}
  
*************** print_multilib_info (void)
*** 7334,7341 ****
  		const char *q;
  		int mp = 0;
  
! 		if (*e == '\0')
! 		  abort ();
  
  		if (! m)
  		  {
--- 7316,7322 ----
  		const char *q;
  		int mp = 0;
  
! 		gcc_assert (*e);
  
  		if (! m)
  		  {
*************** print_multilib_info (void)
*** 7347,7354 ****
  
  		while (*e != ' ' && *e != ';')
  		  {
! 		    if (*e == '\0')
! 		      abort ();
  		    ++e;
  		  }
  
--- 7328,7334 ----
  
  		while (*e != ' ' && *e != ';')
  		  {
! 		    gcc_assert (*e);
  		    ++e;
  		  }
  
*************** print_multilib_info (void)
*** 7358,7372 ****
  		    const char *arg;
  		    int len = e - this_arg;
  
! 		    if (*q == '\0')
! 		      abort ();
! 
  		    arg = q;
  
  		    while (*q != ' ' && *q != ';')
  		      {
! 			if (*q == '\0')
! 			  abort ();
  			++q;
  		      }
  
--- 7338,7349 ----
  		    const char *arg;
  		    int len = e - this_arg;
  
! 		    gcc_assert (*q);
  		    arg = q;
  
  		    while (*q != ' ' && *q != ';')
  		      {
! 			gcc_assert (*q);
  			++q;
  		      }
  
*************** print_multilib_info (void)
*** 7421,7428 ****
  	    {
  	      const char *arg;
  
! 	      if (*q == '\0')
! 		abort ();
  
  	      if (*q == '!')
  		arg = NULL;
--- 7398,7404 ----
  	    {
  	      const char *arg;
  
! 	      gcc_assert (*q);
  
  	      if (*q == '!')
  		arg = NULL;
*************** print_multilib_info (void)
*** 7431,7438 ****
  
  	      while (*q != ' ' && *q != ';')
  		{
! 		  if (*q == '\0')
! 		    abort ();
  		  ++q;
  		}
  
--- 7407,7413 ----
  
  	      while (*q != ' ' && *q != ';')
  		{
! 		  gcc_assert (*q);
  		  ++q;
  		}
  
*************** print_multilib_info (void)
*** 7462,7469 ****
  	{
  	  int use_arg;
  
! 	  if (*p == '\0')
! 	    abort ();
  
  	  if (skip)
  	    {
--- 7437,7443 ----
  	{
  	  int use_arg;
  
! 	  gcc_assert (*p);
  
  	  if (skip)
  	    {
*************** print_multilib_info (void)
*** 7478,7485 ****
  
  	  while (*p != ' ' && *p != ';')
  	    {
! 	      if (*p == '\0')
! 		abort ();
  	      if (use_arg)
  		putchar (*p);
  	      ++p;
--- 7452,7458 ----
  
  	  while (*p != ' ' && *p != ';')
  	    {
! 	      gcc_assert (*p);
  	      if (use_arg)
  		putchar (*p);
  	      ++p;
Index: gcov-io.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gcov-io.c,v
retrieving revision 1.17
diff -c -3 -p -r1.17 gcov-io.c
*** gcov-io.c	1 Sep 2004 20:58:52 -0000	1.17
--- gcov-io.c	8 Sep 2004 12:58:58 -0000
*************** gcov_open (const char *name, int mode)
*** 74,81 ****
    s_flock.l_pid = getpid ();
  #endif
    
!   if (gcov_var.file)
!     abort ();
    gcov_var.start = 0;
    gcov_var.offset = gcov_var.length = 0;
    gcov_var.overread = -1u;
--- 74,80 ----
    s_flock.l_pid = getpid ();
  #endif
    
!   GCOV_CHECK (!gcov_var.file);
    gcov_var.start = 0;
    gcov_var.offset = gcov_var.length = 0;
    gcov_var.overread = -1u;
Index: gcse.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gcse.c,v
retrieving revision 1.313
diff -c -3 -p -r1.313 gcse.c
*** gcse.c	1 Sep 2004 20:28:39 -0000	1.313
--- gcse.c	8 Sep 2004 12:59:04 -0000
*************** static int max_uid;
*** 389,395 ****
  
  /* Get the cuid of an insn.  */
  #ifdef ENABLE_CHECKING
! #define INSN_CUID(INSN) (INSN_UID (INSN) > max_uid ? (abort (), 0) : uid_cuid[INSN_UID (INSN)])
  #else
  #define INSN_CUID(INSN) (uid_cuid[INSN_UID (INSN)])
  #endif
--- 389,396 ----
  
  /* Get the cuid of an insn.  */
  #ifdef ENABLE_CHECKING
! #define INSN_CUID(INSN) \
!   (gcc_assert (INSN_UID (INSN) <= max_uid), uid_cuid[INSN_UID (INSN)])
  #else
  #define INSN_CUID(INSN) (uid_cuid[INSN_UID (INSN)])
  #endif
*************** insert_set_in_table (rtx x, rtx insn, st
*** 1644,1652 ****
    struct expr *cur_expr, *last_expr = NULL;
    struct occr *cur_occr, *last_occr = NULL;
  
!   if (GET_CODE (x) != SET
!       || ! REG_P (SET_DEST (x)))
!     abort ();
  
    hash = hash_set (REGNO (SET_DEST (x)), table->size);
  
--- 1645,1651 ----
    struct expr *cur_expr, *last_expr = NULL;
    struct occr *cur_occr, *last_occr = NULL;
  
!   gcc_assert (GET_CODE (x) == SET && REG_P (SET_DEST (x)));
  
    hash = hash_set (REGNO (SET_DEST (x)), table->size);
  
*************** find_avail_set (int regno, rtx insn)
*** 2796,2803 ****
        if (set == 0)
  	break;
  
!       if (GET_CODE (set->expr) != SET)
! 	abort ();
  
        src = SET_SRC (set->expr);
  
--- 2795,2801 ----
        if (set == 0)
  	break;
  
!       gcc_assert (GET_CODE (set->expr) == SET);
  
        src = SET_SRC (set->expr);
  
*************** cprop_insn (rtx insn, int alter_jumps)
*** 3013,3020 ****
  
        pat = set->expr;
        /* ??? We might be able to handle PARALLELs.  Later.  */
!       if (GET_CODE (pat) != SET)
! 	abort ();
  
        src = SET_SRC (pat);
  
--- 3011,3017 ----
  
        pat = set->expr;
        /* ??? We might be able to handle PARALLELs.  Later.  */
!       gcc_assert (GET_CODE (pat) == SET);
  
        src = SET_SRC (pat);
  
*************** do_local_cprop (rtx x, rtx insn, int alt
*** 3155,3162 ****
  	     or fix delete_trivially_dead_insns to preserve the setting insn,
  	     or make it delete the REG_EUAQL note, and fix up all passes that
  	     require the REG_EQUAL note there.  */
! 	  if (!adjust_libcall_notes (x, newcnst, insn, libcall_sp))
! 	    abort ();
  	  if (gcse_file != NULL)
  	    {
  	      fprintf (gcse_file, "LOCAL CONST-PROP: Replacing reg %d in ",
--- 3152,3162 ----
  	     or fix delete_trivially_dead_insns to preserve the setting insn,
  	     or make it delete the REG_EUAQL note, and fix up all passes that
  	     require the REG_EQUAL note there.  */
! 	  bool adjusted;
! 
! 	  adjusted = adjust_libcall_notes (x, newcnst, insn, libcall_sp);
! 	  gcc_assert (adjusted);
! 	  
  	  if (gcse_file != NULL)
  	    {
  	      fprintf (gcse_file, "LOCAL CONST-PROP: Replacing reg %d in ",
*************** local_cprop_pass (int alter_jumps)
*** 3245,3252 ****
  
  	  if (note)
  	    {
! 	      if (libcall_sp == libcall_stack)
! 		abort ();
  	      *--libcall_sp = XEXP (note, 0);
  	    }
  	  note = find_reg_note (insn, REG_RETVAL, NULL_RTX);
--- 3245,3251 ----
  
  	  if (note)
  	    {
! 	      gcc_assert (libcall_sp != libcall_stack);
  	      *--libcall_sp = XEXP (note, 0);
  	    }
  	  note = find_reg_note (insn, REG_RETVAL, NULL_RTX);
*************** find_bypass_set (int regno, int bb)
*** 3520,3527 ****
        if (set == 0)
  	break;
  
!       if (GET_CODE (set->expr) != SET)
! 	abort ();
  
        src = SET_SRC (set->expr);
        if (gcse_constant_p (src))
--- 3519,3525 ----
        if (set == 0)
  	break;
  
!       gcc_assert (GET_CODE (set->expr) == SET);
  
        src = SET_SRC (set->expr);
        if (gcse_constant_p (src))
*************** process_insert_insn (struct expr *expr)
*** 4004,4011 ****
    /* Otherwise, make a new insn to compute this expression and make sure the
       insn will be recognized (this also adds any needed CLOBBERs).  Copy the
       expression to make sure we don't have any sharing issues.  */
!   else if (insn_invalid_p (emit_insn (gen_rtx_SET (VOIDmode, reg, exp))))
!     abort ();
  
    pat = get_insns ();
    end_sequence ();
--- 4002,4014 ----
    /* Otherwise, make a new insn to compute this expression and make sure the
       insn will be recognized (this also adds any needed CLOBBERs).  Copy the
       expression to make sure we don't have any sharing issues.  */
!   else
!     {
!       rtx insn = emit_insn (gen_rtx_SET (VOIDmode, reg, exp));
! 
!       gcc_assert (!insn_invalid_p (insn));
!     }
!   
  
    pat = get_insns ();
    end_sequence ();
*************** insert_insn_end_bb (struct expr *expr, b
*** 4031,4038 ****
    rtx pat, pat_end;
  
    pat = process_insert_insn (expr);
!   if (pat == NULL_RTX || ! INSN_P (pat))
!     abort ();
  
    pat_end = pat;
    while (NEXT_INSN (pat_end) != NULL_RTX)
--- 4034,4040 ----
    rtx pat, pat_end;
  
    pat = process_insert_insn (expr);
!   gcc_assert (pat && INSN_P (pat));
  
    pat_end = pat;
    while (NEXT_INSN (pat_end) != NULL_RTX)
*************** insert_insn_end_bb (struct expr *expr, b
*** 4052,4061 ****
        /* It should always be the case that we can put these instructions
  	 anywhere in the basic block with performing PRE optimizations.
  	 Check this.  */
!       if (NONJUMP_INSN_P (insn) && pre
! 	  && !TEST_BIT (antloc[bb->index], expr->bitmap_index)
! 	  && !TEST_BIT (transp[bb->index], expr->bitmap_index))
! 	abort ();
  
        /* If this is a jump table, then we can't insert stuff here.  Since
  	 we know the previous real insn must be the tablejump, we insert
--- 4054,4062 ----
        /* It should always be the case that we can put these instructions
  	 anywhere in the basic block with performing PRE optimizations.
  	 Check this.  */
!       gcc_assert (!NONJUMP_INSN_P (insn) || pre
! 		  || TEST_BIT (antloc[bb->index], expr->bitmap_index)
! 		  || TEST_BIT (transp[bb->index], expr->bitmap_index));
  
        /* If this is a jump table, then we can't insert stuff here.  Since
  	 we know the previous real insn must be the tablejump, we insert
*************** insert_insn_end_bb (struct expr *expr, b
*** 4097,4106 ****
  	 anywhere in the basic block with performing PRE optimizations.
  	 Check this.  */
  
!       if (pre
! 	  && !TEST_BIT (antloc[bb->index], expr->bitmap_index)
! 	  && !TEST_BIT (transp[bb->index], expr->bitmap_index))
! 	abort ();
  
        /* Since different machines initialize their parameter registers
  	 in different orders, assume nothing.  Collect the set of all
--- 4098,4106 ----
  	 anywhere in the basic block with performing PRE optimizations.
  	 Check this.  */
  
!       gcc_assert (!pre
! 		  || TEST_BIT (antloc[bb->index], expr->bitmap_index)
! 		  || TEST_BIT (transp[bb->index], expr->bitmap_index));
  
        /* Since different machines initialize their parameter registers
  	 in different orders, assume nothing.  Collect the set of all
*************** pre_insert_copy_insn (struct expr *expr,
*** 4257,4266 ****
    int i;
  
    /* This block matches the logic in hash_scan_insn.  */
!   if (GET_CODE (pat) == SET)
!     set = pat;
!   else if (GET_CODE (pat) == PARALLEL)
      {
        /* Search through the parallel looking for the set whose
  	 source was the expression that we're interested in.  */
        set = NULL_RTX;
--- 4257,4269 ----
    int i;
  
    /* This block matches the logic in hash_scan_insn.  */
!   switch (GET_CODE (pat))
      {
+     case SET:
+       set = pat;
+       break;
+ 
+     case PARALLEL:
        /* Search through the parallel looking for the set whose
  	 source was the expression that we're interested in.  */
        set = NULL_RTX;
*************** pre_insert_copy_insn (struct expr *expr,
*** 4274,4282 ****
  	      break;
  	    }
  	}
      }
-   else
-     abort ();
  
    if (REG_P (SET_DEST (set)))
      {
--- 4277,4287 ----
  	      break;
  	    }
  	}
+       break;
+ 
+     default:
+       gcc_unreachable ();
      }
  
    if (REG_P (SET_DEST (set)))
      {
*************** hoist_code (void)
*** 4970,4984 ****
  		      while (BLOCK_FOR_INSN (occr->insn) != dominated && occr)
  			occr = occr->next;
  
! 		      /* Should never happen.  */
! 		      if (!occr)
! 			abort ();
! 
  		      insn = occr->insn;
- 
  		      set = single_set (insn);
! 		      if (! set)
! 			abort ();
  
  		      /* Create a pseudo-reg to store the result of reaching
  			 expressions into.  Get the mode for the new pseudo
--- 4975,4984 ----
  		      while (BLOCK_FOR_INSN (occr->insn) != dominated && occr)
  			occr = occr->next;
  
! 		      gcc_assert (occr);
  		      insn = occr->insn;
  		      set = single_set (insn);
! 		      gcc_assert (set);
  
  		      /* Create a pseudo-reg to store the result of reaching
  			 expressions into.  Get the mode for the new pseudo
*************** extract_mentioned_regs_helper (rtx x, rt
*** 5556,5562 ****
      case POST_DEC:
      case POST_INC:
        /* We do not run this function with arguments having side effects.  */
!       abort ();
  
      case PC:
      case CC0: /*FIXME*/
--- 5556,5562 ----
      case POST_DEC:
      case POST_INC:
        /* We do not run this function with arguments having side effects.  */
!       gcc_unreachable ();
  
      case PC:
      case CC0: /*FIXME*/
*************** compute_store_table (void)
*** 5830,5837 ****
  #ifdef ENABLE_CHECKING
        /* last_set_in should now be all-zero.  */
        for (regno = 0; regno < max_gcse_regno; regno++)
! 	if (last_set_in[regno] != 0)
! 	  abort ();
  #endif
  
        /* Clear temporary marks.  */
--- 5830,5836 ----
  #ifdef ENABLE_CHECKING
        /* last_set_in should now be all-zero.  */
        for (regno = 0; regno < max_gcse_regno; regno++)
! 	gcc_assert (!last_set_in[regno]);
  #endif
  
        /* Clear temporary marks.  */
*************** insert_store (struct ls_expr * expr, edg
*** 6204,6211 ****
      if (!(tmp->flags & EDGE_FAKE))
        {
  	int index = EDGE_INDEX (edge_list, tmp->src, tmp->dest);
! 	if (index == EDGE_INDEX_NO_EDGE)
! 	  abort ();
  	if (! TEST_BIT (pre_insert_map[index], expr->index))
  	  break;
        }
--- 6203,6210 ----
      if (!(tmp->flags & EDGE_FAKE))
        {
  	int index = EDGE_INDEX (edge_list, tmp->src, tmp->dest);
! 	
! 	gcc_assert (index != EDGE_INDEX_NO_EDGE);
  	if (! TEST_BIT (pre_insert_map[index], expr->index))
  	  break;
        }
Index: ggc-common.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ggc-common.c,v
retrieving revision 1.89
diff -c -3 -p -r1.89 ggc-common.c
*** ggc-common.c	2 Sep 2004 18:32:48 -0000	1.89
--- ggc-common.c	8 Sep 2004 12:59:05 -0000
*************** ggc_calloc (size_t s1, size_t s2)
*** 197,212 ****
  void *
  ggc_splay_alloc (int sz, void *nl)
  {
!   if (nl != NULL)
!     abort ();
    return ggc_alloc (sz);
  }
  
  void
  ggc_splay_dont_free (void * x ATTRIBUTE_UNUSED, void *nl)
  {
!   if (nl != NULL)
!     abort ();
  }
  
  /* Print statistics that are independent of the collector in use.  */
--- 197,210 ----
  void *
  ggc_splay_alloc (int sz, void *nl)
  {
!   gcc_assert (!nl);
    return ggc_alloc (sz);
  }
  
  void
  ggc_splay_dont_free (void * x ATTRIBUTE_UNUSED, void *nl)
  {
!   gcc_assert (!nl);
  }
  
  /* Print statistics that are independent of the collector in use.  */
*************** gt_pch_note_object (void *obj, void *not
*** 266,274 ****
  			      INSERT);
    if (*slot != NULL)
      {
!       if ((*slot)->note_ptr_fn != note_ptr_fn
! 	  || (*slot)->note_ptr_cookie != note_ptr_cookie)
! 	abort ();
        return 0;
      }
  
--- 264,271 ----
  			      INSERT);
    if (*slot != NULL)
      {
!       gcc_assert ((*slot)->note_ptr_fn == note_ptr_fn
! 		  && (*slot)->note_ptr_cookie == note_ptr_cookie);
        return 0;
      }
  
*************** gt_pch_note_reorder (void *obj, void *no
*** 295,303 ****
      return;
  
    data = htab_find_with_hash (saving_htab, obj, POINTER_HASH (obj));
!   if (data == NULL
!       || data->note_ptr_cookie != note_ptr_cookie)
!     abort ();
  
    data->reorder_fn = reorder_fn;
  }
--- 292,298 ----
      return;
  
    data = htab_find_with_hash (saving_htab, obj, POINTER_HASH (obj));
!   gcc_assert (data && data->note_ptr_cookie == note_ptr_cookie);
  
    data->reorder_fn = reorder_fn;
  }
*************** relocate_ptrs (void *ptr_p, void *state_
*** 376,383 ****
      return;
  
    result = htab_find_with_hash (saving_htab, *ptr, POINTER_HASH (*ptr));
!   if (result == NULL)
!     abort ();
    *ptr = result->new_addr;
  }
  
--- 371,377 ----
      return;
  
    result = htab_find_with_hash (saving_htab, *ptr, POINTER_HASH (*ptr));
!   gcc_assert (result);
    *ptr = result->new_addr;
  }
  
*************** ggc_record_overhead (size_t allocated, s
*** 873,880 ****
    if (!ptr_hash)
      ptr_hash = htab_create (10, hash_ptr, eq_ptr, NULL);
    slot = htab_find_slot_with_hash (ptr_hash, ptr, htab_hash_pointer (ptr), INSERT);
!   if (*slot)
!     abort ();
    *slot = p;
  
    loc->times++;
--- 867,873 ----
    if (!ptr_hash)
      ptr_hash = htab_create (10, hash_ptr, eq_ptr, NULL);
    slot = htab_find_slot_with_hash (ptr_hash, ptr, htab_hash_pointer (ptr), INSERT);
!   gcc_assert (!*slot);
    *slot = p;
  
    loc->times++;
Index: ggc-page.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ggc-page.c,v
retrieving revision 1.93
diff -c -3 -p -r1.93 ggc-page.c
*** ggc-page.c	2 Sep 2004 18:32:48 -0000	1.93
--- ggc-page.c	8 Sep 2004 12:59:08 -0000
*************** alloc_page (unsigned order)
*** 821,828 ****
  	      enda -= G.pagesize;
  	      tail_slop += G.pagesize;
  	    }
! 	  if (tail_slop < sizeof (page_group))
! 	    abort ();
  	  group = (page_group *)enda;
  	  tail_slop -= sizeof (page_group);
  	}
--- 821,827 ----
  	      enda -= G.pagesize;
  	      tail_slop += G.pagesize;
  	    }
! 	  gcc_assert (tail_slop >= sizeof (page_group));
  	  group = (page_group *)enda;
  	  tail_slop -= sizeof (page_group);
  	}
*************** free_page (page_entry *entry)
*** 930,951 ****
    if (G.by_depth_in_use > 1)
      {
        page_entry *top = G.by_depth[G.by_depth_in_use-1];
  
!       /* If they are at the same depth, put top element into freed
! 	 slot.  */
!       if (entry->context_depth == top->context_depth)
! 	{
! 	  int i = entry->index_by_depth;
! 	  G.by_depth[i] = top;
! 	  G.save_in_use[i] = G.save_in_use[G.by_depth_in_use-1];
! 	  top->index_by_depth = i;
! 	}
!       else
! 	{
! 	  /* We cannot free a page from a context deeper than the
! 	     current one.  */
! 	  abort ();
! 	}
      }
    --G.by_depth_in_use;
  
--- 929,944 ----
    if (G.by_depth_in_use > 1)
      {
        page_entry *top = G.by_depth[G.by_depth_in_use-1];
+       int i = entry->index_by_depth;
  
!       /* We cannot free a page from a context deeper than the current
! 	 one.  */
!       gcc_assert (entry->context_depth == top->context_depth);
!       
!       /* Put top element into freed slot.  */
!       G.by_depth[i] = top;
!       G.save_in_use[i] = G.save_in_use[G.by_depth_in_use-1];
!       top->index_by_depth = i;
      }
    --G.by_depth_in_use;
  
*************** ggc_set_mark (const void *p)
*** 1260,1267 ****
       wasn't allocated by the collector, we'll probably die.  */
    entry = lookup_page_table_entry (p);
  #ifdef ENABLE_CHECKING
!   if (entry == NULL)
!     abort ();
  #endif
  
    /* Calculate the index of the object on the page; this is its bit
--- 1253,1259 ----
       wasn't allocated by the collector, we'll probably die.  */
    entry = lookup_page_table_entry (p);
  #ifdef ENABLE_CHECKING
!   gcc_assert (entry);
  #endif
  
    /* Calculate the index of the object on the page; this is its bit
*************** ggc_marked_p (const void *p)
*** 1299,1306 ****
       wasn't allocated by the collector, we'll probably die.  */
    entry = lookup_page_table_entry (p);
  #ifdef ENABLE_CHECKING
!   if (entry == NULL)
!     abort ();
  #endif
  
    /* Calculate the index of the object on the page; this is its bit
--- 1291,1297 ----
       wasn't allocated by the collector, we'll probably die.  */
    entry = lookup_page_table_entry (p);
  #ifdef ENABLE_CHECKING
!   gcc_assert (entry);
  #endif
  
    /* Calculate the index of the object on the page; this is its bit
*************** init_ggc (void)
*** 1474,1481 ****
  	   can't get something useful, give up.  */
  
  	p = alloc_anon (NULL, G.pagesize);
! 	if ((size_t)p & (G.pagesize - 1))
! 	  abort ();
        }
  
      /* We have a good page, might as well hold onto it...  */
--- 1465,1471 ----
  	   can't get something useful, give up.  */
  
  	p = alloc_anon (NULL, G.pagesize);
! 	gcc_assert (!((size_t)p & (G.pagesize - 1)));
        }
  
      /* We have a good page, might as well hold onto it...  */
*************** ggc_push_context (void)
*** 1556,1563 ****
    ++G.context_depth;
  
    /* Die on wrap.  */
!   if (G.context_depth >= HOST_BITS_PER_LONG)
!     abort ();
  }
  
  /* Merge the SAVE_IN_USE_P and IN_USE_P arrays in P so that IN_USE_P
--- 1546,1552 ----
    ++G.context_depth;
  
    /* Die on wrap.  */
!   gcc_assert (G.context_depth < HOST_BITS_PER_LONG);
  }
  
  /* Merge the SAVE_IN_USE_P and IN_USE_P arrays in P so that IN_USE_P
*************** ggc_recalculate_in_use_p (page_entry *p)
*** 1593,1600 ****
  	p->num_free_objects -= (j & 1);
      }
  
!   if (p->num_free_objects >= num_objects)
!     abort ();
  }
  
  /* Decrement the `GC context'.  All objects allocated since the
--- 1582,1588 ----
  	p->num_free_objects -= (j & 1);
      }
  
!   gcc_assert (p->num_free_objects < num_objects);
  }
  
  /* Decrement the `GC context'.  All objects allocated since the
*************** ggc_pop_context (void)
*** 1641,1650 ****
  
  	  /* Check that all of the pages really are at the depth that
  	     we expect.  */
! 	  if (p->context_depth != depth)
! 	    abort ();
! 	  if (p->index_by_depth != i)
! 	    abort ();
  #endif
  
  	  prefetch (&save_in_use_p_i (i+8));
--- 1629,1636 ----
  
  	  /* Check that all of the pages really are at the depth that
  	     we expect.  */
! 	  gcc_assert (p->context_depth == depth);
! 	  gcc_assert (p->index_by_depth == i);
  #endif
  
  	  prefetch (&save_in_use_p_i (i+8));
*************** ggc_pop_context (void)
*** 1668,1677 ****
        /* Check that all of the pages really are at the depth we
  	 expect.  */
  #ifdef ENABLE_CHECKING
!       if (p->context_depth <= depth)
! 	abort ();
!       if (p->index_by_depth != i)
! 	abort ();
  #endif
        p->context_depth = depth;
      }
--- 1654,1661 ----
        /* Check that all of the pages really are at the depth we
  	 expect.  */
  #ifdef ENABLE_CHECKING
!       gcc_assert (p->context_depth > depth);
!       gcc_assert (p->index_by_depth == i);
  #endif
        p->context_depth = depth;
      }
*************** ggc_pop_context (void)
*** 1684,1695 ****
        page_entry *p;
  
        for (p = G.pages[order]; p != NULL; p = p->next)
! 	{
! 	  if (p->context_depth > depth)
! 	    abort ();
! 	  else if (p->context_depth == depth && save_in_use_p (p))
! 	    abort ();
! 	}
      }
  #endif
  }
--- 1668,1675 ----
        page_entry *p;
  
        for (p = G.pages[order]; p != NULL; p = p->next)
! 	gcc_assert (p->context_depth < depth ||
! 		    (p->context_depth == depth && !save_in_use_p (p)));
      }
  #endif
  }
*************** clear_marks (void)
*** 1712,1719 ****
  
  #ifdef ENABLE_CHECKING
  	  /* The data should be page-aligned.  */
! 	  if ((size_t) p->page & (G.pagesize - 1))
! 	    abort ();
  #endif
  
  	  /* Pages that aren't in the topmost context are not collected;
--- 1692,1698 ----
  
  #ifdef ENABLE_CHECKING
  	  /* The data should be page-aligned.  */
! 	  gcc_assert (!((size_t) p->page & (G.pagesize - 1)));
  #endif
  
  	  /* Pages that aren't in the topmost context are not collected;
*************** validate_free_objects (void)
*** 1944,1951 ****
  
        /* Make certain it isn't visible from any root.  Notice that we
  	 do this check before sweep_pages merges save_in_use_p.  */
!       if (pe->in_use_p[word] & (1UL << bit))
! 	abort ();
  
        /* If the object comes from an outer context, then retain the
  	 free_object entry, so that we can verify that the address
--- 1923,1929 ----
  
        /* Make certain it isn't visible from any root.  Notice that we
  	 do this check before sweep_pages merges save_in_use_p.  */
!       gcc_assert (!(pe->in_use_p[word] & (1UL << bit)));
  
        /* If the object comes from an outer context, then retain the
  	 free_object entry, so that we can verify that the address
*************** ggc_pch_read (FILE *f, void *addr)
*** 2341,2348 ****
    /* No object read from a PCH file should ever be freed.  So, set the
       context depth to 1, and set the depth of all the currently-allocated
       pages to be 1 too.  PCH pages will have depth 0.  */
!   if (G.context_depth != 0)
!     abort ();
    G.context_depth = 1;
    for (i = 0; i < NUM_ORDERS; i++)
      {
--- 2319,2325 ----
    /* No object read from a PCH file should ever be freed.  So, set the
       context depth to 1, and set the depth of all the currently-allocated
       pages to be 1 too.  PCH pages will have depth 0.  */
!   gcc_assert (!G.context_depth);
    G.context_depth = 1;
    for (i = 0; i < NUM_ORDERS; i++)
      {
Index: ggc-zone.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ggc-zone.c,v
retrieving revision 2.19
diff -c -3 -p -r2.19 ggc-zone.c
*** ggc-zone.c	24 Aug 2004 00:46:11 -0000	2.19
--- ggc-zone.c	8 Sep 2004 12:59:09 -0000
*************** ggc_allocated_p (const void *p)
*** 368,375 ****
    struct alloc_chunk *chunk;
    chunk = (struct alloc_chunk *) ((char *)p - CHUNK_OVERHEAD);
  #ifdef COOKIE_CHECKING
!   if (chunk->magic != CHUNK_MAGIC)
!     abort ();
  #endif
    if (chunk->type == 1)
      return true;  
--- 368,374 ----
    struct alloc_chunk *chunk;
    chunk = (struct alloc_chunk *) ((char *)p - CHUNK_OVERHEAD);
  #ifdef COOKIE_CHECKING
!   gcc_assert (chunk->magic == CHUNK_MAGIC);
  #endif
    if (chunk->type == 1)
      return true;  
*************** free_chunk (struct alloc_chunk *chunk, s
*** 578,590 ****
    size_t bin = 0;
  
    bin = SIZE_BIN_DOWN (size);
!   if (bin == 0)
!     abort ();
    if (bin > NUM_FREE_BINS)
      bin = 0;
  #ifdef COOKIE_CHECKING
!   if (chunk->magic != CHUNK_MAGIC && chunk->magic != DEADCHUNK_MAGIC)
!     abort ();
    chunk->magic = DEADCHUNK_MAGIC;
  #endif
    chunk->u.next_free = zone->free_chunks[bin];
--- 577,587 ----
    size_t bin = 0;
  
    bin = SIZE_BIN_DOWN (size);
!   gcc_assert (bin);
    if (bin > NUM_FREE_BINS)
      bin = 0;
  #ifdef COOKIE_CHECKING
!   gcc_assert (chunk->magic == CHUNK_MAGIC || chunk->magic == DEADCHUNK_MAGIC);
    chunk->magic = DEADCHUNK_MAGIC;
  #endif
    chunk->u.next_free = zone->free_chunks[bin];
*************** ggc_set_mark (const void *p)
*** 830,837 ****
  
    chunk = (struct alloc_chunk *) ((char *)p - CHUNK_OVERHEAD);
  #ifdef COOKIE_CHECKING
!   if (chunk->magic != CHUNK_MAGIC)
!     abort ();
  #endif
    if (chunk->mark)
      return 1;
--- 827,833 ----
  
    chunk = (struct alloc_chunk *) ((char *)p - CHUNK_OVERHEAD);
  #ifdef COOKIE_CHECKING
!   gcc_assert (chunk->magic == CHUNK_MAGIC);
  #endif
    if (chunk->mark)
      return 1;
*************** ggc_marked_p (const void *p)
*** 854,861 ****
  
    chunk = (struct alloc_chunk *) ((char *)p - CHUNK_OVERHEAD);
  #ifdef COOKIE_CHECKING
!   if (chunk->magic != CHUNK_MAGIC)
!     abort ();
  #endif
    return chunk->mark;
  }
--- 850,856 ----
  
    chunk = (struct alloc_chunk *) ((char *)p - CHUNK_OVERHEAD);
  #ifdef COOKIE_CHECKING
!   gcc_assert (chunk->magic == CHUNK_MAGIC);
  #endif
    return chunk->mark;
  }
*************** ggc_get_size (const void *p)
*** 869,876 ****
  
    chunk = (struct alloc_chunk *) ((char *)p - CHUNK_OVERHEAD);
  #ifdef COOKIE_CHECKING
!   if (chunk->magic != CHUNK_MAGIC)
!     abort ();
  #endif
    if (chunk->large)
      return chunk->size * 1024;
--- 864,870 ----
  
    chunk = (struct alloc_chunk *) ((char *)p - CHUNK_OVERHEAD);
  #ifdef COOKIE_CHECKING
!   gcc_assert (chunk->magic == CHUNK_MAGIC);
  #endif
    if (chunk->large)
      return chunk->size * 1024;
*************** init_ggc (void)
*** 895,902 ****
    G.lg_pagesize = exact_log2 (G.pagesize);
  #ifdef HAVE_MMAP_DEV_ZERO
    G.dev_zero_fd = open ("/dev/zero", O_RDONLY);
!   if (G.dev_zero_fd == -1)
!     abort ();
  #endif
  
  #if 0
--- 889,895 ----
    G.lg_pagesize = exact_log2 (G.pagesize);
  #ifdef HAVE_MMAP_DEV_ZERO
    G.dev_zero_fd = open ("/dev/zero", O_RDONLY);
!   gcc_assert (G.dev_zero_fd != -1);
  #endif
  
  #if 0
*************** init_ggc (void)
*** 920,927 ****
  	   can't get something useful, give up.  */
  
  	p = alloc_anon (NULL, G.pagesize, &main_zone);
! 	if ((size_t)p & (G.pagesize - 1))
! 	  abort ();
        }
  
      /* We have a good page, might as well hold onto it...  */
--- 913,919 ----
  	   can't get something useful, give up.  */
  
  	p = alloc_anon (NULL, G.pagesize, &main_zone);
! 	gcc_assert (!((size_t)p & (G.pagesize - 1)));
        }
  
      /* We have a good page, might as well hold onto it...  */
*************** destroy_ggc_zone (struct alloc_zone * de
*** 957,964 ****
  
  #ifdef ENABLE_CHECKING
    /* We should have found the zone in the list.  Anything else is fatal.  */
!   if (!z)
!     abort ();
  #endif
  
    /* z is dead, baby. z is dead.  */
--- 949,955 ----
  
  #ifdef ENABLE_CHECKING
    /* We should have found the zone in the list.  Anything else is fatal.  */
!   gcc_assert (z);
  #endif
  
    /* z is dead, baby. z is dead.  */
*************** ggc_push_context (void)
*** 975,982 ****
    for (zone = G.zones; zone; zone = zone->next_zone)
      ++(zone->context_depth);
    /* Die on wrap.  */
!   if (main_zone.context_depth >= HOST_BITS_PER_LONG)
!     abort ();
  }
  
  /* Decrement the `GC context'.  All objects allocated since the
--- 966,972 ----
    for (zone = G.zones; zone; zone = zone->next_zone)
      ++(zone->context_depth);
    /* Die on wrap.  */
!   gcc_assert (main_zone.context_depth < HOST_BITS_PER_LONG);
  }
  
  /* Decrement the `GC context'.  All objects allocated since the
*************** check_cookies (void)
*** 1204,1211 ****
  	      struct alloc_chunk *end = (struct alloc_chunk *)(p->page + G.pagesize);
  	      do
  		{
! 		  if (chunk->magic != CHUNK_MAGIC && chunk->magic != DEADCHUNK_MAGIC)
! 		    abort ();
  		  chunk = (struct alloc_chunk *)(chunk->u.data + chunk->size);
  		}
  	      while (chunk < end);
--- 1194,1201 ----
  	      struct alloc_chunk *end = (struct alloc_chunk *)(p->page + G.pagesize);
  	      do
  		{
! 		  gcc_assert (chunk->magic == CHUNK_MAGIC
! 			      || chunk->magic == DEADCHUNK_MAGIC);
  		  chunk = (struct alloc_chunk *)(chunk->u.data + chunk->size);
  		}
  	      while (chunk < end);
*************** ggc_collect (void)
*** 1334,1341 ****
  	  printf ("Zone `%s' is dead and will be freed.\n", dead_zone->name);
  
  	  /* The zone must be empty.  */
! 	  if (dead_zone->allocated != 0)
! 	    abort ();
  
  	  /* Unchain the dead zone, release all its pages and free it.  */
  	  zone->next_zone = zone->next_zone->next_zone;
--- 1324,1330 ----
  	  printf ("Zone `%s' is dead and will be freed.\n", dead_zone->name);
  
  	  /* The zone must be empty.  */
! 	  gcc_assert (!dead_zone->allocated);
  
  	  /* Unchain the dead zone, release all its pages and free it.  */
  	  zone->next_zone = zone->next_zone->next_zone;
*************** ggc_print_statistics (void)
*** 1415,1424 ****
  	      in_use += p->bytes - CHUNK_OVERHEAD;
  	      chunk = (struct alloc_chunk *) p->page;
  	      overhead += CHUNK_OVERHEAD;
! 	      if (!chunk->type)
! 		abort ();
! 	      if (chunk->mark)
! 		abort ();
  	      continue;
  	    }
  
--- 1404,1410 ----
  	      in_use += p->bytes - CHUNK_OVERHEAD;
  	      chunk = (struct alloc_chunk *) p->page;
  	      overhead += CHUNK_OVERHEAD;
! 	      gcc_assert (chunk->type && !chunk->mark);
  	      continue;
  	    }
  
*************** ggc_print_statistics (void)
*** 1429,1436 ****
  	      overhead += CHUNK_OVERHEAD;
  	      if (chunk->type)
  		in_use += chunk->size;
! 	      if (chunk->mark)
! 		abort ();
  	    }
  	}
        fprintf (stderr, "%20s %10lu%c %10lu%c %10lu%c\n",
--- 1415,1421 ----
  	      overhead += CHUNK_OVERHEAD;
  	      if (chunk->type)
  		in_use += chunk->size;
! 	      gcc_assert (!chunk->mark);
  	    }
  	}
        fprintf (stderr, "%20s %10lu%c %10lu%c %10lu%c\n",
*************** ggc_print_statistics (void)
*** 1439,1446 ****
  	       SCALE (in_use), LABEL (in_use),
  	       SCALE (overhead), LABEL (overhead));
  
!       if (in_use != zone->allocated)
! 	abort ();
  
        total_overhead += overhead;
        total_allocated += zone->allocated;
--- 1424,1430 ----
  	       SCALE (in_use), LABEL (in_use),
  	       SCALE (overhead), LABEL (overhead));
  
!       gcc_assert (in_use == zone->allocated);
  
        total_overhead += overhead;
        total_allocated += zone->allocated;
Index: gimple-low.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gimple-low.c,v
retrieving revision 2.13
diff -c -3 -p -r2.13 gimple-low.c
*** gimple-low.c	6 Sep 2004 10:07:46 -0000	2.13
--- gimple-low.c	8 Sep 2004 12:59:10 -0000
*************** lower_function_body (void)
*** 69,76 ****
    tree_stmt_iterator i;
    tree t, x;
  
!   if (TREE_CODE (bind) != BIND_EXPR)
!     abort ();
  
    data.block = DECL_INITIAL (current_function_decl);
    BLOCK_SUBBLOCKS (data.block) = NULL_TREE;
--- 69,75 ----
    tree_stmt_iterator i;
    tree t, x;
  
!   gcc_assert (TREE_CODE (bind) == BIND_EXPR);
  
    data.block = DECL_INITIAL (current_function_decl);
    BLOCK_SUBBLOCKS (data.block) = NULL_TREE;
*************** lower_function_body (void)
*** 117,124 ****
        tsi_link_after (&i, x, TSI_CONTINUE_LINKING);
      }
  
!   if (data.block != DECL_INITIAL (current_function_decl))
!     abort ();
    BLOCK_SUBBLOCKS (data.block)
      = blocks_nreverse (BLOCK_SUBBLOCKS (data.block));
  
--- 116,122 ----
        tsi_link_after (&i, x, TSI_CONTINUE_LINKING);
      }
  
!   gcc_assert (data.block == DECL_INITIAL (current_function_decl));
    BLOCK_SUBBLOCKS (data.block)
      = blocks_nreverse (BLOCK_SUBBLOCKS (data.block));
  
*************** lower_stmt (tree_stmt_iterator *tsi, str
*** 200,208 ****
        break;
  
      default:
        print_node_brief (stderr, "", stmt, 0);
      case COMPOUND_EXPR:
!       abort ();
      }
  
    tsi_next (tsi);
--- 198,209 ----
        break;
  
      default:
+ #ifdef ENABLE_CHECKING
        print_node_brief (stderr, "", stmt, 0);
+       internal_error ("unexpected node");
+ #endif
      case COMPOUND_EXPR:
!       gcc_unreachable ();
      }
  
    tsi_next (tsi);
*************** lower_bind_expr (tree_stmt_iterator *tsi
*** 224,238 ****
  	  /* The outermost block of the original function may not be the
  	     outermost statement chain of the gimplified function.  So we
  	     may see the outermost block just inside the function.  */
! 	  if (new_block != DECL_INITIAL (current_function_decl))
! 	    abort ();
  	  new_block = NULL;
  	}
        else
  	{
  	  /* We do not expect to handle duplicate blocks.  */
! 	  if (TREE_ASM_WRITTEN (new_block))
! 	    abort ();
  	  TREE_ASM_WRITTEN (new_block) = 1;
  
  	  /* Block tree may get clobbered by inlining.  Normally this would
--- 225,237 ----
  	  /* The outermost block of the original function may not be the
  	     outermost statement chain of the gimplified function.  So we
  	     may see the outermost block just inside the function.  */
! 	  gcc_assert (new_block == DECL_INITIAL (current_function_decl));
  	  new_block = NULL;
  	}
        else
  	{
  	  /* We do not expect to handle duplicate blocks.  */
! 	  gcc_assert (!TREE_ASM_WRITTEN (new_block));
  	  TREE_ASM_WRITTEN (new_block) = 1;
  
  	  /* Block tree may get clobbered by inlining.  Normally this would
*************** lower_bind_expr (tree_stmt_iterator *tsi
*** 252,259 ****
  
    if (new_block)
      {
!       if (data->block != new_block)
! 	abort ();
  
        BLOCK_SUBBLOCKS (new_block)
  	= blocks_nreverse (BLOCK_SUBBLOCKS (new_block));
--- 251,257 ----
  
    if (new_block)
      {
!       gcc_assert (data->block == new_block);
  
        BLOCK_SUBBLOCKS (new_block)
  	= blocks_nreverse (BLOCK_SUBBLOCKS (new_block));
Index: gimplify.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gimplify.c,v
retrieving revision 2.74
diff -c -3 -p -r2.74 gimplify.c
*** gimplify.c	5 Sep 2004 16:04:59 -0000	2.74
--- gimplify.c	8 Sep 2004 12:59:14 -0000
*************** gimple_tree_eq (const void *p1, const vo
*** 103,110 ****
  
    /* Only allow them to compare equal if they also hash equal; otherwise
       results are nondeterminate, and we fail bootstrap comparison.  */
!   if (gimple_tree_hash (p1) != gimple_tree_hash (p2))
!     abort ();
  
    return 1;
  }
--- 103,109 ----
  
    /* Only allow them to compare equal if they also hash equal; otherwise
       results are nondeterminate, and we fail bootstrap comparison.  */
!   gcc_assert (gimple_tree_hash (p1) == gimple_tree_hash (p2));
  
    return 1;
  }
*************** gimple_tree_eq (const void *p1, const vo
*** 114,121 ****
  void
  push_gimplify_context (void)
  {
!   if (gimplify_ctxp)
!     abort ();
    gimplify_ctxp
      = (struct gimplify_ctx *) xcalloc (1, sizeof (struct gimplify_ctx));
    if (optimize)
--- 113,119 ----
  void
  push_gimplify_context (void)
  {
!   gcc_assert (!gimplify_ctxp);
    gimplify_ctxp
      = (struct gimplify_ctx *) xcalloc (1, sizeof (struct gimplify_ctx));
    if (optimize)
*************** pop_gimplify_context (tree body)
*** 134,141 ****
  {
    tree t;
  
!   if (!gimplify_ctxp || gimplify_ctxp->current_bind_expr)
!     abort ();
  
    for (t = gimplify_ctxp->temps; t ; t = TREE_CHAIN (t))
      DECL_GIMPLE_FORMAL_TEMP_P (t) = 0;
--- 132,138 ----
  {
    tree t;
  
!   gcc_assert (gimplify_ctxp && !gimplify_ctxp->current_bind_expr);
  
    for (t = gimplify_ctxp->temps; t ; t = TREE_CHAIN (t))
      DECL_GIMPLE_FORMAL_TEMP_P (t) = 0;
*************** gimple_pop_condition (tree *pre_p)
*** 202,214 ****
  {
    int conds = --(gimplify_ctxp->conditions);
  
    if (conds == 0)
      {
        append_to_statement_list (gimplify_ctxp->conditional_cleanups, pre_p);
        gimplify_ctxp->conditional_cleanups = NULL_TREE;
      }
-   else if (conds < 0)
-     abort ();
  }
  
  /* A subroutine of append_to_statement_list{,_force}.  */
--- 199,210 ----
  {
    int conds = --(gimplify_ctxp->conditions);
  
+   gcc_assert (conds >= 0);
    if (conds == 0)
      {
        append_to_statement_list (gimplify_ctxp->conditional_cleanups, pre_p);
        gimplify_ctxp->conditional_cleanups = NULL_TREE;
      }
  }
  
  /* A subroutine of append_to_statement_list{,_force}.  */
*************** create_tmp_var (tree type, const char *p
*** 360,369 ****
  #if defined ENABLE_CHECKING
    /* We don't allow types that are addressable (meaning we can't make copies),
       incomplete, or of variable size.  */
!   if (TREE_ADDRESSABLE (type)
!       || !COMPLETE_TYPE_P (type)
!       || TREE_CODE (TYPE_SIZE_UNIT (type)) != INTEGER_CST)
!     abort ();
  #endif
  
    tmp_var = create_tmp_var_raw (type, prefix);
--- 356,364 ----
  #if defined ENABLE_CHECKING
    /* We don't allow types that are addressable (meaning we can't make copies),
       incomplete, or of variable size.  */
!   gcc_assert (!TREE_ADDRESSABLE (type)
! 	      && COMPLETE_TYPE_P (type)
! 	      && TREE_CODE (TYPE_SIZE_UNIT (type)) == INTEGER_CST);
  #endif
  
    tmp_var = create_tmp_var_raw (type, prefix);
*************** declare_tmp_vars (tree vars, tree scope)
*** 517,524 ****
        while (TREE_CODE (scope) == COMPOUND_EXPR)
  	scope = TREE_OPERAND (scope, 0);
  
!       if (TREE_CODE (scope) != BIND_EXPR)
! 	abort ();
  
        temps = nreverse (last);
        TREE_CHAIN (last) = BIND_EXPR_VARS (scope);
--- 512,518 ----
        while (TREE_CODE (scope) == COMPOUND_EXPR)
  	scope = TREE_OPERAND (scope, 0);
  
!       gcc_assert (TREE_CODE (scope) == BIND_EXPR);
  
        temps = nreverse (last);
        TREE_CHAIN (last) = BIND_EXPR_VARS (scope);
*************** declare_tmp_vars (tree vars, tree scope)
*** 529,536 ****
  void
  gimple_add_tmp_var (tree tmp)
  {
!   if (TREE_CHAIN (tmp) || DECL_SEEN_IN_BIND_EXPR_P (tmp))
!     abort ();
  
    DECL_CONTEXT (tmp) = current_function_decl;
    DECL_SEEN_IN_BIND_EXPR_P (tmp) = 1;
--- 523,529 ----
  void
  gimple_add_tmp_var (tree tmp)
  {
!   gcc_assert (!TREE_CHAIN (tmp) && !DECL_SEEN_IN_BIND_EXPR_P (tmp));
  
    DECL_CONTEXT (tmp) = current_function_decl;
    DECL_SEEN_IN_BIND_EXPR_P (tmp) = 1;
*************** annotate_all_with_locus (tree *stmt_p, l
*** 588,596 ****
  #ifdef ENABLE_CHECKING
  	  /* Assuming we've already been gimplified, we shouldn't
  	     see nested chaining constructs anymore.  */
! 	  if (TREE_CODE (t) == STATEMENT_LIST
! 	      || TREE_CODE (t) == COMPOUND_EXPR)
! 	    abort ();
  #endif
  
        annotate_one_with_locus (t, locus);
--- 581,588 ----
  #ifdef ENABLE_CHECKING
  	  /* Assuming we've already been gimplified, we shouldn't
  	     see nested chaining constructs anymore.  */
! 	  gcc_assert (TREE_CODE (t) != STATEMENT_LIST
! 		      && TREE_CODE (t) != COMPOUND_EXPR);
  #endif
  
        annotate_one_with_locus (t, locus);
*************** mostly_copy_tree_r (tree *tp, int *walk_
*** 616,625 ****
  	 uses.  So just avert our eyes and cross our fingers.  Silly Java.  */
        || code == BLOCK)
      *walk_subtrees = 0;
-   else if (code == BIND_EXPR)
-     abort ();
    else
!     copy_tree_r (tp, walk_subtrees, data);
  
    return NULL_TREE;
  }
--- 608,618 ----
  	 uses.  So just avert our eyes and cross our fingers.  Silly Java.  */
        || code == BLOCK)
      *walk_subtrees = 0;
    else
!     {
!       gcc_assert (code != BIND_EXPR);
!       copy_tree_r (tp, walk_subtrees, data);
!     }
  
    return NULL_TREE;
  }
*************** gimplify_return_expr (tree stmt, tree *p
*** 925,934 ****
  	/* See through a return by reference.  */
  	result_decl = TREE_OPERAND (result_decl, 0);
  #ifdef ENABLE_CHECKING
!       if ((TREE_CODE (ret_expr) != MODIFY_EXPR
! 	   && TREE_CODE (ret_expr) != INIT_EXPR)
! 	  || TREE_CODE (result_decl) != RESULT_DECL)
! 	abort ();
  #endif
      }
  
--- 918,926 ----
  	/* See through a return by reference.  */
  	result_decl = TREE_OPERAND (result_decl, 0);
  #ifdef ENABLE_CHECKING
!       gcc_assert ((TREE_CODE (ret_expr) == MODIFY_EXPR
! 		   || TREE_CODE (ret_expr) == INIT_EXPR)
! 		  && TREE_CODE (result_decl) == RESULT_DECL);
  #endif
      }
  
*************** gimplify_switch_expr (tree *expr_p, tree
*** 1150,1157 ****
  
        /* If someone can be bothered to fill in the labels, they can
  	 be bothered to null out the body too.  */
!       if (SWITCH_LABELS (switch_expr))
! 	abort ();
  
        saved_labels = gimplify_ctxp->case_labels;
        VARRAY_TREE_INIT (gimplify_ctxp->case_labels, 8, "case_labels");
--- 1142,1148 ----
  
        /* If someone can be bothered to fill in the labels, they can
  	 be bothered to null out the body too.  */
!       gcc_assert (!SWITCH_LABELS (switch_expr));
  
        saved_labels = gimplify_ctxp->case_labels;
        VARRAY_TREE_INIT (gimplify_ctxp->case_labels, 8, "case_labels");
*************** gimplify_switch_expr (tree *expr_p, tree
*** 1201,1208 ****
  
        SWITCH_BODY (switch_expr) = NULL;
      }
!   else if (!SWITCH_LABELS (switch_expr))
!     abort ();
  
    return ret;
  }
--- 1192,1199 ----
  
        SWITCH_BODY (switch_expr) = NULL;
      }
!   else
!     gcc_assert (SWITCH_LABELS (switch_expr));
  
    return ret;
  }
*************** static enum gimplify_status
*** 1211,1220 ****
  gimplify_case_label_expr (tree *expr_p)
  {
    tree expr = *expr_p;
!   if (gimplify_ctxp->case_labels)
!     VARRAY_PUSH_TREE (gimplify_ctxp->case_labels, expr);
!   else
!     abort ();
    *expr_p = build (LABEL_EXPR, void_type_node, CASE_LABEL (expr));
    return GS_ALL_DONE;
  }
--- 1202,1210 ----
  gimplify_case_label_expr (tree *expr_p)
  {
    tree expr = *expr_p;
! 
!   gcc_assert (gimplify_ctxp->case_labels);
!   VARRAY_PUSH_TREE (gimplify_ctxp->case_labels, expr);
    *expr_p = build (LABEL_EXPR, void_type_node, CASE_LABEL (expr));
    return GS_ALL_DONE;
  }
*************** gimplify_exit_block_expr (tree *expr_p)
*** 1249,1256 ****
    /* First operand must be a LABELED_BLOCK_EXPR, which should
       already be lowered (or partially lowered) when we get here.  */
  #if defined ENABLE_CHECKING
!   if (TREE_CODE (labeled_block) != LABELED_BLOCK_EXPR)
!     abort ();
  #endif
  
    label = LABELED_BLOCK_LABEL (labeled_block);
--- 1239,1245 ----
    /* First operand must be a LABELED_BLOCK_EXPR, which should
       already be lowered (or partially lowered) when we get here.  */
  #if defined ENABLE_CHECKING
!   gcc_assert (TREE_CODE (labeled_block) == LABELED_BLOCK_EXPR);
  #endif
  
    label = LABELED_BLOCK_LABEL (labeled_block);
*************** canonicalize_component_ref (tree *expr_p
*** 1325,1332 ****
    tree expr = *expr_p;
    tree type;
  
!   if (TREE_CODE (expr) != COMPONENT_REF)
!     abort ();
  
    if (INTEGRAL_TYPE_P (TREE_TYPE (expr)))
      type = TREE_TYPE (get_unwidened (expr, NULL_TREE));
--- 1314,1320 ----
    tree expr = *expr_p;
    tree type;
  
!   gcc_assert (TREE_CODE (expr) == COMPONENT_REF);
  
    if (INTEGRAL_TYPE_P (TREE_TYPE (expr)))
      type = TREE_TYPE (get_unwidened (expr, NULL_TREE));
*************** gimplify_compound_lval (tree *expr_p, tr
*** 1486,1493 ****
      VARRAY_PUSH_GENERIC_PTR_NOGC (stack, *p);
  
  #if defined ENABLE_CHECKING
!   if (VARRAY_ACTIVE_SIZE (stack) == 0)
!     abort ();
  #endif
  
    /* Now STACK is a stack of pointers to all the refs we've walked through
--- 1474,1480 ----
      VARRAY_PUSH_GENERIC_PTR_NOGC (stack, *p);
  
  #if defined ENABLE_CHECKING
!   gcc_assert (VARRAY_ACTIVE_SIZE (stack));
  #endif
  
    /* Now STACK is a stack of pointers to all the refs we've walked through
*************** gimplify_self_mod_expr (tree *expr_p, tr
*** 1652,1662 ****
    code = TREE_CODE (*expr_p);
  
  #if defined ENABLE_CHECKING
!   if (code != POSTINCREMENT_EXPR
!       && code != POSTDECREMENT_EXPR
!       && code != PREINCREMENT_EXPR
!       && code != PREDECREMENT_EXPR)
!     abort ();
  #endif
  
    /* Prefix or postfix?  */
--- 1639,1646 ----
    code = TREE_CODE (*expr_p);
  
  #if defined ENABLE_CHECKING
!   gcc_assert (code == POSTINCREMENT_EXPR || code == POSTDECREMENT_EXPR
! 	      || code == PREINCREMENT_EXPR || code == PREDECREMENT_EXPR);
  #endif
  
    /* Prefix or postfix?  */
*************** gimplify_call_expr (tree *expr_p, tree *
*** 1773,1780 ****
    enum gimplify_status ret;
  
  #if defined ENABLE_CHECKING
!   if (TREE_CODE (*expr_p) != CALL_EXPR)
!     abort ();
  #endif
  
    /* For reliable diagnostics during inlining, it is necessary that 
--- 1757,1763 ----
    enum gimplify_status ret;
  
  #if defined ENABLE_CHECKING
!   gcc_assert (TREE_CODE (*expr_p) == CALL_EXPR);
  #endif
  
    /* For reliable diagnostics during inlining, it is necessary that 
*************** gimplify_init_ctor_eval (tree object, tr
*** 2449,2459 ****
  	{
  	  /* ??? Here's to hoping the front end fills in all of the indicies,
  	     so we don't have to figure out what's missing ourselves.  */
! 	  if (!purpose)
! 	    abort ();
  	  /* ??? Need to handle this.  */
! 	  if (TREE_CODE (purpose) == RANGE_EXPR)
! 	    abort ();
  
  	  cref = build (ARRAY_REF, array_elt_type, unshare_expr (object),
  			purpose, NULL_TREE, NULL_TREE);
--- 2432,2440 ----
  	{
  	  /* ??? Here's to hoping the front end fills in all of the indicies,
  	     so we don't have to figure out what's missing ourselves.  */
! 	  gcc_assert (purpose);
  	  /* ??? Need to handle this.  */
! 	  gcc_assert (TREE_CODE (purpose) != RANGE_EXPR);
  
  	  cref = build (ARRAY_REF, array_elt_type, unshare_expr (object),
  			purpose, NULL_TREE, NULL_TREE);
*************** gimplify_init_constructor (tree *expr_p,
*** 2668,2675 ****
  	    if (elt_list)
  	      {
  		i = TREE_VALUE (elt_list);
! 		if (TREE_CHAIN (elt_list))
! 		  abort ();
  	      }
  	  }
  	if (r == NULL || i == NULL)
--- 2649,2655 ----
  	    if (elt_list)
  	      {
  		i = TREE_VALUE (elt_list);
! 		gcc_assert (!TREE_CHAIN (elt_list));
  	      }
  	  }
  	if (r == NULL || i == NULL)
*************** gimplify_init_constructor (tree *expr_p,
*** 2720,2726 ****
  
      default:
        /* So how did we get a CONSTRUCTOR for a scalar type?  */
!       abort ();
      }
  
    if (ret == GS_ERROR)
--- 2700,2706 ----
  
      default:
        /* So how did we get a CONSTRUCTOR for a scalar type?  */
!       gcc_unreachable ();
      }
  
    if (ret == GS_ERROR)
*************** gimplify_modify_expr (tree *expr_p, tree
*** 2828,2835 ****
    enum gimplify_status ret = GS_UNHANDLED;
  
  #if defined ENABLE_CHECKING
!   if (TREE_CODE (*expr_p) != MODIFY_EXPR && TREE_CODE (*expr_p) != INIT_EXPR)
!     abort ();
  #endif
  
    /* The distinction between MODIFY_EXPR and INIT_EXPR is no longer useful.  */
--- 2808,2815 ----
    enum gimplify_status ret = GS_UNHANDLED;
  
  #if defined ENABLE_CHECKING
!   gcc_assert (TREE_CODE (*expr_p) == MODIFY_EXPR
! 	      || TREE_CODE (*expr_p) == INIT_EXPR);
  #endif
  
    /* The distinction between MODIFY_EXPR and INIT_EXPR is no longer useful.  */
*************** gimplify_modify_expr (tree *expr_p, tree
*** 2886,2893 ****
      {
        /* If we've somehow already got an SSA_NAME on the LHS, then
  	 we're probably modifying it twice.  Not good.  */
!       if (TREE_CODE (*to_p) == SSA_NAME)
! 	abort ();
        *to_p = make_ssa_name (*to_p, *expr_p);
      }
  
--- 2866,2872 ----
      {
        /* If we've somehow already got an SSA_NAME on the LHS, then
  	 we're probably modifying it twice.  Not good.  */
!       gcc_assert (TREE_CODE (*to_p) != SSA_NAME);
        *to_p = make_ssa_name (*to_p, *expr_p);
      }
  
*************** gimplify_save_expr (tree *expr_p, tree *
*** 3036,3043 ****
    tree val;
  
  #if defined ENABLE_CHECKING
!   if (TREE_CODE (*expr_p) != SAVE_EXPR)
!     abort ();
  #endif
  
    val = TREE_OPERAND (*expr_p, 0);
--- 3015,3021 ----
    tree val;
  
  #if defined ENABLE_CHECKING
!   gcc_assert (TREE_CODE (*expr_p) == SAVE_EXPR);
  #endif
  
    val = TREE_OPERAND (*expr_p, 0);
*************** gimplify_target_expr (tree *expr_p, tree
*** 3432,3440 ****
        TREE_OPERAND (targ, 3) = init;
        TARGET_EXPR_INITIAL (targ) = NULL_TREE;
      }
!   else if (!DECL_SEEN_IN_BIND_EXPR_P (temp))
      /* We should have expanded this before.  */
!     abort ();
  
    *expr_p = temp;
    return GS_OK;
--- 3410,3418 ----
        TREE_OPERAND (targ, 3) = init;
        TARGET_EXPR_INITIAL (targ) = NULL_TREE;
      }
!   else
      /* We should have expanded this before.  */
!     gcc_assert (DECL_SEEN_IN_BIND_EXPR_P (temp));
  
    *expr_p = temp;
    return GS_OK;
*************** gimplify_expr (tree *expr_p, tree *pre_p
*** 3593,3599 ****
  	  break;
  
  	case TREE_LIST:
! 	  abort ();
  
  	case COMPOUND_EXPR:
  	  ret = gimplify_compound_expr (expr_p, pre_p, fallback != fb_none);
--- 3571,3577 ----
  	  break;
  
  	case TREE_LIST:
! 	  gcc_unreachable ();
  
  	case COMPOUND_EXPR:
  	  ret = gimplify_compound_expr (expr_p, pre_p, fallback != fb_none);
*************** gimplify_expr (tree *expr_p, tree *pre_p
*** 3730,3737 ****
  	case LABEL_EXPR:
  	  ret = GS_ALL_DONE;
  #ifdef ENABLE_CHECKING
! 	  if (decl_function_context (LABEL_EXPR_LABEL (*expr_p)) != current_function_decl)
! 	    abort ();
  #endif
  	  break;
  
--- 3708,3715 ----
  	case LABEL_EXPR:
  	  ret = GS_ALL_DONE;
  #ifdef ENABLE_CHECKING
! 	  gcc_assert (decl_function_context (LABEL_EXPR_LABEL (*expr_p))
! 		      == current_function_decl);
  #endif
  	  break;
  
*************** gimplify_expr (tree *expr_p, tree *pre_p
*** 3788,3795 ****
  
  	case NON_LVALUE_EXPR:
  	  /* This should have been stripped above.  */
! 	  abort ();
! 	  break;
  
  	case ASM_EXPR:
  	  ret = gimplify_asm_expr (expr_p, pre_p, post_p);
--- 3766,3772 ----
  
  	case NON_LVALUE_EXPR:
  	  /* This should have been stripped above.  */
! 	  gcc_unreachable ();
  
  	case ASM_EXPR:
  	  ret = gimplify_asm_expr (expr_p, pre_p, post_p);
*************** gimplify_expr (tree *expr_p, tree *pre_p
*** 3867,3874 ****
  	      && !DECL_SEEN_IN_BIND_EXPR_P (tmp))
  	    {
  #ifdef ENABLE_CHECKING
! 	      if (!errorcount && !sorrycount)
! 		abort ();
  #endif
  	      ret = GS_ERROR;
  	      break;
--- 3844,3850 ----
  	      && !DECL_SEEN_IN_BIND_EXPR_P (tmp))
  	    {
  #ifdef ENABLE_CHECKING
! 	      gcc_assert (errorcount || sorrycount);
  #endif
  	      ret = GS_ERROR;
  	      break;
*************** gimplify_expr (tree *expr_p, tree *pre_p
*** 3892,3940 ****
  	  break;
  
  	default:
! 	  /* If this is a comparison of objects of aggregate type, handle
! 	     it specially (by converting to a call to memcmp).  It would be
! 	     nice to only have to do this for variable-sized objects, but
! 	     then we'd have to allow the same nest of reference nodes we
! 	     allow for MODIFY_EXPR and that's too complex.  */
! 	  if (TREE_CODE_CLASS (TREE_CODE (*expr_p)) == '<'
! 	      && (AGGREGATE_TYPE_P (TREE_TYPE (TREE_OPERAND (*expr_p, 1)))))
! 	    ret = gimplify_variable_sized_compare (expr_p);
! 
! 	  /* If *EXPR_P does not need to be special-cased, handle it
! 	     according to its class.  */
! 	  else if (TREE_CODE_CLASS (TREE_CODE (*expr_p)) == '1')
! 	    ret = gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p,
! 				 post_p, is_gimple_val, fb_rvalue);
! 	  else if (TREE_CODE_CLASS (TREE_CODE (*expr_p)) == '2'
! 		   || TREE_CODE_CLASS (TREE_CODE (*expr_p)) == '<'
! 		   || TREE_CODE (*expr_p) == TRUTH_AND_EXPR
! 		   || TREE_CODE (*expr_p) == TRUTH_OR_EXPR
! 		   || TREE_CODE (*expr_p) == TRUTH_XOR_EXPR)
  	    {
! 	      enum gimplify_status r0, r1;
! 
! 	      r0 = gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p,
! 				  post_p, is_gimple_val, fb_rvalue);
! 	      r1 = gimplify_expr (&TREE_OPERAND (*expr_p, 1), pre_p,
! 				  post_p, is_gimple_val, fb_rvalue);
  
! 	      ret = MIN (r0, r1);
! 	    }
! 	  else if (TREE_CODE_CLASS (TREE_CODE (*expr_p)) == 'd'
! 		   || TREE_CODE_CLASS (TREE_CODE (*expr_p)) == 'c')
! 	    {
  	      ret = GS_ALL_DONE;
! 	      break;
  	    }
- 	  else
- 	    /* Fail if we don't know how to handle this tree code.  */
- 	    abort ();
  
  	  recalculate_side_effects (*expr_p);
  	  break;
  	}
! 
        /* If we replaced *expr_p, gimplify again.  */
        if (ret == GS_OK && (*expr_p == NULL || *expr_p == save_expr))
  	ret = GS_ALL_DONE;
--- 3868,3925 ----
  	  break;
  
  	default:
! 	  switch (TREE_CODE_CLASS (TREE_CODE (*expr_p)))
  	    {
! 	    case '<':
! 	      /* If this is a comparison of objects of aggregate type,
! 	     	 handle it specially (by converting to a call to
! 	     	 memcmp).  It would be nice to only have to do this
! 	     	 for variable-sized objects, but then we'd have to
! 	     	 allow the same nest of reference nodes we allow for
! 	     	 MODIFY_EXPR and that's too complex.  */
! 	      if (!AGGREGATE_TYPE_P (TREE_TYPE (TREE_OPERAND (*expr_p, 1))))
! 		goto expr_2;
! 	      ret = gimplify_variable_sized_compare (expr_p);
! 	      break;
! 	      
! 	    /* If *EXPR_P does not need to be special-cased, handle it
! 	       according to its class.  */
! 	    case '1':
! 	      ret = gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p,
! 				   post_p, is_gimple_val, fb_rvalue);
! 	      break;
  
! 	    case '2':
! 	    expr_2:
! 	      {
! 		enum gimplify_status r0, r1;
! 		
! 		r0 = gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p,
! 				    post_p, is_gimple_val, fb_rvalue);
! 		r1 = gimplify_expr (&TREE_OPERAND (*expr_p, 1), pre_p,
! 				    post_p, is_gimple_val, fb_rvalue);
! 		
! 		ret = MIN (r0, r1);
! 		break;
! 	      }
! 	      
! 	    case 'd':
! 	    case 'c':
  	      ret = GS_ALL_DONE;
! 	      goto dont_recalculate;
! 	      
! 	    default:
! 	      gcc_assert (TREE_CODE (*expr_p) == TRUTH_AND_EXPR
! 			  || TREE_CODE (*expr_p) == TRUTH_OR_EXPR
! 			  || TREE_CODE (*expr_p) == TRUTH_XOR_EXPR);
! 	      goto expr_2;
  	    }
  
  	  recalculate_side_effects (*expr_p);
+ 	dont_recalculate:
  	  break;
  	}
!       
        /* If we replaced *expr_p, gimplify again.  */
        if (ret == GS_OK && (*expr_p == NULL || *expr_p == save_expr))
  	ret = GS_ALL_DONE;
*************** gimplify_expr (tree *expr_p, tree *pre_p
*** 3953,3960 ****
  #ifdef ENABLE_CHECKING
    /* This was only valid as a return value from the langhook, which
       we handled.  Make sure it doesn't escape from any other context.  */
!   if (ret == GS_UNHANDLED)
!     abort ();
  #endif
  
    if (fallback == fb_none && *expr_p && !is_gimple_stmt (*expr_p))
--- 3938,3944 ----
  #ifdef ENABLE_CHECKING
    /* This was only valid as a return value from the langhook, which
       we handled.  Make sure it doesn't escape from any other context.  */
!   gcc_assert (ret != GS_UNHANDLED);
  #endif
  
    if (fallback == fb_none && *expr_p && !is_gimple_stmt (*expr_p))
*************** gimplify_expr (tree *expr_p, tree *pre_p
*** 3969,3989 ****
  	     has side effects.  Recurse through the operands to find it.  */
  	  enum tree_code code = TREE_CODE (*expr_p);
  
! 	  if (code == COMPONENT_REF
! 	      || code == REALPART_EXPR || code == IMAGPART_EXPR)
! 	    gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p,
! 			   gimple_test_f, fallback);
! 	  else if (code == ARRAY_REF || code == ARRAY_RANGE_REF)
  	    {
  	      gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p,
  			     gimple_test_f, fallback);
  	      gimplify_expr (&TREE_OPERAND (*expr_p, 1), pre_p, post_p,
! 			   gimple_test_f, fallback);
  	    }
- 	  else
- 	    /* Anything else with side-effects
- 	       must be converted to a valid statement before we get here.  */
- 	    abort ();
  
  	  *expr_p = NULL;
  	}
--- 3953,3978 ----
  	     has side effects.  Recurse through the operands to find it.  */
  	  enum tree_code code = TREE_CODE (*expr_p);
  
! 	  switch (code)
  	    {
+ 	    case COMPONENT_REF:
+ 	    case REALPART_EXPR: case IMAGPART_EXPR:
+ 	      gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p,
+ 			     gimple_test_f, fallback);
+ 	      break;
+ 
+ 	    case ARRAY_REF: case ARRAY_RANGE_REF:
  	      gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p,
  			     gimple_test_f, fallback);
  	      gimplify_expr (&TREE_OPERAND (*expr_p, 1), pre_p, post_p,
! 			     gimple_test_f, fallback);
! 	      break;
! 
! 	    default:
! 	       /* Anything else with side-effects must be converted to
! 	       	  a valid statement before we get here.  */
! 	      gcc_unreachable ();
  	    }
  
  	  *expr_p = NULL;
  	}
*************** gimplify_expr (tree *expr_p, tree *pre_p
*** 4050,4057 ****
    else if ((fallback & fb_rvalue) && is_gimple_formal_tmp_rhs (*expr_p))
      {
  #if defined ENABLE_CHECKING
!       if (VOID_TYPE_P (TREE_TYPE (*expr_p)))
! 	abort ();
  #endif
  
        /* An rvalue will do.  Assign the gimplified expression into a new
--- 4039,4045 ----
    else if ((fallback & fb_rvalue) && is_gimple_formal_tmp_rhs (*expr_p))
      {
  #if defined ENABLE_CHECKING
!       gcc_assert (!VOID_TYPE_P (TREE_TYPE (*expr_p)));
  #endif
  
        /* An rvalue will do.  Assign the gimplified expression into a new
*************** gimplify_expr (tree *expr_p, tree *pre_p
*** 4068,4092 ****
        if (TREE_CODE (*expr_p) != SSA_NAME)
  	DECL_GIMPLE_FORMAL_TEMP_P (*expr_p) = 1;
      }
!   else if (fallback & fb_mayfail)
      {
!       /* If this is an asm statement, and the user asked for the impossible,
! 	 don't abort.  Fail and let gimplify_asm_expr issue an error.  */
        ret = GS_ERROR;
        goto out;
      }
-   else
-     {
-       fprintf (stderr, "gimplification failed:\n");
-       print_generic_expr (stderr, *expr_p, 0);
-       debug_tree (*expr_p);
-       abort ();
-     }
  
  #if defined ENABLE_CHECKING
    /* Make sure the temporary matches our predicate.  */
!   if (!(*gimple_test_f) (*expr_p))
!     abort ();
  #endif
  
    if (internal_post)
--- 4056,4083 ----
        if (TREE_CODE (*expr_p) != SSA_NAME)
  	DECL_GIMPLE_FORMAL_TEMP_P (*expr_p) = 1;
      }
!   else
      {
! #ifdef ENABLE_CHECKING
!       if (!(fallback & fb_mayfail))
! 	{
! 	  fprintf (stderr, "gimplification failed:\n");
! 	  print_generic_expr (stderr, *expr_p, 0);
! 	  debug_tree (*expr_p);
! 	  internal_error ("gimplification failed");
! 	}
! #endif
!       gcc_assert (fallback & fb_mayfail);
!       /* If this is an asm statement, and the user asked for the
! 	 impossible, don't abort.  Fail and let gimplify_asm_expr
! 	 issue an error.  */
        ret = GS_ERROR;
        goto out;
      }
  
  #if defined ENABLE_CHECKING
    /* Make sure the temporary matches our predicate.  */
!   gcc_assert ((*gimple_test_f) (*expr_p));
  #endif
  
    if (internal_post)
*************** check_pointer_types_r (tree *tp, int *wa
*** 4212,4219 ****
        otype = TREE_TYPE (t);
        ptype = TREE_TYPE (TREE_OPERAND (t, 0));
        dtype = TREE_TYPE (ptype);
!       if (!cpt_same_type (otype, dtype))
! 	abort ();
        break;
  
      case ADDR_EXPR:
--- 4203,4209 ----
        otype = TREE_TYPE (t);
        ptype = TREE_TYPE (TREE_OPERAND (t, 0));
        dtype = TREE_TYPE (ptype);
!       gcc_assert (cpt_same_type (otype, dtype));
        break;
  
      case ADDR_EXPR:
*************** check_pointer_types_r (tree *tp, int *wa
*** 4226,4236 ****
  	     a pointer to the array type.  We must allow this in order to
  	     properly represent assigning the address of an array in C into
  	     pointer to the element type.  */
! 	  if (TREE_CODE (otype) == ARRAY_TYPE
! 	      && POINTER_TYPE_P (ptype)
! 	      && cpt_same_type (TREE_TYPE (otype), dtype))
! 	    break;
! 	  abort ();
  	}
        break;
  
--- 4216,4225 ----
  	     a pointer to the array type.  We must allow this in order to
  	     properly represent assigning the address of an array in C into
  	     pointer to the element type.  */
! 	  gcc_assert (TREE_CODE (otype) == ARRAY_TYPE
! 		      && POINTER_TYPE_P (ptype)
! 		      && cpt_same_type (TREE_TYPE (otype), dtype));
! 	  break;
  	}
        break;
  
*************** force_gimple_operand (tree expr, tree *s
*** 4373,4380 ****
  
    ret = gimplify_expr (&expr, stmts, NULL,
  		       gimple_test_f, fb_rvalue);
!   if (ret == GS_ERROR)
!     abort ();
  
    for (t = gimplify_ctxp->temps; t ; t = TREE_CHAIN (t))
      add_referenced_tmp_var (t);
--- 4362,4368 ----
  
    ret = gimplify_expr (&expr, stmts, NULL,
  		       gimple_test_f, fb_rvalue);
!   gcc_assert (ret != GS_ERROR);
  
    for (t = gimplify_ctxp->temps; t ; t = TREE_CHAIN (t))
      add_referenced_tmp_var (t);
Index: global.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/global.c,v
retrieving revision 1.107
diff -c -3 -p -r1.107 global.c
*** global.c	5 Sep 2004 15:24:11 -0000	1.107
--- global.c	8 Sep 2004 12:59:17 -0000
*************** global_alloc (FILE *file)
*** 469,480 ****
  	&& (! current_function_has_nonlocal_label
  	    || REG_N_CALLS_CROSSED (i) == 0))
        {
! 	if (reg_renumber[i] < 0 && reg_may_share[i] && reg_allocno[reg_may_share[i]] >= 0)
  	  reg_allocno[i] = reg_allocno[reg_may_share[i]];
  	else
  	  reg_allocno[i] = max_allocno++;
! 	if (REG_LIVE_LENGTH (i) == 0)
! 	  abort ();
        }
      else
        reg_allocno[i] = -1;
--- 469,480 ----
  	&& (! current_function_has_nonlocal_label
  	    || REG_N_CALLS_CROSSED (i) == 0))
        {
! 	if (reg_renumber[i] < 0
! 	    && reg_may_share[i] && reg_allocno[reg_may_share[i]] >= 0)
  	  reg_allocno[i] = reg_allocno[reg_may_share[i]];
  	else
  	  reg_allocno[i] = max_allocno++;
! 	gcc_assert (REG_LIVE_LENGTH (i));
        }
      else
        reg_allocno[i] = -1;
*************** build_insn_chain (rtx first)
*** 1886,1899 ****
  	 the previous real insn is a JUMP_INSN.  */
        if (b == EXIT_BLOCK_PTR)
  	{
! 	  for (first = NEXT_INSN (first) ; first; first = NEXT_INSN (first))
! 	    if (INSN_P (first)
! 		&& GET_CODE (PATTERN (first)) != USE
! 		&& ! ((GET_CODE (PATTERN (first)) == ADDR_VEC
! 		       || GET_CODE (PATTERN (first)) == ADDR_DIFF_VEC)
! 		      && prev_real_insn (first) != 0
! 		      && JUMP_P (prev_real_insn (first))))
! 	      abort ();
  	  break;
  	}
      }
--- 1886,1900 ----
  	 the previous real insn is a JUMP_INSN.  */
        if (b == EXIT_BLOCK_PTR)
  	{
! #ifdef ENABLE_CHECKING
! 	  for (first = NEXT_INSN (first); first; first = NEXT_INSN (first))
! 	    gcc_assert (!INSN_P (first)
! 			|| GET_CODE (PATTERN (first)) == USE
! 			|| ((GET_CODE (PATTERN (first)) == ADDR_VEC
! 			     || GET_CODE (PATTERN (first)) == ADDR_DIFF_VEC)
! 			    && prev_real_insn (first) != 0
! 			    && JUMP_P (prev_real_insn (first))));
! #endif
  	  break;
  	}
      }
Index: graph.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/graph.c,v
retrieving revision 1.34
diff -c -3 -p -r1.34 graph.c
*** graph.c	6 Sep 2004 10:07:46 -0000	1.34
--- graph.c	8 Sep 2004 12:59:17 -0000
*************** clean_graph_dump_file (const char *base)
*** 398,411 ****
    if (fp == NULL)
      fatal_error ("can't open %s: %m", buf);
  
!   switch (graph_dump_format)
!     {
!     case vcg:
!       fputs ("graph: {\nport_sharing: no\n", fp);
!       break;
!     case no_graph:
!       abort ();
!     }
  
    fclose (fp);
  }
--- 398,405 ----
    if (fp == NULL)
      fatal_error ("can't open %s: %m", buf);
  
!   gcc_assert (graph_dump_format == vcg);
!   fputs ("graph: {\nport_sharing: no\n", fp);
  
    fclose (fp);
  }
*************** finish_graph_dump_file (const char *base
*** 426,440 ****
    fp = fopen (buf, "a");
    if (fp != NULL)
      {
!       switch (graph_dump_format)
! 	{
! 	case vcg:
! 	  fputs ("}\n", fp);
! 	  break;
! 	case no_graph:
! 	  abort ();
! 	}
! 
        fclose (fp);
      }
  }
--- 420,427 ----
    fp = fopen (buf, "a");
    if (fp != NULL)
      {
!       gcc_assert (graph_dump_format == vcg);
!       fputs ("}\n", fp);
        fclose (fp);
      }
  }

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