Subject: optimizer bugs in gcc-3.3.3?
To: None <port-arm@netbsd.org>
From: Ignatios Souvatzis <is@netbsd.org>
List: port-arm
Date: 10/22/2005 21:54:29
--X1bOJ3K7DJ5YkBrT
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 as in the 3.0_BETA branc=
h?
(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... however, if I compile flex without optimization,
compilation of the cross-compiler succeeds.

Compilation also succeeds on Solaris/sparc 2.8 with some gcc-3ish compiler,
and NetBSD/i386 3.0_BETA.

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

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

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

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

iD8DBQFDWpj1N4tiz3B8hB0RAkM3AJ9CoFVDqtjOA1CD3pPW1wxDGNMckgCeKiql
RmmbX+uTnukp1rmL1plL//M=
=tJoc
-----END PGP SIGNATURE-----

--X1bOJ3K7DJ5YkBrT--