* PPro and egcs
@ 1997-10-25 19:03 H.J. Lu
1997-10-26 0:48 ` Mumit Khan
` (3 more replies)
0 siblings, 4 replies; 23+ messages in thread
From: H.J. Lu @ 1997-10-25 19:03 UTC (permalink / raw)
To: egcs
Hi,
Has anyone tried egcs on PPro? I got an error.
# gcc -O -march=i686 -S foo.c -fomit-frame-pointer
foo.c: In function `nfs_readpage_sync':
foo.c:1618: internal error--insn does not satisfy its constraints:
(insn 317 316 139 (parallel[
(set (reg/v:SI 3 %ebx)
(if_then_else:SI (ne (cc0)
(const_int 0))
(reg:SI 0 %eax)
(const_int -22)))
(clobber (reg:SI 0 %eax))
] ) 374 {movsicc_1} (nil)
(expr_list:REG_DEAD (reg:SI 0 %eax)
(expr_list:REG_UNUSED (reg:SI 0 %eax)
(nil))))
gcc: Internal compiler error: program cc1 got fatal signal 6
--
H.J. Lu (hjl@gnu.ai.mit.edu)
---
extern unsigned long event;
struct pt_regs {
long ebx;
long ecx;
long edx;
long esi;
long edi;
long ebp;
long eax;
int xds;
int xes;
long orig_eax;
long eip;
int xcs;
long eflags;
long esp;
int xss;
};
extern void show_regs(struct pt_regs *);
struct linux_binprm{
char buf[128];
unsigned long page[32 ];
unsigned long p;
int sh_bang;
int java;
struct dentry * dentry;
int e_uid, e_gid;
int argc, envc;
char * filename;
unsigned long loader, exec;
};
struct linux_binfmt {
struct linux_binfmt * next;
struct module *module;
int (*load_binary)(struct linux_binprm *, struct pt_regs * regs);
int (*load_shlib)(int fd);
int (*core_dump)(long signr, struct pt_regs * regs);
};
extern int register_binfmt(struct linux_binfmt *);
extern int unregister_binfmt(struct linux_binfmt *);
extern int read_exec(struct dentry *, unsigned long offset,
char * addr, unsigned long count, int to_kmem);
extern int open_dentry(struct dentry *, int mode);
extern int init_elf_binfmt(void);
extern int init_elf32_binfmt(void);
extern int init_aout_binfmt(void);
extern int init_aout32_binfmt(void);
extern int init_script_binfmt(void);
extern int init_java_binfmt(void);
extern int init_em86_binfmt(void);
extern int init_misc_binfmt(void);
extern int prepare_binprm(struct linux_binprm *);
extern void remove_arg_zero(struct linux_binprm *);
extern int search_binary_handler(struct linux_binprm *,struct pt_regs *);
extern void flush_old_exec(struct linux_binprm * bprm);
extern unsigned long setup_arg_pages(unsigned long p, struct linux_binprm * bprm);
extern unsigned long copy_strings(int argc,char ** argv,unsigned long *page,
unsigned long p, int from_kmem);
typedef void (*lcall7_func)(struct pt_regs *);
struct exec_domain {
const char *name;
lcall7_func handler;
unsigned char pers_low, pers_high;
unsigned long * signal_map;
unsigned long * signal_invmap;
struct module * module;
struct exec_domain *next;
};
extern struct exec_domain default_exec_domain;
extern struct exec_domain *lookup_exec_domain(unsigned long personality);
extern int register_exec_domain(struct exec_domain *it);
extern int unregister_exec_domain(struct exec_domain *it);
int sys_personality(unsigned long personality);
typedef void *__gnuc_va_list;
void va_end (__gnuc_va_list);
typedef __gnuc_va_list va_list;
extern void math_error(void);
void panic(const char * fmt, ...)
__attribute__ ((noreturn, format (printf, 1, 2)));
void do_exit(long error_code)
__attribute__((noreturn)) ;
extern unsigned long simple_strtoul(const char *,char **,unsigned int);
extern int sprintf(char * buf, const char * fmt, ...);
extern int vsprintf(char *buf, const char *, va_list);
extern int session_of_pgrp(int pgrp);
extern int kill_proc(int pid, int sig, int priv);
extern int kill_pg(int pgrp, int sig, int priv);
extern int kill_sl(int sess, int sig, int priv);
int printk(const char * fmt, ...)
__attribute__ ((format (printf, 1, 2)));
struct sysinfo {
long uptime;
unsigned long loads[3];
unsigned long totalram;
unsigned long freeram;
unsigned long sharedram;
unsigned long bufferram;
unsigned long totalswap;
unsigned long freeswap;
unsigned short procs;
char _f[22];
};
typedef struct fd_set {
unsigned long fds_bits [(1024 / (8 * sizeof(unsigned long)) ) ];
} __kernel_fd_set;
typedef void (*__kernel_sighandler_t)(int);
typedef int __kernel_key_t;
typedef unsigned short __kernel_dev_t;
typedef unsigned long __kernel_ino_t;
typedef unsigned short __kernel_mode_t;
typedef unsigned short __kernel_nlink_t;
typedef long __kernel_off_t;
typedef int __kernel_pid_t;
typedef unsigned short __kernel_ipc_pid_t;
typedef unsigned short __kernel_uid_t;
typedef unsigned short __kernel_gid_t;
typedef unsigned int __kernel_size_t;
typedef int __kernel_ssize_t;
typedef int __kernel_ptrdiff_t;
typedef long __kernel_time_t;
typedef long __kernel_clock_t;
typedef int __kernel_daddr_t;
typedef char * __kernel_caddr_t;
typedef long long __kernel_loff_t;
typedef struct {
int val[2];
} __kernel_fsid_t;
typedef unsigned short umode_t;
typedef __signed__ char __s8;
typedef unsigned char __u8;
typedef __signed__ short __s16;
typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
typedef __signed__ long long __s64;
typedef unsigned long long __u64;
typedef signed char s8;
typedef unsigned char u8;
typedef signed short s16;
typedef unsigned short u16;
typedef signed int s32;
typedef unsigned int u32;
typedef signed long long s64;
typedef unsigned long long u64;
typedef __kernel_fd_set fd_set;
typedef __kernel_dev_t dev_t;
typedef __kernel_ino_t ino_t;
typedef __kernel_mode_t mode_t;
typedef __kernel_nlink_t nlink_t;
typedef __kernel_off_t off_t;
typedef __kernel_pid_t pid_t;
typedef __kernel_uid_t uid_t;
typedef __kernel_gid_t gid_t;
typedef __kernel_daddr_t daddr_t;
typedef __kernel_key_t key_t;
typedef __kernel_loff_t loff_t;
typedef __kernel_size_t size_t;
typedef __kernel_ssize_t ssize_t;
typedef __kernel_ptrdiff_t ptrdiff_t;
typedef __kernel_time_t time_t;
typedef __kernel_clock_t clock_t;
typedef __kernel_caddr_t caddr_t;
typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned int u_int;
typedef unsigned long u_long;
typedef unsigned char unchar;
typedef unsigned short ushort;
typedef unsigned int uint;
typedef unsigned long ulong;
struct ustat {
__kernel_daddr_t f_tfree;
__kernel_ino_t f_tinode;
char f_fname[6];
char f_fpack[6];
};
struct tms {
clock_t tms_utime;
clock_t tms_stime;
clock_t tms_cutime;
clock_t tms_cstime;
};
static inline unsigned long _get_base(char * addr)
{
unsigned long __base;
__asm__("movb %3,%%dh\n\t"
"movb %2,%%dl\n\t"
"shll $16,%%edx\n\t"
"movw %1,%%dx"
:"=&d" (__base)
:"m" (*((addr)+2)),
"m" (*((addr)+4)),
"m" (*((addr)+7)));
return __base;
}
static inline unsigned long get_limit(unsigned long segment)
{
unsigned long __limit;
__asm__("lsll %1,%0"
:"=r" (__limit):"r" (segment));
return __limit+1;
}
struct __xchg_dummy { unsigned long a[100]; };
static inline unsigned long __xchg(unsigned long x, void * ptr, int size)
{
switch (size) {
case 1:
__asm__("xchgb %b0,%1"
:"=q" (x)
:"m" (* ((struct __xchg_dummy *)( ptr )) ), "0" (x)
:"memory");
break;
case 2:
__asm__("xchgw %w0,%1"
:"=r" (x)
:"m" (* ((struct __xchg_dummy *)( ptr )) ), "0" (x)
:"memory");
break;
case 4:
__asm__("xchgl %0,%1"
:"=r" (x)
:"m" (* ((struct __xchg_dummy *)( ptr )) ), "0" (x)
:"memory");
break;
}
return x;
}
extern void __global_cli(void);
extern void __global_sti(void);
extern unsigned long __global_save_flags(void);
extern void __global_restore_flags(unsigned long);
extern struct desc_struct default_ldt;
void disable_hlt(void);
void enable_hlt(void);
typedef struct { volatile int counter; } atomic_t;
static __inline__ void atomic_add(int i, volatile atomic_t *v)
{
__asm__ __volatile__(
"lock ; " "addl %1,%0"
:"=m" ((*(struct { int a[100]; } *) v ) )
:"ir" (i), "m" ((*(struct { int a[100]; } *) v ) ));
}
static __inline__ void atomic_sub(int i, volatile atomic_t *v)
{
__asm__ __volatile__(
"lock ; " "subl %1,%0"
:"=m" ((*(struct { int a[100]; } *) v ) )
:"ir" (i), "m" ((*(struct { int a[100]; } *) v ) ));
}
static __inline__ void atomic_inc(volatile atomic_t *v)
{
__asm__ __volatile__(
"lock ; " "incl %0"
:"=m" ((*(struct { int a[100]; } *) v ) )
:"m" ((*(struct { int a[100]; } *) v ) ));
}
static __inline__ void atomic_dec(volatile atomic_t *v)
{
__asm__ __volatile__(
"lock ; " "decl %0"
:"=m" ((*(struct { int a[100]; } *) v ) )
:"m" ((*(struct { int a[100]; } *) v ) ));
}
static __inline__ int atomic_dec_and_test(volatile atomic_t *v)
{
unsigned char c;
__asm__ __volatile__(
"lock ; " "decl %0; sete %1"
:"=m" ((*(struct { int a[100]; } *) v ) ), "=qm" (c)
:"m" ((*(struct { int a[100]; } *) v ) ));
return c != 0;
}
struct semaphore {
atomic_t count;
int waking;
struct wait_queue * wait;
};
void __down_failed(void );
int __down_failed_interruptible(void );
void __up_wakeup(void );
extern void __down(struct semaphore * sem);
extern void __up(struct semaphore * sem);
static inline void wake_one_more(struct semaphore * sem)
{
unsigned long flags;
(( flags )=__global_save_flags()) ;
__global_cli() ;
sem->waking++;
__global_restore_flags( flags ) ;
}
static inline int waking_non_zero(struct semaphore *sem)
{
unsigned long flags;
int ret = 0;
(( flags )=__global_save_flags()) ;
__global_cli() ;
if (sem->waking > 0) {
sem->waking--;
ret = 1;
}
__global_restore_flags( flags ) ;
return ret;
}
extern inline void down(struct semaphore * sem)
{
__asm__ __volatile__(
"# atomic down operation\n\t"
"lock ; "
"decl 0(%0)\n\t"
"js 2f\n"
"1:\n"
".section .text.lock,\"ax\"\n"
"2:\tpushl $1b\n\t"
"jmp __down_failed\n"
".previous"
:
:"c" (sem)
:"memory");
}
extern inline int down_interruptible(struct semaphore * sem)
{
int result;
__asm__ __volatile__(
"# atomic interruptible down operation\n\t"
"lock ; "
"decl 0(%1)\n\t"
"js 2f\n\t"
"xorl %0,%0\n"
"1:\n"
".section .text.lock,\"ax\"\n"
"2:\tpushl $1b\n\t"
"jmp __down_failed_interruptible\n"
".previous"
:"=a" (result)
:"c" (sem)
:"memory");
return result;
}
extern inline void up(struct semaphore * sem)
{
__asm__ __volatile__(
"# atomic up operation\n\t"
"lock ; "
"incl 0(%0)\n\t"
"jle 2f\n"
"1:\n"
".section .text.lock,\"ax\"\n"
"2:\tpushl $1b\n\t"
"jmp __up_wakeup\n"
".previous"
:
:"c" (sem)
:"memory");
}
typedef struct { unsigned long pte; } pte_t;
typedef struct { unsigned long pmd; } pmd_t;
typedef struct { unsigned long pgd; } pgd_t;
typedef struct { unsigned long pgprot; } pgprot_t;
struct __dummy { unsigned long a[100]; };
extern __inline__ void set_bit(int nr, volatile void * addr)
{
__asm__ __volatile__( "lock ; "
"btsl %1,%0"
:"=m" ((*(struct __dummy *) addr) )
:"ir" (nr));
}
extern __inline__ void clear_bit(int nr, volatile void * addr)
{
__asm__ __volatile__( "lock ; "
"btrl %1,%0"
:"=m" ((*(struct __dummy *) addr) )
:"ir" (nr));
}
extern __inline__ void change_bit(int nr, volatile void * addr)
{
__asm__ __volatile__( "lock ; "
"btcl %1,%0"
:"=m" ((*(struct __dummy *) addr) )
:"ir" (nr));
}
extern __inline__ int test_and_set_bit(int nr, volatile void * addr)
{
int oldbit;
__asm__ __volatile__( "lock ; "
"btsl %2,%1\n\tsbbl %0,%0"
:"=r" (oldbit),"=m" ((*(struct __dummy *) addr) )
:"ir" (nr));
return oldbit;
}
extern __inline__ int test_and_clear_bit(int nr, volatile void * addr)
{
int oldbit;
__asm__ __volatile__( "lock ; "
"btrl %2,%1\n\tsbbl %0,%0"
:"=r" (oldbit),"=m" ((*(struct __dummy *) addr) )
:"ir" (nr));
return oldbit;
}
extern __inline__ int test_and_change_bit(int nr, volatile void * addr)
{
int oldbit;
__asm__ __volatile__( "lock ; "
"btcl %2,%1\n\tsbbl %0,%0"
:"=r" (oldbit),"=m" ((*(struct __dummy *) addr) )
:"ir" (nr));
return oldbit;
}
extern __inline__ int __constant_test_bit(int nr, const volatile void * addr)
{
return ((1UL << (nr & 31)) & (((const volatile unsigned int *) addr)[nr >> 5])) != 0;
}
extern __inline__ int __test_bit(int nr, volatile void * addr)
{
int oldbit;
__asm__ __volatile__(
"btl %2,%1\n\tsbbl %0,%0"
:"=r" (oldbit)
:"m" ((*(struct __dummy *) addr) ),"ir" (nr));
return oldbit;
}
extern __inline__ int find_first_zero_bit(void * addr, unsigned size)
{
int res;
if (!size)
return 0;
__asm__("cld\n\t"
"movl $-1,%%eax\n\t"
"xorl %%edx,%%edx\n\t"
"repe; scasl\n\t"
"je 1f\n\t"
"xorl -4(%%edi),%%eax\n\t"
"subl $4,%%edi\n\t"
"bsfl %%eax,%%edx\n"
"1:\tsubl %%ebx,%%edi\n\t"
"shll $3,%%edi\n\t"
"addl %%edi,%%edx"
:"=d" (res)
:"c" ((size + 31) >> 5), "D" (addr), "b" (addr)
:"ax", "cx", "di");
return res;
}
extern __inline__ int find_next_zero_bit (void * addr, int size, int offset)
{
unsigned long * p = ((unsigned long *) addr) + (offset >> 5);
int set = 0, bit = offset & 31, res;
if (bit) {
__asm__("bsfl %1,%0\n\t"
"jne 1f\n\t"
"movl $32, %0\n"
"1:"
: "=r" (set)
: "r" (~(*p >> bit)));
if (set < (32 - bit))
return set + offset;
set = 32 - bit;
p++;
}
res = find_first_zero_bit (p, size - 32 * (p - (unsigned long *) addr));
return (offset + set + res);
}
extern __inline__ unsigned long ffz(unsigned long word)
{
__asm__("bsfl %1,%0"
:"=r" (word)
:"r" (~word));
return word;
}
struct intel_mp_floating
{
char mpf_signature[4];
unsigned long mpf_physptr;
unsigned char mpf_length;
unsigned char mpf_specification;
unsigned char mpf_checksum;
unsigned char mpf_feature1;
unsigned char mpf_feature2;
unsigned char mpf_feature3;
unsigned char mpf_feature4;
unsigned char mpf_feature5;
};
struct mp_config_table
{
char mpc_signature[4];
unsigned short mpc_length;
char mpc_spec;
char mpc_checksum;
char mpc_oem[8];
char mpc_productid[12];
unsigned long mpc_oemptr;
unsigned short mpc_oemsize;
unsigned short mpc_oemcount;
unsigned long mpc_lapic;
unsigned long reserved;
};
struct mpc_config_processor
{
unsigned char mpc_type;
unsigned char mpc_apicid;
unsigned char mpc_apicver;
unsigned char mpc_cpuflag;
unsigned long mpc_cpufeature;
unsigned long mpc_featureflag;
unsigned long mpc_reserved[2];
};
struct mpc_config_bus
{
unsigned char mpc_type;
unsigned char mpc_busid;
unsigned char mpc_bustype[6] __attribute((packed));
};
struct mpc_config_ioapic
{
unsigned char mpc_type;
unsigned char mpc_apicid;
unsigned char mpc_apicver;
unsigned char mpc_flags;
unsigned long mpc_apicaddr;
};
struct mpc_config_intsrc
{
unsigned char mpc_type;
unsigned char mpc_irqtype;
unsigned short mpc_irqflag;
unsigned char mpc_srcbus;
unsigned char mpc_srcbusirq;
unsigned char mpc_dstapic;
unsigned char mpc_dstirq;
};
struct mpc_config_intlocal
{
unsigned char mpc_type;
unsigned char mpc_irqtype;
unsigned short mpc_irqflag;
unsigned char mpc_srcbusid;
unsigned char mpc_srcbusirq;
unsigned char mpc_destapic;
unsigned char mpc_destapiclint;
};
struct cpuinfo_x86
{
char hard_math;
char x86;
char x86_model;
char x86_mask;
char x86_vendor_id[16];
int x86_capability;
int fdiv_bug;
int have_cpuid;
char wp_works_ok;
char hlt_works_ok;
unsigned long udelay_val;
};
extern struct cpuinfo_x86 cpu_data[32 ];
extern int smp_found_config;
extern int smp_scan_config(unsigned long, unsigned long);
extern unsigned long smp_alloc_memory(unsigned long mem_base);
extern unsigned char *apic_reg;
extern unsigned char boot_cpu_id;
extern unsigned long cpu_present_map;
extern volatile int cpu_number_map[32 ];
extern volatile int cpu_logical_map[32 ];
extern volatile unsigned long smp_invalidate_needed;
extern void smp_flush_tlb(void);
extern volatile unsigned long kernel_flag, kernel_counter;
extern volatile unsigned long cpu_callin_map[32 ];
extern volatile unsigned char active_kernel_processor;
extern void smp_message_irq(int cpl, void *dev_id, struct pt_regs *regs);
extern void smp_reschedule_irq(int cpl, struct pt_regs *regs);
extern unsigned long ipi_count;
extern void smp_invalidate_rcv(void);
extern void smp_local_timer_interrupt(struct pt_regs * regs);
extern void setup_APIC_clock (void);
extern void smp_callin(void);
extern void smp_boot_cpus(void);
extern void smp_store_cpu_info(int id);
extern volatile unsigned long smp_proc_in_lock[32 ];
extern volatile int smp_process_available;
extern __inline void apic_write(unsigned long reg, unsigned long v)
{
*((volatile unsigned long *)(apic_reg+reg))=v;
}
extern __inline unsigned long apic_read(unsigned long reg)
{
return *((volatile unsigned long *)(apic_reg+reg));
}
extern __inline int hard_smp_processor_id(void)
{
return ((( *(unsigned long *)(apic_reg+ 0x20 ) )>>24)&0x0F) ;
}
extern void smp_message_pass(int target, int msg, unsigned long data, int wait);
extern void smp_boot_cpus(void);
extern void smp_callin(void);
extern void smp_commence(void);
extern int smp_num_cpus;
extern int smp_threads_ready;
extern volatile unsigned long smp_spins[32 ];
extern volatile unsigned long smp_spins_sys_idle[];
extern volatile unsigned long smp_spins_syscall[];
extern volatile unsigned long smp_spins_syscall_cur[];
extern volatile unsigned long smp_idle_count[1+ 32 ];
extern volatile unsigned long smp_idle_map;
extern volatile unsigned long smp_msg_data;
extern volatile int smp_src_cpu;
extern volatile int smp_msg_id;
struct wait_queue {
struct task_struct * task;
struct wait_queue * next;
};
static inline void init_waitqueue(struct wait_queue **q)
{
*q = ((struct wait_queue *)(( q )-1)) ;
}
static inline int waitqueue_active(struct wait_queue **q)
{
struct wait_queue *head = *q;
return head && head != ((struct wait_queue *)(( q )-1)) ;
}
struct poll_table_entry {
struct wait_queue wait;
struct wait_queue ** wait_address;
};
typedef struct poll_table_struct {
unsigned int nr;
struct poll_table_entry * entry;
} poll_table;
typedef __kernel_fsid_t fsid_t;
struct statfs {
long f_type;
long f_bsize;
long f_blocks;
long f_bfree;
long f_bavail;
long f_files;
long f_ffree;
__kernel_fsid_t f_fsid;
long f_namelen;
long f_spare[6];
};
struct iovec
{
void *iov_base;
__kernel_size_t iov_len;
};
typedef unsigned short sa_family_t;
struct sockaddr
{
sa_family_t sa_family;
char sa_data[14];
};
struct linger {
int l_onoff;
int l_linger;
};
struct msghdr
{
void * msg_name;
int msg_namelen;
struct iovec * msg_iov;
__kernel_size_t msg_iovlen;
void * msg_control;
__kernel_size_t msg_controllen;
unsigned msg_flags;
};
struct cmsghdr {
__kernel_size_t cmsg_len;
int cmsg_level;
int cmsg_type;
};
extern __inline__ struct cmsghdr * cmsg_nxthdr(struct msghdr *mhdr,
struct cmsghdr *cmsg)
{
unsigned char * ptr;
if (cmsg->cmsg_len < sizeof(struct cmsghdr))
{
return ((void *) 0) ;
}
ptr = ((unsigned char *) cmsg) + ( (( cmsg->cmsg_len )+sizeof(long)-1) & ~(sizeof(long)-1) ) ;
if (ptr >= (unsigned char *) mhdr->msg_control + mhdr->msg_controllen)
return ((void *) 0) ;
return (struct cmsghdr *) ptr;
}
struct ucred
{
__kernel_pid_t pid;
__kernel_uid_t uid;
__kernel_gid_t gid;
};
extern int memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len);
extern int memcpy_fromiovecend(unsigned char *kdata, struct iovec *iov,
int offset, int len);
extern unsigned int csum_partial_copy_fromiovecend(unsigned char *kdata,
struct iovec *iov,
int offset,
int len, int csum);
extern int verify_iovec(struct msghdr *m, struct iovec *iov, char *address, int mode);
extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len);
extern int move_addr_to_user(void *kaddr, int klen, void *uaddr, int *ulen);
extern int move_addr_to_kernel(void *uaddr, int ulen, void *kaddr);
extern void put_cmsg(struct msghdr*, int level, int type, int len, void *data);
typedef enum {
SS_FREE = 0,
SS_UNCONNECTED,
SS_CONNECTING,
SS_CONNECTED,
SS_DISCONNECTING
} socket_state;
struct socket
{
socket_state state;
unsigned long flags;
struct proto_ops *ops;
struct inode *inode;
struct fasync_struct *fasync_list;
struct file *file;
struct sock *sk;
struct wait_queue *wait;
short type;
unsigned char passcred;
unsigned char tli;
};
struct scm_cookie;
struct proto_ops {
int family;
int (*dup) (struct socket *newsock, struct socket *oldsock);
int (*release) (struct socket *sock, struct socket *peer);
int (*bind) (struct socket *sock, struct sockaddr *umyaddr,
int sockaddr_len);
int (*connect) (struct socket *sock, struct sockaddr *uservaddr,
int sockaddr_len, int flags);
int (*socketpair) (struct socket *sock1, struct socket *sock2);
int (*accept) (struct socket *sock, struct socket *newsock,
int flags);
int (*getname) (struct socket *sock, struct sockaddr *uaddr,
int *usockaddr_len, int peer);
unsigned int (*poll) (struct socket *sock, poll_table *wait);
int (*ioctl) (struct socket *sock, unsigned int cmd,
unsigned long arg);
int (*listen) (struct socket *sock, int len);
int (*shutdown) (struct socket *sock, int flags);
int (*setsockopt) (struct socket *sock, int level, int optname,
char *optval, int optlen);
int (*getsockopt) (struct socket *sock, int level, int optname,
char *optval, int *optlen);
int (*fcntl) (struct socket *sock, unsigned int cmd,
unsigned long arg);
int (*sendmsg) (struct socket *sock, struct msghdr *m, int total_len, struct scm_cookie *scm);
int (*recvmsg) (struct socket *sock, struct msghdr *m, int total_len, int flags, struct scm_cookie *scm);
};
struct net_proto_family
{
int family;
int (*create)(struct socket *sock, int protocol);
short authentication;
short encryption;
short encrypt_net;
};
struct net_proto
{
const char *name;
void (*init_func)(struct net_proto *);
};
extern struct net_proto_family *net_families[];
extern int sock_wake_async(struct socket *sk, int how);
extern int sock_register(struct net_proto_family *fam);
extern int sock_unregister(int family);
extern struct socket *sock_alloc(void);
extern int sock_create(int family, int type, int proto, struct socket **);
extern void sock_release(struct socket *);
extern int sock_sendmsg(struct socket *, struct msghdr *m, int len);
extern int sock_recvmsg(struct socket *, struct msghdr *m, int len, int flags);
extern int sock_readv_writev(int type, struct inode * inode, struct file * file,
const struct iovec * iov, long count, long size);
int net_ratelimit(void);
typedef unsigned short kdev_t;
extern char * kdevname(kdev_t);
static inline unsigned int kdev_t_to_nr(kdev_t dev) {
return (((unsigned int) (( dev ) >> 8 )) <<8) | ((unsigned int) (( dev ) & ((1U << 8 ) - 1) )) ;
}
static inline kdev_t to_kdev_t(int dev)
{
int major, minor;
major = (dev >> 8);
minor = (dev & 0xff);
return ((( major ) << 8 ) | ( minor )) ;
}
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);
}
static inline void __list_del(struct list_head * prev, struct list_head * next)
{
next->prev = prev;
prev->next = next;
}
static inline void list_del(struct list_head *entry)
{
__list_del(entry->prev, entry->next);
}
static inline int list_empty(struct list_head *head)
{
return head->next == head;
}
static inline void list_splice(struct list_head *list, struct list_head *head)
{
struct list_head *first = list->next;
if (first != list) {
struct list_head *last = list->prev;
struct list_head *at = head->next;
first->prev = head;
head->next = first;
last->next = at;
at->prev = last;
}
}
struct qstr {
const unsigned char * name;
unsigned int len, hash;
};
static inline unsigned long partial_name_hash(unsigned char c, unsigned long prevhash)
{
prevhash = (prevhash << 4) | (prevhash >> (8*sizeof(unsigned long)-4));
return prevhash ^ c;
}
static inline unsigned long end_name_hash(unsigned long hash)
{
if (sizeof(hash) > sizeof(unsigned int))
hash += hash >> 4*sizeof(hash);
return (unsigned int) hash;
}
struct dentry {
int d_count;
unsigned int d_flags;
struct inode * d_inode;
struct dentry * d_parent;
struct dentry * d_mounts;
struct dentry * d_covers;
struct list_head d_hash;
struct list_head d_lru;
struct qstr d_name;
unsigned long d_time;
struct dentry_operations *d_op;
struct super_block * d_sb;
};
struct dentry_operations {
int (*d_revalidate)(struct dentry *);
int (*d_hash) (struct dentry *,struct qstr *);
int (*d_compare) (struct dentry *,struct qstr *, struct qstr *);
void (*d_delete)(struct dentry *);
};
static inline void d_drop(struct dentry * dentry)
{
list_del(&dentry->d_hash);
do { ( &dentry->d_hash )->next = ( &dentry->d_hash ); ( &dentry->d_hash )->prev = ( &dentry->d_hash ); } while (0) ;
}
extern void d_instantiate(struct dentry *, struct inode *);
extern void d_delete(struct dentry *);
extern struct dentry * d_alloc(struct dentry * parent, const struct qstr *name);
extern void prune_dcache(int);
extern void shrink_dcache_sb(struct super_block *);
extern int d_invalidate(struct dentry *);
extern struct dentry * d_alloc_root(struct inode * root_inode, struct dentry * old_root);
extern void d_add(struct dentry * entry, struct inode * inode);
extern void d_move(struct dentry * entry, struct dentry * newdentry);
extern struct dentry * d_lookup(struct dentry * dir, struct qstr * name);
extern int d_validate(struct dentry *dentry, struct dentry *dparent,
unsigned int hash, unsigned int len);
extern char * d_path(struct dentry * entry, char * buf, int buflen);
static inline struct dentry * dget(struct dentry *dentry)
{
if (dentry)
dentry->d_count++;
return dentry;
}
extern void dput(struct dentry *);
extern int max_inodes;
extern int max_files, nr_files, nr_free_files;
extern unsigned long int ntohl(unsigned long int);
extern unsigned short int ntohs(unsigned short int);
extern unsigned long int htonl(unsigned long int);
extern unsigned short int htons(unsigned short int);
extern __inline__ unsigned long int __ntohl(unsigned long int);
extern __inline__ unsigned short int __ntohs(unsigned short int);
extern __inline__ unsigned long int __constant_ntohl(unsigned long int);
extern __inline__ unsigned short int __constant_ntohs(unsigned short int);
extern __inline__ unsigned long int
__ntohl(unsigned long int x)
{
__asm__("bswap %0" : "=r" (x) : "0" (x));
return x;
}
extern __inline__ unsigned short int
__ntohs(unsigned short int x)
{
__asm__("xchgb %b0,%h0"
: "=q" (x)
: "0" (x));
return x;
}
extern __inline__ __u16 cpu_to_le16p(__u16 *addr)
{
return ( *addr ) ;
}
extern __inline__ __u32 cpu_to_le32p(__u32 *addr)
{
return ( *addr ) ;
}
extern __inline__ __u16 cpu_to_be16p(__u16 *addr)
{
return (__builtin_constant_p((short)( ( *addr ) )) ? ((unsigned short int)((((unsigned short int)( ( ( *addr ) ) ) & 0x00ff) << 8) | (((unsigned short int)( ( ( *addr ) ) ) & 0xff00) >> 8))) : __ntohs( ( ( *addr ) ) ) ) ;
}
extern __inline__ __u32 cpu_to_be32p(__u32 *addr)
{
return (__builtin_constant_p((long)( ( *addr ) )) ? ((unsigned long int)((((unsigned long int)( ( ( *addr ) ) ) & 0x000000ffU) << 24) | (((unsigned long int)( ( ( *addr ) ) ) & 0x0000ff00U) << 8) | (((unsigned long int)( ( ( *addr ) ) ) & 0x00ff0000U) >> 8) | (((unsigned long int)( ( ( *addr ) ) ) & 0xff000000U) >> 24))) : __ntohl( ( ( *addr ) ) ) ) ;
}
extern __inline__ void cpu_to_be16s(__u16 *addr)
{
*addr = (__builtin_constant_p((short)( ( *addr ) )) ? ((unsigned short int)((((unsigned short int)( ( ( *addr ) ) ) & 0x00ff) << 8) | (((unsigned short int)( ( ( *addr ) ) ) & 0xff00) >> 8))) : __ntohs( ( ( *addr ) ) ) ) ;
}
extern __inline__ void cpu_to_be32s(__u32 *addr)
{
*addr = (__builtin_constant_p((long)( ( *addr ) )) ? ((unsigned long int)((((unsigned long int)( ( ( *addr ) ) ) & 0x000000ffU) << 24) | (((unsigned long int)( ( ( *addr ) ) ) & 0x0000ff00U) << 8) | (((unsigned long int)( ( ( *addr ) ) ) & 0x00ff0000U) >> 8) | (((unsigned long int)( ( ( *addr ) ) ) & 0xff000000U) >> 24))) : __ntohl( ( ( *addr ) ) ) ) ;
}
extern void buffer_init(void);
extern void inode_init(void);
extern void file_table_init(void);
extern void dcache_init(void);
typedef char buffer_block[1024 ];
struct buffer_head {
struct buffer_head * b_next;
unsigned long b_blocknr;
unsigned long b_size;
kdev_t b_dev;
kdev_t b_rdev;
unsigned long b_rsector;
struct buffer_head * b_this_page;
unsigned long b_state;
struct buffer_head * b_next_free;
unsigned int b_count;
char * b_data;
unsigned int b_list;
unsigned long b_flushtime;
unsigned long b_lru_time;
struct wait_queue * b_wait;
struct buffer_head ** b_pprev;
struct buffer_head * b_prev_free;
struct buffer_head * b_reqnext;
};
static inline int buffer_uptodate(struct buffer_head * bh)
{
return (__builtin_constant_p( 0 ) ? __constant_test_bit(( 0 ),( &bh->b_state )) : __test_bit(( 0 ),( &bh->b_state ))) ;
}
static inline int buffer_dirty(struct buffer_head * bh)
{
return (__builtin_constant_p( 1 ) ? __constant_test_bit(( 1 ),( &bh->b_state )) : __test_bit(( 1 ),( &bh->b_state ))) ;
}
static inline int buffer_locked(struct buffer_head * bh)
{
return (__builtin_constant_p( 2 ) ? __constant_test_bit(( 2 ),( &bh->b_state )) : __test_bit(( 2 ),( &bh->b_state ))) ;
}
static inline int buffer_req(struct buffer_head * bh)
{
return (__builtin_constant_p( 3 ) ? __constant_test_bit(( 3 ),( &bh->b_state )) : __test_bit(( 3 ),( &bh->b_state ))) ;
}
static inline int buffer_touched(struct buffer_head * bh)
{
return (__builtin_constant_p( 4 ) ? __constant_test_bit(( 4 ),( &bh->b_state )) : __test_bit(( 4 ),( &bh->b_state ))) ;
}
static inline int buffer_has_aged(struct buffer_head * bh)
{
return (__builtin_constant_p( 5 ) ? __constant_test_bit(( 5 ),( &bh->b_state )) : __test_bit(( 5 ),( &bh->b_state ))) ;
}
static inline int buffer_protected(struct buffer_head * bh)
{
return (__builtin_constant_p( 6 ) ? __constant_test_bit(( 6 ),( &bh->b_state )) : __test_bit(( 6 ),( &bh->b_state ))) ;
}
struct pipe_inode_info {
struct wait_queue * wait;
char * base;
unsigned int start;
unsigned int lock;
unsigned int rd_openers;
unsigned int wr_openers;
unsigned int readers;
unsigned int writers;
};
struct minix_inode_info {
union {
__u16 i1_data[16];
__u32 i2_data[16];
} u;
};
struct ext2_inode_info {
__u32 i_data[15];
__u32 i_flags;
__u32 i_faddr;
__u8 i_frag_no;
__u8 i_frag_size;
__u16 i_osync;
__u32 i_file_acl;
__u32 i_dir_acl;
__u32 i_dtime;
__u32 i_version;
__u32 i_block_group;
__u32 i_next_alloc_block;
__u32 i_next_alloc_goal;
__u32 i_prealloc_block;
__u32 i_prealloc_count;
int i_new_inode:1;
};
struct hpfs_inode_info {
ino_t i_parent_dir;
unsigned i_dno;
unsigned i_dpos;
unsigned i_dsubdno;
unsigned i_file_sec;
unsigned i_disk_sec;
unsigned i_n_secs;
unsigned i_conv : 2;
};
struct msdos_inode_info {
struct pipe_inode_info reserved;
int i_start;
int i_attrs;
int i_busy;
struct inode *i_depend;
struct inode *i_old;
struct inode *i_linked;
struct inode *i_oldlink;
int i_binary;
};
struct dir_locking_info {
struct wait_queue *p;
short int looking;
short int creating;
long pid;
};
struct umsdos_inode_info {
union {
struct msdos_inode_info msdos_info;
struct pipe_inode_info pipe_info;
struct dir_locking_info dir_info;
}u;
unsigned long i_dir_owner;
unsigned long i_emd_owner;
off_t pos;
unsigned long i_emd_dir;
};
struct iso_inode_info {
unsigned int i_first_extent;
unsigned char i_file_format;
};
enum rpc_auth_flavor {
RPC_AUTH_NULL = 0,
RPC_AUTH_UNIX = 1,
RPC_AUTH_SHORT = 2,
RPC_AUTH_DES = 3,
RPC_AUTH_KRB = 4,
};
enum rpc_msg_type {
RPC_CALL = 0,
RPC_REPLY = 1
};
enum rpc_reply_stat {
RPC_MSG_ACCEPTED = 0,
RPC_MSG_DENIED = 1
};
enum rpc_accept_stat {
RPC_SUCCESS = 0,
RPC_PROG_UNAVAIL = 1,
RPC_PROG_MISMATCH = 2,
RPC_PROC_UNAVAIL = 3,
RPC_GARBAGE_ARGS = 4,
RPC_SYSTEM_ERR = 5
};
enum rpc_reject_stat {
RPC_MISMATCH = 0,
RPC_AUTH_ERROR = 1
};
enum rpc_auth_stat {
RPC_AUTH_OK = 0,
RPC_AUTH_BADCRED = 1,
RPC_AUTH_REJECTEDCRED = 2,
RPC_AUTH_BADVERF = 3,
RPC_AUTH_REJECTEDVERF = 4,
RPC_AUTH_TOOWEAK = 5
};
enum nfs_stat {
NFS_OK = 0,
NFSERR_PERM = 1,
NFSERR_NOENT = 2,
NFSERR_IO = 5,
NFSERR_NXIO = 6,
NFSERR_EAGAIN = 11,
NFSERR_ACCES = 13,
NFSERR_EXIST = 17,
NFSERR_NODEV = 19,
NFSERR_NOTDIR = 20,
NFSERR_ISDIR = 21,
NFSERR_INVAL = 22,
NFSERR_FBIG = 27,
NFSERR_NOSPC = 28,
NFSERR_ROFS = 30,
NFSERR_NAMETOOLONG = 63,
NFSERR_NOTEMPTY = 66,
NFSERR_DQUOT = 69,
NFSERR_STALE = 70,
NFSERR_WFLUSH = 99
};
enum nfs_ftype {
NFNON = 0,
NFREG = 1,
NFDIR = 2,
NFBLK = 3,
NFCHR = 4,
NFLNK = 5,
NFSOCK = 6,
NFBAD = 7,
NFFIFO = 8
};
struct nfs_fh {
char data[32 ];
};
extern struct rpc_program nfs_program;
extern struct rpc_stat nfs_rpcstat;
struct nfs_time {
__u32 seconds;
__u32 useconds;
};
struct nfs_fattr {
enum nfs_ftype type;
__u32 mode;
__u32 nlink;
__u32 uid;
__u32 gid;
__u32 size;
__u32 blocksize;
__u32 rdev;
__u32 blocks;
__u32 fsid;
__u32 fileid;
struct nfs_time atime;
struct nfs_time mtime;
struct nfs_time ctime;
};
struct nfs_sattr {
__u32 mode;
__u32 uid;
__u32 gid;
__u32 size;
struct nfs_time atime;
struct nfs_time mtime;
};
struct nfs_fsinfo {
__u32 tsize;
__u32 bsize;
__u32 blocks;
__u32 bfree;
__u32 bavail;
};
struct nfs_sattrargs {
struct nfs_fh * fh;
struct nfs_sattr * sattr;
};
struct nfs_diropargs {
struct nfs_fh * fh;
const char * name;
};
struct nfs_readargs {
struct nfs_fh * fh;
__u32 offset;
__u32 count;
void * buffer;
};
struct nfs_writeargs {
struct nfs_fh * fh;
__u32 offset;
__u32 count;
const void * buffer;
};
struct nfs_createargs {
struct nfs_fh * fh;
const char * name;
struct nfs_sattr * sattr;
};
struct nfs_renameargs {
struct nfs_fh * fromfh;
const char * fromname;
struct nfs_fh * tofh;
const char * toname;
};
struct nfs_linkargs {
struct nfs_fh * fromfh;
struct nfs_fh * tofh;
const char * toname;
};
struct nfs_symlinkargs {
struct nfs_fh * fromfh;
const char * fromname;
const char * topath;
struct nfs_sattr * sattr;
};
struct nfs_readdirargs {
struct nfs_fh * fh;
__u32 cookie;
void * buffer;
unsigned int bufsiz;
};
struct nfs_diropok {
struct nfs_fh * fh;
struct nfs_fattr * fattr;
};
struct nfs_readres {
struct nfs_fattr * fattr;
unsigned int count;
};
struct nfs_readlinkres {
char ** string;
unsigned int * lenp;
unsigned int maxlen;
void * buffer;
};
struct nfs_readdirres {
void * buffer;
unsigned int bufsiz;
};
struct nfs_inode_info {
struct pipe_inode_info pipeinfo;
struct nfs_fh fhandle;
unsigned short flags;
unsigned long read_cache_jiffies;
unsigned long read_cache_mtime;
unsigned long attrtimeo;
struct nfs_wreq * writeback;
};
struct nfs_lock_info {
u32 state;
u32 flags;
};
struct sysv_inode_info {
unsigned long i_data[10+1+1+1];
};
struct exec
{
unsigned long a_info;
unsigned a_text;
unsigned a_data;
unsigned a_bss;
unsigned a_syms;
unsigned a_entry;
unsigned a_trsize;
unsigned a_drsize;
};
enum machine_type {
M_OLDSUN2 = 0,
M_68010 = 1,
M_68020 = 2,
M_SPARC = 3,
M_386 = 100,
M_MIPS1 = 151,
M_MIPS2 = 152,
};
\f
struct nlist {
union {
char *n_name;
struct nlist *n_next;
long n_strx;
} n_un;
unsigned char n_type;
char n_other;
short n_desc;
unsigned long n_value;
};
\f
struct relocation_info
{
int r_address;
unsigned int r_symbolnum:24;
unsigned int r_pcrel:1;
unsigned int r_length:2;
unsigned int r_extern:1;
unsigned int r_pad:4;
};
struct timespec {
long tv_sec;
long tv_nsec;
};
struct timeval {
int tv_sec;
int tv_usec;
};
struct timezone {
int tz_minuteswest;
int tz_dsttime;
};
extern void do_gettimeofday(struct timeval *tv);
extern void do_settimeofday(struct timeval *tv);
extern void get_fast_time(struct timeval *tv);
extern void (*do_get_fast_time)(struct timeval *);
struct itimerspec {
struct timespec it_interval;
struct timespec it_value;
};
struct itimerval {
struct timeval it_interval;
struct timeval it_value;
};
struct key_cache {
struct timeval kc_lru_time;
s32 kc_first;
s32 kc_last;
s32 kc_this_key;
int kc_this_seq;
s32 kc_next_key;
s32 kc_keys[73 ];
};
struct ext_cache {
struct key_cache kc[4];
s32 ec[((1UL << 12 ) - 4 * sizeof(struct key_cache) - 4) / 4 ];
int max_ext;
};
struct affs_inode_info {
u32 i_protect;
s32 i_parent;
s32 i_original;
s32 i_data[16 ];
struct ext_cache *i_ec;
int i_cache_users;
int i_lastblock;
short i_pa_cnt;
short i_pa_next;
short i_pa_last;
short i_zone;
unsigned char i_hlink;
unsigned char i_pad;
};
struct ufs_inode_info {
__u32 i_data[15];
__u64 i_size;
__u32 i_flags;
__u32 i_gen;
__u32 i_shadow;
__u32 i_uid;
__u32 i_gid;
__u32 i_oeftflag;
};
struct romfs_inode_info {
unsigned long i_metasize;
unsigned long i_dataoffset;
};
struct smb_inode_info {
unsigned int open;
__u16 fileid;
__u16 attr;
__u16 access;
__u16 cache_valid;
unsigned long oldmtime;
void * dentry;
};
struct iattr {
unsigned int ia_valid;
umode_t ia_mode;
uid_t ia_uid;
gid_t ia_gid;
off_t ia_size;
time_t ia_atime;
time_t ia_mtime;
time_t ia_ctime;
unsigned int ia_attr_flags;
};
struct dqblk {
__u32 dqb_bhardlimit;
__u32 dqb_bsoftlimit;
__u32 dqb_curblocks;
__u32 dqb_ihardlimit;
__u32 dqb_isoftlimit;
__u32 dqb_curinodes;
time_t dqb_btime;
time_t dqb_itime;
};
struct dqstats {
__u32 lookups;
__u32 drops;
__u32 reads;
__u32 writes;
__u32 cache_hits;
__u32 pages_allocated;
__u32 allocated_dquots;
__u32 free_dquots;
__u32 syncs;
};
struct vfsmount
{
kdev_t mnt_dev;
char *mnt_devname;
char *mnt_dirname;
unsigned int mnt_flags;
struct semaphore mnt_sem;
struct super_block *mnt_sb;
struct file *mnt_quotas[2 ];
time_t mnt_iexp[2 ];
time_t mnt_bexp[2 ];
struct vfsmount *mnt_next;
};
struct vfsmount *lookup_vfsmnt(kdev_t dev);
struct dquot {
unsigned int dq_id;
short dq_type;
kdev_t dq_dev;
short dq_flags;
short dq_count;
struct vfsmount *dq_mnt;
struct dqblk dq_dqb;
struct wait_queue *dq_wait;
struct dquot *dq_prev;
struct dquot *dq_next;
struct dquot *dq_hash_prev;
struct dquot *dq_hash_next;
};
extern void dquot_initialize(struct inode *inode, short type);
extern void dquot_drop(struct inode *inode);
extern int dquot_alloc_block(const struct inode *inode, unsigned long number);
extern int dquot_alloc_inode(const struct inode *inode, unsigned long number);
extern void dquot_free_block(const struct inode *inode, unsigned long number);
extern void dquot_free_inode(const struct inode *inode, unsigned long number);
extern int dquot_transfer(struct inode *inode, struct iattr *iattr, char direction);
extern void invalidate_dquots(kdev_t dev, short type);
extern int quota_off(kdev_t dev, short type);
extern int sync_dquots(kdev_t dev, short type);
struct inode {
struct list_head i_hash;
struct list_head i_list;
unsigned long i_ino;
kdev_t i_dev;
unsigned short i_count;
umode_t i_mode;
nlink_t i_nlink;
uid_t i_uid;
gid_t i_gid;
kdev_t i_rdev;
off_t i_size;
time_t i_atime;
time_t i_mtime;
time_t i_ctime;
unsigned long i_blksize;
unsigned long i_blocks;
unsigned long i_version;
unsigned long i_nrpages;
struct semaphore i_sem;
struct inode_operations *i_op;
struct super_block *i_sb;
struct wait_queue *i_wait;
struct file_lock *i_flock;
struct vm_area_struct *i_mmap;
struct page *i_pages;
struct dquot *i_dquot[2 ];
unsigned long i_state;
unsigned int i_flags;
unsigned char i_pipe;
unsigned char i_sock;
int i_writecount;
unsigned int i_attr_flags;
union {
struct pipe_inode_info pipe_i;
struct minix_inode_info minix_i;
struct ext2_inode_info ext2_i;
struct hpfs_inode_info hpfs_i;
struct msdos_inode_info msdos_i;
struct umsdos_inode_info umsdos_i;
struct iso_inode_info isofs_i;
struct nfs_inode_info nfs_i;
struct sysv_inode_info sysv_i;
struct affs_inode_info affs_i;
struct ufs_inode_info ufs_i;
struct romfs_inode_info romfs_i;
struct smb_inode_info smbfs_i;
struct socket socket_i;
void *generic_ip;
} u;
};
extern void __mark_inode_dirty(struct inode *);
static inline void mark_inode_dirty(struct inode *inode)
{
if (!(inode->i_state & 1 ))
__mark_inode_dirty(inode);
}
struct fown_struct {
int pid;
uid_t uid, euid;
};
struct file {
struct file *f_next, **f_pprev;
struct dentry *f_dentry;
struct file_operations *f_op;
mode_t f_mode;
loff_t f_pos;
unsigned short f_count, f_flags;
unsigned long f_reada, f_ramax, f_raend, f_ralen, f_rawin;
struct fown_struct f_owner;
unsigned long f_version;
void *private_data;
};
extern inline void * __memset_generic(void * s, char c,size_t count)
{
__asm__ __volatile__(
"cld\n\t"
"rep\n\t"
"stosb"
:
:"a" (c),"D" (s),"c" (count)
:"cx","di","memory");
return s;
}
extern inline void * __constant_c_memset(void * s, unsigned long c, size_t count)
{
__asm__ __volatile__(
"cld\n\t"
"rep ; stosl\n\t"
"testb $2,%b1\n\t"
"je 1f\n\t"
"stosw\n"
"1:\ttestb $1,%b1\n\t"
"je 2f\n\t"
"stosb\n"
"2:"
:
:"a" (c), "q" (count), "c" (count/4), "D" ((long) s)
:"cx","di","memory");
return (s);
}
extern inline void * __constant_c_and_count_memset(void * s, unsigned long pattern, size_t count)
{
switch (count) {
case 0:
return s;
case 1:
*(unsigned char *)s = pattern;
return s;
case 2:
*(unsigned short *)s = pattern;
return s;
case 3:
*(unsigned short *)s = pattern;
*(2+(unsigned char *)s) = pattern;
return s;
case 4:
*(unsigned long *)s = pattern;
return s;
}
switch (count % 4) {
case 0: __asm__("cld\n\t" "rep ; stosl" "" : : "a" (pattern),"c" (count/4),"D" ((long) s) : "cx","di","memory") ; return s;
case 1: __asm__("cld\n\t" "rep ; stosl" "\n\tstosb" : : "a" (pattern),"c" (count/4),"D" ((long) s) : "cx","di","memory") ; return s;
case 2: __asm__("cld\n\t" "rep ; stosl" "\n\tstosw" : : "a" (pattern),"c" (count/4),"D" ((long) s) : "cx","di","memory") ; return s;
case 3: __asm__("cld\n\t" "rep ; stosl" "\n\tstosw\n\tstosb" : : "a" (pattern),"c" (count/4),"D" ((long) s) : "cx","di","memory") ; return s;
}
}
typedef struct page {
struct page *next;
struct page *prev;
struct inode *inode;
unsigned long offset;
struct page *next_hash;
atomic_t count;
unsigned int age;
unsigned long flags;
struct wait_queue *wait;
struct page **pprev_hash;
struct buffer_head * buffers;
unsigned long pg_swap_entry;
unsigned long map_nr;
} mem_map_t;
int
nfs_readpage_sync(struct inode *inode, struct page *page)
{
unsigned long offset = page->offset;
char *buffer = (char *) page_address(page);
int rsize;
int result, refresh = 0;
int count = (1UL << 12 ) ;
int flags = (0) ? (0x0008 | 0x0100 ) : 0;
do { printk("NFS: nfs_readpage_sync(%p)\n", page ); } while(0) ;
clear_bit(1 , &page->flags);
do {
if (count < rsize)
rsize = count;
do { printk("NFS: nfs_proc_read(%s, (%x,%lx), %ld, %d, %p)\n",
0, inode->i_dev,
inode->i_ino, offset, rsize, buffer ); } while(0) ;
result = rpc_do_call( 0, 6 ,
0, 0, flags , ((void *) 0) , ((void *) 0) ) ;
if (result < 0) {
if (result == - 21 )
result = - 22 ;
goto io_error;
}
count -= result;
offset += result;
buffer += result;
} while (count);
(__builtin_constant_p( 0 ) ? (__builtin_constant_p( ( count ) ) ? __constant_c_and_count_memset(( ( buffer ) ),( (0x01010101UL*(unsigned char) 0 ) ),( ( count ) )) : __constant_c_memset(( ( buffer ) ),( (0x01010101UL*(unsigned char) 0 ) ),( ( count ) ))) : (__builtin_constant_p( ( count ) ) ? __memset_generic(( ( ( buffer ) ) ),( ( ( 0 ) ) ),( ( ( count ) ) )) : __memset_generic(( ( buffer ) ),( ( 0 ) ),( ( count ) ))) ) ;
set_bit(3 , &page->flags);
io_error:
if (refresh)
nfs_refresh_inode(inode, 0);
return result;
}
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: PPro and egcs
1997-10-25 19:03 PPro and egcs H.J. Lu
@ 1997-10-26 0:48 ` Mumit Khan
1997-10-27 0:08 ` Jeffrey A Law
` (2 subsequent siblings)
3 siblings, 0 replies; 23+ messages in thread
From: Mumit Khan @ 1997-10-26 0:48 UTC (permalink / raw)
To: H.J. Lu; +Cc: egcs
hjl@lucon.org (H.J. Lu) writes:
> Hi,
>
> Has anyone tried egcs on PPro? I got an error.
>
> # gcc -O -march=i686 -S foo.c -fomit-frame-pointer
> foo.c: In function `nfs_readpage_sync':
> foo.c:1618: internal error--insn does not satisfy its constraints:
> (insn 317 316 139 (parallel[
> (set (reg/v:SI 3 %ebx)
> (if_then_else:SI (ne (cc0)
> (const_int 0))
> (reg:SI 0 %eax)
> (const_int -22)))
> (clobber (reg:SI 0 %eax))
> ] ) 374 {movsicc_1} (nil)
> (expr_list:REG_DEAD (reg:SI 0 %eax)
> (expr_list:REG_UNUSED (reg:SI 0 %eax)
> (nil))))
> gcc: Internal compiler error: program cc1 got fatal signal 6
>
Same here. Seems that -fomit-frame-pointer is what tweaks it.
Mumit
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: PPro and egcs
1997-10-25 19:03 PPro and egcs H.J. Lu
1997-10-26 0:48 ` Mumit Khan
@ 1997-10-27 0:08 ` Jeffrey A Law
1997-10-27 6:21 ` John Hassey
1997-10-27 13:05 ` H.J. Lu
1997-10-29 3:27 ` Jeffrey A Law
1997-10-31 15:24 ` Jeffrey A Law
3 siblings, 2 replies; 23+ messages in thread
From: Jeffrey A Law @ 1997-10-27 0:08 UTC (permalink / raw)
To: H.J. Lu; +Cc: egcs
In message < m0xPI2T-0004edC@ocean.lucon.org >you write:
> Hi,
>
> Has anyone tried egcs on PPro? I got an error.
>
> # gcc -O -march=i686 -S foo.c -fomit-frame-pointer
> foo.c: In function `nfs_readpage_sync':
> foo.c:1618: internal error--insn does not satisfy its constraints:
> (insn 317 316 139 (parallel[
> (set (reg/v:SI 3 %ebx)
> (if_then_else:SI (ne (cc0)
> (const_int 0))
> (reg:SI 0 %eax)
> (const_int -22)))
> (clobber (reg:SI 0 %eax))
> ] ) 374 {movsicc_1} (nil)
> (expr_list:REG_DEAD (reg:SI 0 %eax)
> (expr_list:REG_UNUSED (reg:SI 0 %eax)
> (nil))))
> gcc: Internal compiler error: program cc1 got fatal signal 6
I don't have a ppro, nor do I know anything about the architecture.
Can the cmov instruction accept a constant as a source operand?
If so, then I would think that changing "rm,0" to "rmi,0" and "0,rm" to "0,rmi"
in movsicc_1 would fix this problem (and generate better code). A similar change
to the other conditional move patterns would probably also be desirable.
Otherwise we'll have to come up with a more complicated fix.
jeff
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: PPro and egcs
1997-10-27 0:08 ` Jeffrey A Law
@ 1997-10-27 6:21 ` John Hassey
1997-10-27 13:05 ` H.J. Lu
1 sibling, 0 replies; 23+ messages in thread
From: John Hassey @ 1997-10-27 6:21 UTC (permalink / raw)
To: law; +Cc: H.J. Lu, egcs
Jeffrey A Law wrote:
> Can the cmov instruction accept a constant as a source operand?
No, only memory or register.
> Otherwise we'll have to come up with a more complicated fix.
When I worked on this, I had a lot of problems with constants and ended
up just punting and converting the cmov to a conditional branch around
a move.
john.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: PPro and egcs
1997-10-27 0:08 ` Jeffrey A Law
1997-10-27 6:21 ` John Hassey
@ 1997-10-27 13:05 ` H.J. Lu
1997-10-27 13:36 ` Jeffrey A Law
1 sibling, 1 reply; 23+ messages in thread
From: H.J. Lu @ 1997-10-27 13:05 UTC (permalink / raw)
To: law; +Cc: egcs
>
>
> In message < m0xPI2T-0004edC@ocean.lucon.org >you write:
> > Hi,
> >
> > Has anyone tried egcs on PPro? I got an error.
> >
> > # gcc -O -march=i686 -S foo.c -fomit-frame-pointer
> > foo.c: In function `nfs_readpage_sync':
> > foo.c:1618: internal error--insn does not satisfy its constraints:
> > (insn 317 316 139 (parallel[
> > (set (reg/v:SI 3 %ebx)
> > (if_then_else:SI (ne (cc0)
> > (const_int 0))
> > (reg:SI 0 %eax)
> > (const_int -22)))
> > (clobber (reg:SI 0 %eax))
> > ] ) 374 {movsicc_1} (nil)
> > (expr_list:REG_DEAD (reg:SI 0 %eax)
> > (expr_list:REG_UNUSED (reg:SI 0 %eax)
> > (nil))))
> > gcc: Internal compiler error: program cc1 got fatal signal 6
> I don't have a ppro, nor do I know anything about the architecture.
>
> Can the cmov instruction accept a constant as a source operand?
>
No. How about we do this?
If operands 2/3 are immediate operands, we emit
jmp next
.align 4
operand2:
.4bytes operand2
operand3:
.4bytes operand3
next:
cmovxx operand2,operand0
cmovyy operand3,operand0
Will this work?
H.J.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: PPro and egcs
1997-10-27 13:05 ` H.J. Lu
@ 1997-10-27 13:36 ` Jeffrey A Law
1997-10-27 16:30 ` H.J. Lu
0 siblings, 1 reply; 23+ messages in thread
From: Jeffrey A Law @ 1997-10-27 13:36 UTC (permalink / raw)
To: H.J. Lu; +Cc: egcs
--
Jeff Law (law@cygnus.com)
Cygnus Solutions EGCS GNU Compiler System
http://www.cygnus.com http://www.cygnus.com/egcs
In message < m0xPwLd-0004edC@ocean.lucon.org >you write:
> >
> >
> > In message < m0xPI2T-0004edC@ocean.lucon.org >you write:
> > > Hi,
> > >
> > > Has anyone tried egcs on PPro? I got an error.
> > >
> > > # gcc -O -march=i686 -S foo.c -fomit-frame-pointer
> > > foo.c: In function `nfs_readpage_sync':
> > > foo.c:1618: internal error--insn does not satisfy its constraints:
> > > (insn 317 316 139 (parallel[
> > > (set (reg/v:SI 3 %ebx)
> > > (if_then_else:SI (ne (cc0)
> > > (const_int 0))
> > > (reg:SI 0 %eax)
> > > (const_int -22)))
> > > (clobber (reg:SI 0 %eax))
> > > ] ) 374 {movsicc_1} (nil)
> > > (expr_list:REG_DEAD (reg:SI 0 %eax)
> > > (expr_list:REG_UNUSED (reg:SI 0 %eax)
> > > (nil))))
> > > gcc: Internal compiler error: program cc1 got fatal signal 6
> > I don't have a ppro, nor do I know anything about the architecture.
> >
> > Can the cmov instruction accept a constant as a source operand?
> >
>
> No. How about we do this?
>
> If operands 2/3 are immediate operands, we emit
>
>
> jmp next
> .align 4
> operand2:
> .4bytes operand2
> operand3:
> .4bytes operand3
> next:
> cmovxx operand2,operand0
> cmovyy operand3,operand0
Possibly, but we'd be better off disallowing constants to begin with if
that's the code we'd have to generate to support them.
jeff
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: PPro and egcs
1997-10-27 16:30 ` H.J. Lu
@ 1997-10-27 14:14 ` Jeffrey A Law
1997-10-27 15:33 ` H.J. Lu
0 siblings, 1 reply; 23+ messages in thread
From: Jeffrey A Law @ 1997-10-27 14:14 UTC (permalink / raw)
To: H.J. Lu; +Cc: egcs
In message < m0xPxLV-0004edC@ocean.lucon.org >you write:
> I tried it. But it failed to compile _bb.o in libgcc2.a.
> It aborted in find_reloads (). It seems that there weren't
> enough registers for reload.
Well, I'd be tempted to simplify it such that it only accepts regs
and requires an inout operand. That handles the most common cases
and should require more registers than your typical add pattern.
jeff
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: PPro and egcs
1997-10-27 15:54 ` Jeffrey A Law
@ 1997-10-27 15:33 ` H.J. Lu
0 siblings, 0 replies; 23+ messages in thread
From: H.J. Lu @ 1997-10-27 15:33 UTC (permalink / raw)
To: law; +Cc: egcs
> > >From what I saw, gcc wound up trying to put those operands into
> > registers to satisfy the constraints, which caused the register
> > shortage.
> No, there was a const_int in the original example, which caused gcc to
> try and use the last constraint, which didn't work because the clobber
> was teh same as one of the input registers.
>
> If you fix the pattern to only use two registers (remember there's a
> matching in/out) then it shouldn't be any more register pressure
> sensitive than any other two operand instruction.
>
I tried it. gcc will then to put const_int in register to fit the
pattern. I got the same error on _bb.o in libgcc2.a.
--
H.J. Lu (hjl@gnu.ai.mit.edu)
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: PPro and egcs
1997-10-27 14:14 ` Jeffrey A Law
@ 1997-10-27 15:33 ` H.J. Lu
1997-10-27 15:54 ` Jeffrey A Law
0 siblings, 1 reply; 23+ messages in thread
From: H.J. Lu @ 1997-10-27 15:33 UTC (permalink / raw)
To: law; +Cc: egcs
>
>
> In message < m0xPxLV-0004edC@ocean.lucon.org >you write:
> > I tried it. But it failed to compile _bb.o in libgcc2.a.
> > It aborted in find_reloads (). It seems that there weren't
> > enough registers for reload.
> Well, I'd be tempted to simplify it such that it only accepts regs
> and requires an inout operand. That handles the most common cases
> and should require more registers than your typical add pattern.
>
From what I saw, gcc wound up trying to put those operands into
registers to satisfy the constraints, which caused the register
shortage.
--
H.J. Lu (hjl@gnu.ai.mit.edu)
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: PPro and egcs
1997-10-27 15:33 ` H.J. Lu
@ 1997-10-27 15:54 ` Jeffrey A Law
1997-10-27 15:33 ` H.J. Lu
0 siblings, 1 reply; 23+ messages in thread
From: Jeffrey A Law @ 1997-10-27 15:54 UTC (permalink / raw)
To: H.J. Lu; +Cc: egcs
In message < m0xPxjy-0004edC@ocean.lucon.org >you write:
> >
> >
> > In message < m0xPxLV-0004edC@ocean.lucon.org >you write:
> > > I tried it. But it failed to compile _bb.o in libgcc2.a.
> > > It aborted in find_reloads (). It seems that there weren't
> > > enough registers for reload.
> > Well, I'd be tempted to simplify it such that it only accepts regs
> > and requires an inout operand. That handles the most common cases
> > and should require more registers than your typical add pattern.
> >
>
> >From what I saw, gcc wound up trying to put those operands into
> registers to satisfy the constraints, which caused the register
> shortage.
No, there was a const_int in the original example, which caused gcc to
try and use the last constraint, which didn't work because the clobber
was teh same as one of the input registers.
If you fix the pattern to only use two registers (remember there's a
matching in/out) then it shouldn't be any more register pressure
sensitive than any other two operand instruction.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: PPro and egcs
1997-10-27 13:36 ` Jeffrey A Law
@ 1997-10-27 16:30 ` H.J. Lu
1997-10-27 14:14 ` Jeffrey A Law
0 siblings, 1 reply; 23+ messages in thread
From: H.J. Lu @ 1997-10-27 16:30 UTC (permalink / raw)
To: law; +Cc: egcs
> > > > Has anyone tried egcs on PPro? I got an error.
> > > >
> > > > # gcc -O -march=i686 -S foo.c -fomit-frame-pointer
> > > > foo.c: In function `nfs_readpage_sync':
> > > > foo.c:1618: internal error--insn does not satisfy its constraints:
> > > > (insn 317 316 139 (parallel[
> > > > (set (reg/v:SI 3 %ebx)
> > > > (if_then_else:SI (ne (cc0)
> > > > (const_int 0))
> > > > (reg:SI 0 %eax)
> > > > (const_int -22)))
> > > > (clobber (reg:SI 0 %eax))
> > > > ] ) 374 {movsicc_1} (nil)
> > > > (expr_list:REG_DEAD (reg:SI 0 %eax)
> > > > (expr_list:REG_UNUSED (reg:SI 0 %eax)
> > > > (nil))))
> > > > gcc: Internal compiler error: program cc1 got fatal signal 6
> > > I don't have a ppro, nor do I know anything about the architecture.
> > >
> > > Can the cmov instruction accept a constant as a source operand?
> > >
> >
> > No. How about we do this?
> >
> > If operands 2/3 are immediate operands, we emit
> >
> >
> > jmp next
> > .align 4
> > operand2:
> > .4bytes operand2
> > operand3:
> > .4bytes operand3
> > next:
> > cmovxx operand2,operand0
> > cmovyy operand3,operand0
> Possibly, but we'd be better off disallowing constants to begin with if
> that's the code we'd have to generate to support them.
>
> jeff
>
I tried it. But it failed to compile _bb.o in libgcc2.a.
It aborted in find_reloads (). It seems that there weren't
enough registers for reload.
--
H.J. Lu (hjl@gnu.ai.mit.edu)
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: PPro and egcs
1997-10-29 2:28 ` Jeffrey A Law
@ 1997-10-29 0:12 ` H.J. Lu
0 siblings, 0 replies; 23+ messages in thread
From: H.J. Lu @ 1997-10-29 0:12 UTC (permalink / raw)
To: law; +Cc: egcs
> >
> > It is very possible. BTW, I assume you used -fomit-frame-pointer.
> > Have you tried to use -march=i686 tobootstrape the compiler?
> I mentioned in my message that I had to use a cross compiler since
> my ppro isn't useable yet. Thus your comments about bootstrapping
> the compiler are meaningless.
>
I have problem with libgcc2.a using -march=i686.
>
> Please the test with your stage1 compiler and tell me if it works.
>
I got the same result. It didn't work on my test case.
BTW, there may be more problems in "make check" on ppro with
-march=i686.
--
H.J. Lu (hjl@gnu.ai.mit.edu)
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: PPro and egcs
1997-10-29 3:27 ` Jeffrey A Law
@ 1997-10-29 0:12 ` H.J. Lu
1997-10-29 2:28 ` Jeffrey A Law
0 siblings, 1 reply; 23+ messages in thread
From: H.J. Lu @ 1997-10-29 0:12 UTC (permalink / raw)
To: law; +Cc: egcs
>
>
> In message < m0xPI2T-0004edC@ocean.lucon.org >you write:
> > Hi,
> >
> > Has anyone tried egcs on PPro? I got an error.
> >
> > # gcc -O -march=i686 -S foo.c -fomit-frame-pointer
> > foo.c: In function `nfs_readpage_sync':
> > foo.c:1618: internal error--insn does not satisfy its constraints:
> > (insn 317 316 139 (parallel[
> > (set (reg/v:SI 3 %ebx)
> > (if_then_else:SI (ne (cc0)
> > (const_int 0))
> > (reg:SI 0 %eax)
> > (const_int -22)))
> > (clobber (reg:SI 0 %eax))
> > ] ) 374 {movsicc_1} (nil)
> > (expr_list:REG_DEAD (reg:SI 0 %eax)
> > (expr_list:REG_UNUSED (reg:SI 0 %eax)
> > (nil))))
> > gcc: Internal compiler error: program cc1 got fatal signal 6
> Odd. Your testcase works fine for me using the a cross compiler
> with the current sources; I don't see any recent changes that would
> account for the different behavior.
>
It is very possible. BTW, I assume you used -fomit-frame-pointer.
Have you tried to use -march=i686 tobootstrape the compiler?
H.J.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: PPro and egcs
1997-10-29 0:12 ` H.J. Lu
@ 1997-10-29 2:28 ` Jeffrey A Law
1997-10-29 0:12 ` H.J. Lu
0 siblings, 1 reply; 23+ messages in thread
From: Jeffrey A Law @ 1997-10-29 2:28 UTC (permalink / raw)
To: H.J. Lu; +Cc: egcs
In message < m0xQSUG-0004edC@ocean.lucon.org >you write:
> >
> >
> > In message < m0xPI2T-0004edC@ocean.lucon.org >you write:
> > > Hi,
> > >
> > > Has anyone tried egcs on PPro? I got an error.
> > >
> > > # gcc -O -march=i686 -S foo.c -fomit-frame-pointer
> > > foo.c: In function `nfs_readpage_sync':
> > > foo.c:1618: internal error--insn does not satisfy its constraints:
> > > (insn 317 316 139 (parallel[
> > > (set (reg/v:SI 3 %ebx)
> > > (if_then_else:SI (ne (cc0)
> > > (const_int 0))
> > > (reg:SI 0 %eax)
> > > (const_int -22)))
> > > (clobber (reg:SI 0 %eax))
> > > ] ) 374 {movsicc_1} (nil)
> > > (expr_list:REG_DEAD (reg:SI 0 %eax)
> > > (expr_list:REG_UNUSED (reg:SI 0 %eax)
> > > (nil))))
> > > gcc: Internal compiler error: program cc1 got fatal signal 6
> > Odd. Your testcase works fine for me using the a cross compiler
> > with the current sources; I don't see any recent changes that would
> > account for the different behavior.
> >
>
> It is very possible. BTW, I assume you used -fomit-frame-pointer.
> Have you tried to use -march=i686 tobootstrape the compiler?
I mentioned in my message that I had to use a cross compiler since
my ppro isn't useable yet. Thus your comments about bootstrapping
the compiler are meaningless.
Please the test with your stage1 compiler and tell me if it works.
jeff
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: PPro and egcs
1997-10-25 19:03 PPro and egcs H.J. Lu
1997-10-26 0:48 ` Mumit Khan
1997-10-27 0:08 ` Jeffrey A Law
@ 1997-10-29 3:27 ` Jeffrey A Law
1997-10-29 0:12 ` H.J. Lu
1997-10-31 15:24 ` Jeffrey A Law
3 siblings, 1 reply; 23+ messages in thread
From: Jeffrey A Law @ 1997-10-29 3:27 UTC (permalink / raw)
To: H.J. Lu; +Cc: egcs
In message < m0xPI2T-0004edC@ocean.lucon.org >you write:
> Hi,
>
> Has anyone tried egcs on PPro? I got an error.
>
> # gcc -O -march=i686 -S foo.c -fomit-frame-pointer
> foo.c: In function `nfs_readpage_sync':
> foo.c:1618: internal error--insn does not satisfy its constraints:
> (insn 317 316 139 (parallel[
> (set (reg/v:SI 3 %ebx)
> (if_then_else:SI (ne (cc0)
> (const_int 0))
> (reg:SI 0 %eax)
> (const_int -22)))
> (clobber (reg:SI 0 %eax))
> ] ) 374 {movsicc_1} (nil)
> (expr_list:REG_DEAD (reg:SI 0 %eax)
> (expr_list:REG_UNUSED (reg:SI 0 %eax)
> (nil))))
> gcc: Internal compiler error: program cc1 got fatal signal 6
Odd. Your testcase works fine for me using the a cross compiler
with the current sources; I don't see any recent changes that would
account for the different behavior.
Can you get this failure to happen with the stage1 compiler? Just
to make sure we're not chasing a case where the stageN compiler is
mis-compiling the stageN+1 compiler which is then crapping out on
your code.
For reference I have the following in my .greg dump. Note how the
clobber is a different reg than the input.
(insn:HI 317 316 285 (parallel[
(set (reg/v:SI 3 %ebx)
(if_then_else:SI (ne (cc0)
(const_int 0))
(reg:SI 0 %eax)
(const_int -22)))
(clobber (reg:SI 5 %edi))
] ) 374 {movsicc_1} (nil)
(expr_list:REG_DEAD (reg:SI 0 %eax)
(expr_list:REG_UNUSED (reg:SI 5 %edi)
(nil))))
My ppro just arrived, it'll take a little while before I can do anything
real like bootstrap gcc, but it shouldn't be too long...
jeff
jeff
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: PPro and egcs
1997-10-31 15:24 ` H.J. Lu
@ 1997-10-31 15:20 ` Jeffrey A Law
1997-10-31 15:24 ` H.J. Lu
0 siblings, 1 reply; 23+ messages in thread
From: Jeffrey A Law @ 1997-10-31 15:20 UTC (permalink / raw)
To: H.J. Lu; +Cc: egcs
In message < m0xRQKv-0004ecC@ocean.lucon.org >you write:
> > Well, I've got my ppro running, and I've actually been able to trip this
> > problem. No clue why I couldn't get it to trip with my cross compiler.
> >
> > It's a tough little nut to crack, largly because of reload's insistence
> > on replacing regs with CONST_INTs when the register has a REG_EQUIV note.
> >
>
> If you take a close look, eax is used for the return value of a
> funtion. In that case, I don't gcc should even try to use eax as
> spill register.
On the x86 the reload pass does try to use return registers and
any others it can find as spills -- the x86 is too register poor
to not use it.
jeff
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: PPro and egcs
1997-10-25 19:03 PPro and egcs H.J. Lu
` (2 preceding siblings ...)
1997-10-29 3:27 ` Jeffrey A Law
@ 1997-10-31 15:24 ` Jeffrey A Law
1997-10-31 15:24 ` H.J. Lu
1997-10-31 17:23 ` Joern Rennecke
3 siblings, 2 replies; 23+ messages in thread
From: Jeffrey A Law @ 1997-10-31 15:24 UTC (permalink / raw)
To: H.J. Lu; +Cc: egcs
In message < m0xPI2T-0004edC@ocean.lucon.org >you write:
> Hi,
>
> Has anyone tried egcs on PPro? I got an error.
>
> # gcc -O -march=i686 -S foo.c -fomit-frame-pointer
> foo.c: In function `nfs_readpage_sync':
> foo.c:1618: internal error--insn does not satisfy its constraints:
> (insn 317 316 139 (parallel[
> (set (reg/v:SI 3 %ebx)
> (if_then_else:SI (ne (cc0)
> (const_int 0))
> (reg:SI 0 %eax)
> (const_int -22)))
> (clobber (reg:SI 0 %eax))
> ] ) 374 {movsicc_1} (nil)
> (expr_list:REG_DEAD (reg:SI 0 %eax)
> (expr_list:REG_UNUSED (reg:SI 0 %eax)
> (nil))))
> gcc: Internal compiler error: program cc1 got fatal signal 6
Well, I've got my ppro running, and I've actually been able to trip this
problem. No clue why I couldn't get it to trip with my cross compiler.
It's a tough little nut to crack, largly because of reload's insistence
on replacing regs with CONST_INTs when the register has a REG_EQUIV note.
On the up side, if I disable the cmov patterns, I can get a clean bootstrap,
so odds are once we fix the cmov stuff there won't be any serious ppro
problems lurking around the corner.
jeff
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: PPro and egcs
1997-10-31 15:20 ` Jeffrey A Law
@ 1997-10-31 15:24 ` H.J. Lu
0 siblings, 0 replies; 23+ messages in thread
From: H.J. Lu @ 1997-10-31 15:24 UTC (permalink / raw)
To: law; +Cc: egcs
>
>
> In message < m0xRQKv-0004ecC@ocean.lucon.org >you write:
> > > Well, I've got my ppro running, and I've actually been able to trip this
> > > problem. No clue why I couldn't get it to trip with my cross compiler.
> > >
> > > It's a tough little nut to crack, largly because of reload's insistence
> > > on replacing regs with CONST_INTs when the register has a REG_EQUIV note.
> > >
> >
> > If you take a close look, eax is used for the return value of a
> > funtion. In that case, I don't gcc should even try to use eax as
> > spill register.
> On the x86 the reload pass does try to use return registers and
> any others it can find as spills -- the x86 is too register poor
> to not use it.
>
What I meant was in that particular instance, eax is an input
register in the insn, which is the return value. gcc should skip
eax on that one.
--
H.J. Lu (hjl@gnu.ai.mit.edu)
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: PPro and egcs
1997-10-31 15:24 ` Jeffrey A Law
@ 1997-10-31 15:24 ` H.J. Lu
1997-10-31 15:20 ` Jeffrey A Law
1997-10-31 17:23 ` Joern Rennecke
1 sibling, 1 reply; 23+ messages in thread
From: H.J. Lu @ 1997-10-31 15:24 UTC (permalink / raw)
To: law; +Cc: egcs
>
>
> In message < m0xPI2T-0004edC@ocean.lucon.org >you write:
> > Hi,
> >
> > Has anyone tried egcs on PPro? I got an error.
> >
> > # gcc -O -march=i686 -S foo.c -fomit-frame-pointer
> > foo.c: In function `nfs_readpage_sync':
> > foo.c:1618: internal error--insn does not satisfy its constraints:
> > (insn 317 316 139 (parallel[
> > (set (reg/v:SI 3 %ebx)
> > (if_then_else:SI (ne (cc0)
> > (const_int 0))
> > (reg:SI 0 %eax)
> > (const_int -22)))
> > (clobber (reg:SI 0 %eax))
> > ] ) 374 {movsicc_1} (nil)
> > (expr_list:REG_DEAD (reg:SI 0 %eax)
> > (expr_list:REG_UNUSED (reg:SI 0 %eax)
> > (nil))))
> > gcc: Internal compiler error: program cc1 got fatal signal 6
> Well, I've got my ppro running, and I've actually been able to trip this
> problem. No clue why I couldn't get it to trip with my cross compiler.
>
> It's a tough little nut to crack, largly because of reload's insistence
> on replacing regs with CONST_INTs when the register has a REG_EQUIV note.
>
If you take a close look, eax is used for the return value of a
funtion. In that case, I don't gcc should even try to use eax as
spill register.
H.J.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: PPro and egcs
1997-10-31 17:23 ` Jeffrey A Law
@ 1997-10-31 17:23 ` H.J. Lu
0 siblings, 0 replies; 23+ messages in thread
From: H.J. Lu @ 1997-10-31 17:23 UTC (permalink / raw)
To: law; +Cc: amylaar, egcs
Here is a kludge I used. It seems to work ok. But I have another
ppro bug which I repored earlier.
H.J.
----
Fri Oct 31 17:20:53 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
* reload1.c (allocate_reload_reg): Check is the spill register
is already used in INSN.
Index: reload1.c
===================================================================
RCS file: /home/work/cvs/gnu/egcs/gcc/reload1.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 reload1.c
--- reload1.c 1997/08/26 00:20:42 1.1.1.1
+++ reload1.c 1997/10/31 23:21:24
@@ -5086,7 +5090,12 @@
|| (TEST_HARD_REG_BIT (reload_reg_used_at_all,
spill_regs[i])
&& ! TEST_HARD_REG_BIT (reload_reg_used_for_inherit,
- spill_regs[i]))))
+ spill_regs[i])))
+ /* The spill register may be used in INSN as the
+ return value from a previous function call. */
+ && !refers_to_regno_p (spill_regs[i],
+ spill_regs[i] + 1,
+ PATTERN (insn), NULL_PTR))
{
int nr = HARD_REGNO_NREGS (spill_regs[i], reload_mode[r]);
/* Avoid the problem where spilling a GENERAL_OR_FP_REG
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: PPro and egcs
1997-10-31 15:24 ` Jeffrey A Law
1997-10-31 15:24 ` H.J. Lu
@ 1997-10-31 17:23 ` Joern Rennecke
1997-10-31 17:23 ` Jeffrey A Law
1 sibling, 1 reply; 23+ messages in thread
From: Joern Rennecke @ 1997-10-31 17:23 UTC (permalink / raw)
To: law; +Cc: hjl, egcs
> > # gcc -O -march=i686 -S foo.c -fomit-frame-pointer
> > foo.c: In function `nfs_readpage_sync':
> > foo.c:1618: internal error--insn does not satisfy its constraints:
> > (insn 317 316 139 (parallel[
> > (set (reg/v:SI 3 %ebx)
> > (if_then_else:SI (ne (cc0)
> > (const_int 0))
> > (reg:SI 0 %eax)
> > (const_int -22)))
> > (clobber (reg:SI 0 %eax))
> > ] ) 374 {movsicc_1} (nil)
> > (expr_list:REG_DEAD (reg:SI 0 %eax)
> > (expr_list:REG_UNUSED (reg:SI 0 %eax)
> > (nil))))
> > gcc: Internal compiler error: program cc1 got fatal signal 6
> Well, I've got my ppro running, and I've actually been able to trip this
> problem. No clue why I couldn't get it to trip with my cross compiler.
>
> It's a tough little nut to crack, largly because of reload's insistence
> on replacing regs with CONST_INTs when the register has a REG_EQUIV note.
movsicc_1 uses general_operand as constraint, which is clearly wrong if
a CONST_INT isn't acceptable. Have you tried to replace this with
nonimmediate_operand?
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: PPro and egcs
1997-10-31 17:23 ` Joern Rennecke
@ 1997-10-31 17:23 ` Jeffrey A Law
1997-10-31 17:23 ` H.J. Lu
0 siblings, 1 reply; 23+ messages in thread
From: Jeffrey A Law @ 1997-10-31 17:23 UTC (permalink / raw)
To: Joern Rennecke; +Cc: hjl, egcs
In message < 199711010110.BAA00592@phal.cygnus.co.uk >you write:
> > > # gcc -O -march=i686 -S foo.c -fomit-frame-pointer
> > > foo.c: In function `nfs_readpage_sync':
> > > foo.c:1618: internal error--insn does not satisfy its constraints:
> > > (insn 317 316 139 (parallel[
> > > (set (reg/v:SI 3 %ebx)
> > > (if_then_else:SI (ne (cc0)
> > > (const_int 0))
> > > (reg:SI 0 %eax)
> > > (const_int -22)))
> > > (clobber (reg:SI 0 %eax))
> > > ] ) 374 {movsicc_1} (nil)
> > > (expr_list:REG_DEAD (reg:SI 0 %eax)
> > > (expr_list:REG_UNUSED (reg:SI 0 %eax)
> > > (nil))))
> > > gcc: Internal compiler error: program cc1 got fatal signal 6
> > Well, I've got my ppro running, and I've actually been able to trip this
> > problem. No clue why I couldn't get it to trip with my cross compiler.
> >
> > It's a tough little nut to crack, largly because of reload's insistence
> > on replacing regs with CONST_INTs when the register has a REG_EQUIV note.
>
> movsicc_1 uses general_operand as constraint, which is clearly wrong if
> a CONST_INT isn't acceptable. Have you tried to replace this with
> nonimmediate_operand?
Yes.
jeff
^ permalink raw reply [flat|nested] 23+ messages in thread
* PPro and egcs
@ 1998-05-12 9:49 H.J. Lu
0 siblings, 0 replies; 23+ messages in thread
From: H.J. Lu @ 1998-05-12 9:49 UTC (permalink / raw)
To: egcs; +Cc: GNU C Library
Hi,
I have been working on PPro conditional move. It seems to work for me
now. But I have noticed there are a few other PPro bugs. I hope to fix
them soon. Before they are fixed, the current egcs will miscompile fp
code if PPro is enabled.
BTW, my network connection has been down for the past 2 days. I don't
know when it will be up again. I will try to provide bug reports/patches
when I finish them.
--
H.J. Lu (hjl@gnu.org)
^ permalink raw reply [flat|nested] 23+ messages in thread
end of thread, other threads:[~1998-05-12 9:49 UTC | newest]
Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-10-25 19:03 PPro and egcs H.J. Lu
1997-10-26 0:48 ` Mumit Khan
1997-10-27 0:08 ` Jeffrey A Law
1997-10-27 6:21 ` John Hassey
1997-10-27 13:05 ` H.J. Lu
1997-10-27 13:36 ` Jeffrey A Law
1997-10-27 16:30 ` H.J. Lu
1997-10-27 14:14 ` Jeffrey A Law
1997-10-27 15:33 ` H.J. Lu
1997-10-27 15:54 ` Jeffrey A Law
1997-10-27 15:33 ` H.J. Lu
1997-10-29 3:27 ` Jeffrey A Law
1997-10-29 0:12 ` H.J. Lu
1997-10-29 2:28 ` Jeffrey A Law
1997-10-29 0:12 ` H.J. Lu
1997-10-31 15:24 ` Jeffrey A Law
1997-10-31 15:24 ` H.J. Lu
1997-10-31 15:20 ` Jeffrey A Law
1997-10-31 15:24 ` H.J. Lu
1997-10-31 17:23 ` Joern Rennecke
1997-10-31 17:23 ` Jeffrey A Law
1997-10-31 17:23 ` H.J. Lu
1998-05-12 9:49 H.J. Lu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).