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

Bug in gcc 2.5.8



To: mint@atari.archive.umich.edu

Hi.

I now know that there definitely are bugs with optimization in gcc 2.5.8.
This is probably what makes mint compiled with this gcc incompatible with
the multitos AES. Here is an example of a routine that fails with
optimization turned on: (From the config program to isofs)

  for(i=0;i<16;i++) {
    if(Fread(fd,sizeof(short),&scsidev)!=sizeof(short)) {
      break;
    }
    if(Fread(fd,sizeof(short),&scsilun)!=sizeof(short)) {
      break;
    }

/* NOTE: scsidev and scsilun is not valid if optimization is turned on */
/*	 They seem to both contain zero. */

    ISOFS[i].scsidev=((scsilun&0x7)<<8)|(scsidev&0x7);

/* NOTE: Here ISOFS[i].scsidev gets a strange value, most often 0x404 */
/*	 With gcc-2.3.3 it gets the value 0 */
/* 	 The same happens with both -O2 and -O, with and without */
/*	 -fomit-frame-pointer */
/* When optimization is turned off, the values are correct. */

    if(Fread(fd,sizeof(short),&ISOFS[i].driver)!=sizeof(short)) {
      break;
    }
    if(Fread(fd,80l,mountpoints[i])!=80l) {
      break;
    }

/* The last two reads are correct, both with and without optimization. */
/* This leads to my suspicion that the hairy "((AND) SHIFT ) OR (AND)"
/* construct confuses the optimization in gcc. */

Anybody got any comments ?

Erling  
---
 ~ ATP/Unix 1.40 ~ This is my tagline.