This is the mail archive of the gcc-bugs@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]

Re: Bug in haifa scheduler ?


At 18:40 25.06.98 , Gabriel Paubert wrote:
>
>	Hello,
>
>I'm a newbie on this list. However I want to post a bug report
>which happens with (at least) the 5 or 6 last egcs snapshots when
>compiling the vger linux kernel for PPC. 
>
>The message is quite explicit:
>
>[root@corh01 fs]# gcc -D__KERNEL__ -I/usr/src/cvslinux/linux/include -Wall
>-Wstrict-prototypes -O2 -fomit-frame-pointer -D__powerpc__ -fsigned-char
>-msoft-float -fno-builtin -ffixed-r2 -Wno-uninitialized -mmultiple
>-mstring   -c -o super.o super.c -save-temps -da 
>../../gcc/haifa-sched.c:7605: Internal compiler error in function
>schedule_region
>
>so this must qualify as a compiler bug. I have trimmed to find the
>offending function whic happens to be sys_ustat and is fairly short.
>Unfortunately the gzipped .i file is too large to send
>here (44kB). I can send it privately to anybody interested in tracking it.
>
>FYI the preprocessor output of the function body follows:
>
>  int sys_ustat(dev_t dev, struct ustat * ubuf)
>{
>        struct super_block *s;
>        struct ustat tmp;
>        struct statfs sbuf;
>        mm_segment_t old_fs;
>	int err = - 22 ;
>
>	do { } while (0) ;
>        s = get_super(to_kdev_t(dev));
>        if (s == ((void *) 0) )
>                goto out;
>	err = - 38 ;
>        if (!(s->s_op->statfs))
>                goto out;
>
>        old_fs = (current->tss.fs) ;
>        (current->tss.fs = ( (((mm_segment_t) { 0 }) )  )) ;
>        s->s_op->statfs(s,&sbuf,sizeof(struct statfs));
>        (current->tss.fs = ( old_fs )) ;
>
>        memset(&tmp,0,sizeof(struct ustat));
>        tmp.f_tfree = sbuf.f_bfree;
>        tmp.f_tinode = sbuf.f_ffree;
>
>        err = copy_to_user(ubuf,&tmp,sizeof(struct ustat)) ? - 14  : 0;
>out:
>	do { } while (0) ;
>	return err;
>}
>
>the great mystery (for me) is that the compiler succesfully compiles
>itself but aborts on this innocent-looking simple code ;) At least 
>such an example is hopefully relatively easy to analyze for the experts. 

The compiler succesfully compiled itself but you didn't run the testsuite
;-). You would have noticed a failing test compile/980511-1.c, which is a
stripped down super.c.
This will (hopefully!) be fixed for 1.1. For now simply add the following
lines at the top of fs/Makefile:

CFLAGS_super.o += -fno-expensive-optimizations
CFLAGS_namei.o += -fno-expensive-optimizations

The namei change makes mknod working. Additionally I would recommend the
following patch for io.h:

Index: io.h
===================================================================
RCS file: /cvsroot/linux/include/asm-ppc/io.h,v
retrieving revision 1.29
diff -u -r1.29 io.h
--- io.h        1998/06/23 20:06:13     1.29
+++ io.h        1998/06/23 23:15:44
@@ -202,7 +202,7 @@
  */
 extern inline void eieio(void)
 {
-       asm volatile ("eieio" : :);
+       __asm__ __volatile__ ("eieio" : : : "memory" );
 }
 
 /*


Hope this helps,

Franz.



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