[Bug c/31082] New: for (int i = 1; i != 0; i++); hangs for 32-bit ints with -O2 or above. Should wrap quickly.

2007-03-08 Thread niklas at cadence dot com
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



[Bug c/31083] New: for (int i = 1; i != 0; i++); hangs for 32-bit ints with -O2 or above. Should wrap quickly.

2007-03-08 Thread niklas at cadence dot com
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=31083



[Bug c/31083] for (int i = 1; i != 0; i++); hangs for 32-bit ints with -O2 or above. Should wrap quickly.

2007-03-08 Thread niklas at cadence dot com


--- Comment #1 from niklas at cadence dot com  2007-03-08 14:17 ---
I am running on a 64-bit machine, not 32-bit as stated in the first line. Typo,
sorry.


-- 

niklas at cadence dot com changed:

   What|Removed |Added

 CC||niklas at cadence dot com
   Keywords||wrong-code


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