The following code hangs for -O2 or -O3. I am running on a 32-bit machine, and
with -O1 it terminates after a few seconds:

    for (int i = 1; i != 0; i++);

You can replace 'i = 1' with 'i = (1<<30)' for faster testing.

I am running Gentoo Linux 64-bit. 'gcc --version' says: gcc (GCC) 4.1.1 (Gentoo
4.1.1).


-- 
           Summary: for (int i = 1; i != 0; i++); hangs for 32-bit ints with
                    -O2 or above. Should wrap quickly.
           Product: gcc
           Version: 4.1.1
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: niklas at cadence dot com
 GCC build triplet: What is this? How about an explanation in "bug writing
                    guideline
  GCC host triplet: What is this? How about an explanation in "bug writing
                    guideline
GCC target triplet: What is this? How about an explanation in "bug writing
                    guideline


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31082

Reply via email to