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]

gcc 2.95.2, bug in gcse?


This seems like a bug in gcc.

int main ()
{
  long winds = 0;

  while (winds != 0)
    {
      if (*(char *) winds)
	break;
    }

  if (winds == 0 || winds != 0 || *(char *) winds)
    abort ();
}

$ gcc -O2 bug.c
$ ./a.out
Segmentation fault
$ gcc -O2 -fno-gcse bug.c
$ ./a.out
Aborted

gcc version 2.95.2 19991024 (release), i586-pc-linux-gnu

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