This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: bad C code or bad object code ?
- From: Volker Reichelt <reichelt at igpm dot rwth-aachen dot de>
- To: vapier at gentoo dot org
- Cc: toolchain at gentoo dot org, truedfx at gentoo dot org, gcc-help at gcc dot gnu dot org
- Date: Fri, 14 Jul 2006 22:07:10 +0200 (CEST)
- Subject: Re: bad C code or bad object code ?
> we noticed that xterm in Gentoo started to produce broken color display when
> compiled with gcc-4.1 and -Os ... one of our devs ripped apart a small test
> case to illustrate the issue at hand (Debian shows the same issues)
>
> the trouble centers around a matrix declared as static volatile and is never
> initialized ... xterm expects the matrix to be zero set already, but when
> compiled with -Os, this just doesnt work
Ouch. The compiler produces wrong code.
The problem is not the matrix, though, but a bad interaction of
the for-loop and the if-statement.
Filed in Bugzilla as http://gcc.gnu.org/PR28386.
Regards,
Volker