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]
Other format: [Raw text]

Re: optimization/8492: [3.3 regression] GCC spins forever compiling loop


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




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