[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#344041: [m68k] gcc-4.0: internal consistency failure



Package: gcc-4.0
Version: 4.0.2-5
Severity: important

Recent versions of make fail with an error reproducible as follows.


$ gcc -O2 -c -o buggy.o buggy.c
buggy.c: In function 'pop_variable_scope':
buggy.c:62: fatal error: internal consistency failure
compilation terminated.

Workaround: change -O2 to -O1.

Hopefully, I've reduced this enough.

Thanks,

Stephen

-- 
Stephen R. Marenka     If life's not fun, you're not doing it right!
<stephen@marenka.net>
/* based on variable.c from make_3.80+3.81.b4-1 */


#define NULL 0
#include <assert.h>

struct variable_set
  {
    void * table;	/* Hash table of variables.  */
  };

struct variable_set_list
  {
    struct variable_set_list *next;	/* Link in the chain.  */
    struct variable_set *set;		/* Variable set.  */
  };

extern struct variable_set_list *current_variable_set_list;
static struct variable_set global_variable_set;
static struct variable_set_list global_setlist
  = { 0, &global_variable_set };


static void
free_variable_name_and_value (const void *item)
{
}


void
pop_variable_scope (void)
{
  struct variable_set_list *setlist;
  struct variable_set *set;

  /* Can't call this if there's no scope to pop!  */
  assert(current_variable_set_list->next != NULL);

  if (current_variable_set_list != &global_setlist)
    {
      /* We're not pointing to the global setlist, so pop this one.  */
      setlist = current_variable_set_list;
      set = setlist->set;
      current_variable_set_list = setlist->next;
    }
  else
    {
      /* This set is the one in the global_setlist, but there is another global
         set beyond that.  We want to copy that set to global_setlist, then
         delete what used to be in global_setlist.  */
      setlist = global_setlist.next;
      set = global_setlist.set;
      global_setlist.set = setlist->set;
      global_setlist.next = setlist->next;
    }

  /* Free the one we no longer need.  */
  free ((char *) setlist);
  hash_map (&set->table, free_variable_name_and_value);
  hash_free (&set->table, 1);
  free ((char *) set);
}


Attachment: signature.asc
Description: Digital signature


Reply to: