This is the mail archive of the gcc@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: fix for execute/991221-1.c -O1 failure


Here is the pointerized version of 991221.c .
I know this is not standard C, but I suppose gcc should be able to handle
this.  N.B. it works with -O0 but fails when optimizing.

gcc itself uses -1 as a special 'pointer' value in some places.

int main( void )
{
   char *totalsize = (char *)80;
   char *msize = (char *)64;

   if (sizeof(char *) != 4)
     exit(0);
   
   if ( totalsize > (char *)(2147483647L   * 2UL + 1)  
        || (msize != 0 && ((msize - 1) > (char *)(2147483647L   * 2UL + 1) )))
      abort();
   exit( 0 );
}


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