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

bug in gcc



I'm running stable on my netwinder.  When compiled with optimization,
the following program puts gcc (2.95.2-13.1) into (what I assume is)
an infinite loop:

  main()
  {
    unsigned long u;
    u = 1;
    u += u; u += u; u += u; u += u; u += u; u += u; u += u; u += u;
    u += u; u += u; u += u; u += u; u += u; u += u; u += u; u += u;
    u += u; u += u; u += u; u += u; u += u; u += u; u += u; u += u;
    u += u; u += u; u += u; u += u; u += u; u += u; u += u; u += u;
    if (!u) _exit(0);
    _exit(1);
  }

Without optimization, the program compiles fine.

I'm happy to find out why this is happening, but can someone tell me:

  1) does this happen with the gcc in unstable?
  2) any ideas they might have on what is causing the problem.

aisa



Reply to: