This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
ARM targetted gcc hangs
- To: egcs-bugs at egcs dot cygnus dot com
- Subject: ARM targetted gcc hangs
- From: Paul Clifford <paul at plasma dot demon dot co dot uk>
- Date: Fri, 03 Mar 2000 18:49:15 +0000
The following program, when compiled with -O1 or greater, causes an ARM
targetted gcc to hang without producing any output:
void main()
{
unsigned long u;
u = 1;
u += u; u += u; u += u; u += u; u += u; u += u; u += u; u += u;
u += u; u += u; u += u; u += u; u += u; u += u; u += u; u += u;
u += u; u += u; u += u; u += u; u += u; u += u; u += u; u += u;
u += u; u += u; u += u; u += u; u += u; u += u; u += u; u += u;
if (!u) _exit(0);
_exit(1);
}
(tryulong32.c from <http://cr.yp.to/dnscache/dnscache-0.91.tar.gz>)
I've tested the behaviour under NetBSD/arm32 (on an Acorn A7000+) using
the supplied gcc, and under Linux/x86 (on a Pentium II machine) with a
cross compiler:
$ uname -a
NetBSD drusilla.local 1.4Q NetBSD 1.4Q (DRUSILLA) #1: Thu Feb 17
17:56:07 GMT 2000
root@drusilla.local:/depot/NetBSD/build/syssrc/sys/arch/arm32/compile/DRUSILLA
arm32
$ gcc -v
Using builtin specs.
gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release)
$ gcc -O0 -c tryulong32.c
$ ls -lF tryulong32.o
-rw-rw-r-- 1 paul paul 765 Mar 3 18:05 tryulong32.o
$ gcc -O1 -c tryulong32.c
*** gcc hangs indefinitely here ***
^C
$ ls -lF tryulong32.o
-rw-rw-r-- 1 paul paul 765 Mar 3 18:05 tryulong32.o
$ uname -a
Linux jenny.local 2.2.14 #4 Sun Jan 30 21:39:31 GMT 2000 i686 unknown
$ armv4l-unknown-linux-gcc -v
Reading specs from
/usr/armv4l-unknown-linux/lib/gcc-lib/armv4l-unknown-linux/2.95.2/specs
gcc version 2.95.2 20000212 (release) [Rebel.com]
$ armv4l-unknown-linux-gcc -O0 -c tryulong32.c
tryulong32.c: In function `main':
tryulong32.c:2: warning: return type of `main' is not `int'
$ ls -lF tryulong32.o
-rw-rw-r-- 1 paul paul 1304 Mar 3 18:11 tryulong32.o
$ armv4l-unknown-linux-gcc -O1 -c tryulong32.c
tryulong32.c: In function `main':
tryulong32.c:2: warning: return type of `main' is not `int'
*** gcc hangs indefinitely here ***
^C
$ ls -lF tryulong32.o
-rw-rw-r-- 1 paul paul 1304 Mar 3 18:11 tryulong32.o
I had the same problem with 2.95.1 under Linux 2.2.12 on a Corel
Netwinder, but I can't include the output at the moment because the
machine is broken :(
I didn't compile either version of gcc, so I'm not certain what
configure options were used. However, the cross compiler is available
at either
<ftp://ftp.nw.carleton.ca/cross/>
or <ftp://ftp.netwinder.org/users/s/stewart/cross/>
According to the README the gcc has been patched, but the only
information is "Patches from Scott's gcc-2.95.2-1nw4 rpm", referring to
Scott Bambrough <scottb@netwinder.org> and an RPM which makes up part of
the Netwinder disk image.