This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: optimization/8492: [3.3 regression] GCC spins forever compiling loop
- From: Janis Johnson <janis187 at us dot ibm dot com>
- To: gcc-gnats at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, thorpej at shagadelic dot org, jh at suse dot cz
- Date: Fri, 20 Dec 2002 14:51:32 -0800
- Subject: Re: optimization/8492: [3.3 regression] GCC spins forever compiling loop
- Organization: IBM
- Reply-to: janis187 at us dot ibm dot com
The mainline regression reported in PR optimization/8492
(an infinite loop in the compiler) showed up starting with
this patch:
Sun Jul 21 00:54:54 CEST 2002 Jan Hubicka <jh@suse.cz>
* gcse.c: Include cselib.h
(constptop_register): Break out from ...
(cprop_insn): ... here; kill basic_block argument.
(do_local_cprop, local_cprop_pass): New functions.
(one_cprop_pass): Call local_cprop_pass.
Here's a small test case that causes the compiler to hang
when compiled on i686-linux with -O2:
-------------------
/* compiler hangs when compiling with -O2 */
int count;
int func(int *valp) {
int val, locked = 0;
while ((val = *valp) != 0) {
if (count) {
if (count)
locked = 1;
else
locked = 1;
if (!locked)
continue;
}
if (!count)
count--;
break;
}
return val;
}
-------------------
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8492