This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/11576] New: internal error at emit-rtl.c:2017
- From: "ysato at users dot sourceforge dot jp" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Jul 2003 13:39:51 -0000
- Subject: [Bug c/11576] New: internal error at emit-rtl.c:2017
- 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
Summary: internal error at emit-rtl.c:2017
Product: gcc
Version: 3.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: ysato at users dot sourceforge dot jp
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i386-linux
GCC host triplet: i386-linux
GCC target triplet: h8300-elf
o Compile command
$ h8300-elf-gcc -O1 -mh -mint32 -Os -S gcc-bug.c
o Result message
gcc-bug.c: In function `add_to_page_cache':
gcc-bug.c:86: internal compiler error: in change_address_1, at emit-rtl.c:2017
o problem source code
struct list_head {
struct list_head *next, *prev;
};
static inline void __list_add(struct list_head *new,
struct list_head *prev,
struct list_head *next)
{
next->prev = new;
new->next = next;
new->prev = prev;
prev->next = new;
}
static inline void list_add(struct list_head *new, struct list_head *head)
{
__list_add(new, head, head->next);
}
typedef struct { int counter; } atomic_t;
static __inline__ int atomic_inc_return(atomic_t *v)
{
int ret,flags;
do { asm volatile ("sub.l er0,er0\n\tstc ccr,r0l\n\tmov.l er0,%0":"=r" (flags) : : "er0"); asm volatile ("orc #0x80,ccr"); } while(0);
v->counter++;
ret = v->counter;
asm volatile ("mov.l %0,er0\n\tldc r0l,ccr": :"r" (flags) : "er0");
return ret;
}
struct address_space {
struct list_head clean_pages;
unsigned long nrpages;
};
struct inode {
unsigned long dummy;
};
typedef struct page {
struct list_head list;
struct address_space *mapping;
unsigned long index;
atomic_t count;
unsigned long flags;
} mem_map_t;
extern unsigned int page_hash_bits;
static inline unsigned long _page_hashfn(struct address_space * mapping, unsigned long index)
{
return (((((unsigned long) mapping)/(sizeof(struct inode) & ~ (sizeof(struct inode) - 1)))+index)+(((((unsigned long) mapping) /(sizeof(struct inode) & ~ (sizeof(struct inode) - 1)))+index)>>(page_hash_bits))) & ((1 << (page_hash_bits))-1);
}
atomic_t page_cache_size = { (0) };
unsigned int page_hash_bits;
struct page **page_hash_table;
static void add_page_to_hash_queue(struct page * page, struct page **p)
{
}
static inline void add_page_to_inode_queue(struct address_space *mapping, struct page * page)
{
struct list_head *head = &mapping->clean_pages;
mapping->nrpages++;
list_add(&page->list, head);
page->mapping = mapping;
}
static inline void __add_to_page_cache(struct page * page,
struct address_space *mapping, unsigned long offset,
struct page **hash)
{
unsigned long flags;
flags = page->flags & ~(1 << 3 | 1 << 1 | 1 << 4 | 1 << 2 | 1 << 13 | 1 << 12);
page->flags = flags | (1 << 0);
atomic_inc_return(&(page)->count);
page->index = offset;
add_page_to_inode_queue(mapping, page);
add_page_to_hash_queue(page, hash);
}
static void lru_cache_add(struct page *page)
{
}
void add_to_page_cache(struct page * page, struct address_space * mapping, unsigned long offset)
{
__add_to_page_cache(page, mapping, offset, (page_hash_table+_page_hashfn(mapping,offset)));
lru_cache_add(page);
}