optimization/9421: gcc 3.4: infinite loop in gcse
snyder@fnal.gov
snyder@fnal.gov
Thu Jan 23 17:57:00 GMT 2003
>Number: 9421
>Category: optimization
>Synopsis: gcc 3.4: infinite loop in gcse
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Jan 23 17:46:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: scott snyder
>Release: 3.4 20030123 (experimental)
>Organization:
<organization of PR author (multiple lines)>
>Environment:
System: Linux karma 2.4.19-emp_2419p5a829i #1 Tue Sep 3 17:42:17 EST 2002 i686 unknown
Architecture: i686
<machine, os, target, libraries (multiple lines)>
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../gcc/configure --prefix=/usr/local/gcc --enable-threads=posix --enable-long-long : (reconfigured)
>Description:
When the following source is compiled with -O2 or above, the compiler
never terminates.
$ ./cc1 -O2 x.c
...
Here's where it seems to be getting stuck (halting it from within
the debugger):
Program received signal SIGINT, Interrupt.
0x081c5fa3 in find_avail_set (regno=59, insn=0x4001570c)
at ../../gcc/gcc/gcse.c:3989
3989 struct expr *set = lookup_set (regno, NULL_RTX, &set_hash_table);
(gdb) where
#0 0x081c5fa3 in find_avail_set (regno=59, insn=0x4001570c)
at ../../gcc/gcc/gcse.c:3989
#1 0x081c6546 in cprop_insn (insn=0x4001570c, alter_jumps=1)
at ../../gcc/gcc/gcse.c:4196
#2 0x081c6d5e in cprop (alter_jumps=1) at ../../gcc/gcc/gcse.c:4452
#3 0x081c6e62 in one_cprop_pass (pass=1, cprop_jumps=1, bypass_jumps=1)
at ../../gcc/gcc/gcse.c:4494
#4 0x081cbd81 in bypass_jumps (file=0x0) at ../../gcc/gcc/gcse.c:7441
#5 0x0835cbcd in rest_of_compilation (decl=0x4004bb60)
at ../../gcc/gcc/toplev.c:2985
...
>How-To-Repeat:
------------------
extern int tolower (int __c);
void foo(int type)
{
type =
(__extension__
({ int __res;
if (__builtin_constant_p (type))
__res = type;
else
__res = tolower (type);
__res;
}));
}
------------------
>Fix:
<how to correct or work around the problem, if known (multiple lines)>
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Gcc-bugs
mailing list