This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/11576] [3.3 regression] internal error at emit-rtl.c:2017
- From: "kazu at cs dot umass dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Sep 2003 10:01:03 -0000
- Subject: [Bug target/11576] [3.3 regression] internal error at emit-rtl.c:2017
- References: <20030718133949.11576.ysato@users.sourceforge.jp>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11576
------- Additional Comments From kazu at cs dot umass dot edu 2003-09-02 10:01 -------
I simplified the testcase a little bit.
struct list_head {
struct list_head *next, *prev;
};
struct atomic {
int counter;
};
struct address_space {
struct list_head clean_pages;
};
struct page {
struct list_head list;
struct address_space *mapping;
unsigned long index;
struct atomic count;
unsigned long flags;
};
extern unsigned int page_hash_bits;
unsigned int page_hash_bits;
struct page **page_hash_table;
void add_page_to_hash_queue (struct page *page, struct page **p);
void lru_cache_add (struct page *page);
void
add_to_page_cache (struct page *page, struct address_space *mapping,
unsigned long offset)
{
unsigned long m = ((unsigned long) mapping) / 4 + offset;
unsigned long hash_value =
(m + (m >> page_hash_bits)) & ((1 << page_hash_bits) - 1);
struct page **hash = page_hash_table + hash_value;
struct list_head *head;
page->flags |= 1;
{
struct atomic *v = &page->count;
int flags;
asm volatile ("" : "=r" (flags) : : "er0");
v->counter++;
asm volatile ("" : : "r" (flags) : "er0");
}
page->index = offset;
head = &mapping->clean_pages;
{
struct list_head *new = &page->list;
struct list_head *prev = head;
struct list_head *next = head->next;
next->prev = new;
new->next = next;
new->prev = prev;
prev->next = new;
}
add_page_to_hash_queue (page, hash);
lru_cache_add (page);
}