Subject: optimizer bugs in gcc-3.3.3 with target arm?
To: None <tech-toolchain@netbsd.org>
From: Ignatios Souvatzis <is@netbsd.org>
List: tech-toolchain
Date: 10/25/2005 09:23:16
--pf9I7BMVVzbSWLtt
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi all,

are there missing optimizer bug fixes in gcc-3.3.3 targeted at arm=20
as in the 3.0_BETA branch? (I note that gcc-3 is up to gcc-3.4.3 (I think))=
...

Long story:

The NetBSD-3.0_BETA compiler is:

> marie is 118% gcc -v
> Configured with: /home/nick/work/netbsd/src/tools/gcc/../../gnu/dist/gcc/
> configure --enable-long-long --disable-multilib --enable-threads=20
> --disable-symvers --build=3Di386-unknown-netbsdelf2.0. --host=3Darm--netb=
sdelf
> --target=3Darm--netbsdelf
> Thread model: posix
> gcc version 3.3.3 (NetBSD nb3 20040520)

With the NetBSD-3.0_BETA lex built with this gcc with optimization, I can't
build the sourceforge:adtools cross-gcc-3.4.3 (host NetBSD/arm 3.0_BETA,
target amigaos-ppc).

Somewhere shortly after starting gmake after configuring the cross-compiler,
I get:


> flex  -ogengtype-lex.c ../../gcc/gcc/gengtype-lex.l
> gcc -c   -g -O2 -DIN_GCC -DCROSS_COMPILE  -W -Wall -Wwrite-strings -Wstri=
ct-prot
> otypes -Wmissing-prototypes -pedantic -Wno-long-long  -Wno-error  -DHAVE_=
CONFIG_
> H -DGENERATOR_FILE    -I. -I. -I../../gcc/gcc -I../../gcc/gcc/. -I../../g=
cc/gcc/
> ../include -I../intl \
>  gengtype-lex.c -o gengtype-lex.o
> bison  -d -o gengtype-yacc.c ../../gcc/gcc/gengtype-yacc.y
> gcc -c   -g -O2 -DIN_GCC -DCROSS_COMPILE  -W -Wall -Wwrite-strings -Wstri=
ct-prot
> otypes -Wmissing-prototypes -pedantic -Wno-long-long  -Wno-error  -DHAVE_=
CONFIG_
> H -DGENERATOR_FILE    -I. -I. -I../../gcc/gcc -I../../gcc/gcc/. -I../../g=
cc/gcc/
> ../include -I../intl \
>  gengtype-yacc.c -o gengtype-yacc.o
> gcc   -g -O2 -DIN_GCC -DCROSS_COMPILE  -W -Wall -Wwrite-strings -Wstrict-=
prototy
> pes -Wmissing-prototypes -pedantic -Wno-long-long    -DHAVE_CONFIG_H -DGE=
NERATOR
> _FILE  -o gengtype \
>  gengtype.o gengtype-lex.o gengtype-yacc.o ../libiberty/libiberty.a
> ./gengtype
> ../../gcc/gcc/input.h:27: syntax error, unexpected ENT_YACCUNION, expecti=
ng GTY_
> TOKEN
> gmake[1]: *** [s-gtype] Error 1
> gmake[1]: Leaving directory `/home/sources/amiga/adtools/gcc-build/gcc'
> gmake: *** [all-gcc] Error 2

Now, looking at the lex file, and the input.h file, there is no way I can
detect this can happen. OTOH, if I compile flex without optimization,
compilation of the cross-compiler succeeds.

Compilation also succeeds (with optimization) on Solaris/sparc 2.8
with some gcc-3ish compiler, and NetBSD/i386 3.0_BETA, to name the
two I tried.

Sorry, I don't have any less bulky test case (yet?).

Regards,
	Ignatios
--=20
seal your e-mail: http://www.gnupg.org/

--pf9I7BMVVzbSWLtt
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (NetBSD)

iD8DBQFDXd1kN4tiz3B8hB0RAnhGAJwPw5ISmAbs/kE6M6tDTHxTH5fGoQCg4YjM
DkDA1loL+nKWj60MBGV4NUU=
=VMrX
-----END PGP SIGNATURE-----

--pf9I7BMVVzbSWLtt--