This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: 3.3.2 mips/ppc compiler bug?
- From: Falk Hueffner <falk dot hueffner at student dot uni-tuebingen dot de>
- To: Martin Rivers <rivers at lexmark dot com>
- Cc: gcc-bugs at gcc dot gnu dot org
- Date: 30 Dec 2003 09:32:40 +0100
- Subject: Re: 3.3.2 mips/ppc compiler bug?
- References: <3FF078CD.D0B3BED8@lpdev.prtdev.lexmark.com>
Martin Rivers <rivers@lexmark.com> writes:
> the 3.3.2 compiler for both ppc and mips effectively leaves the
> value received as cmdxy as input and the value passed as y to subr2
> identical which I don't believe is right.
>
> void subr( char *dest, int cmdxy, struct blah *blah, int destw )
> {
> y = (cmdxy<<18)/(1<<18);
gcc is right, because y can only differ from cmdxy in case of
overflow, which is undefined for signed types. That this appears to
"work" for shift is an optimizer weakness (at least for C99).
--
Falk