This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/55011] New: GCC in an infinite loop at -O2
- From: "antoine.balestrat at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 21 Oct 2012 18:31:11 +0000
- Subject: [Bug middle-end/55011] New: GCC in an infinite loop at -O2
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55011
Bug #: 55011
Summary: GCC in an infinite loop at -O2
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: middle-end
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: antoine.balestrat@gmail.com
GCC 4.8.0 as of 20121021 seems to be stuck in an infinite loop while compiling
the following testcase at -O2 (works at -O1 and -O3) :
$ cat infloop.c
char a;
void f(void)
{
char b = 2;
for(;;)
{
unsigned short s = 1, *p = &s, *i;
for(*i = 0; *i < 4; ++*i)
if(a | (*p /= (b += !!a)) <= 63739)
return;
if(!s)
a = 0;
for(;;);
}
}
$ ulimit -t 120
$ xgcc -O2 infloop.c
... 2 minutes later :
gcc: internal compiler error: CPU time limit exceeded (program cc1)
linux-vdso.so.1: No such file or directory
0x40b937 execute
../../srcdir/gcc/gcc.c:2739
0x40c7be do_spec_1
../../srcdir/gcc/gcc.c:4534
0x40f0d5 process_brace_body
../../srcdir/gcc/gcc.c:5782
0x40f0d5 handle_braces
../../srcdir/gcc/gcc.c:5696
0x40d397 do_spec_1
../../srcdir/gcc/gcc.c:5179
0x40f0d5 process_brace_body
../../srcdir/gcc/gcc.c:5782
0x40f0d5 handle_braces
../../srcdir/gcc/gcc.c:5696
0x40d397 do_spec_1
../../srcdir/gcc/gcc.c:5179
0x40cff7 do_spec_1
../../srcdir/gcc/gcc.c:5284
0x40f0d5 process_brace_body
../../srcdir/gcc/gcc.c:5782
0x40f0d5 handle_braces
../../srcdir/gcc/gcc.c:5696
0x40d397 do_spec_1
../../srcdir/gcc/gcc.c:5179
0x40f0d5 process_brace_body
../../srcdir/gcc/gcc.c:5782
0x40f0d5 handle_braces
../../srcdir/gcc/gcc.c:5696
0x40d397 do_spec_1
../../srcdir/gcc/gcc.c:5179
0x40f0d5 process_brace_body
../../srcdir/gcc/gcc.c:5782
0x40f0d5 handle_braces
../../srcdir/gcc/gcc.c:5696
0x40d397 do_spec_1
../../srcdir/gcc/gcc.c:5179
0x40f0d5 process_brace_body
../../srcdir/gcc/gcc.c:5782
0x40f0d5 handle_braces
../../srcdir/gcc/gcc.c:5696
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
Please let me know if you need more information !