This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: optimization/10362: Optimization with constant shifts and com pares fails on MIPS
- From: Falk Hueffner <falk dot hueffner at student dot uni-tuebingen dot de>
- To: Berger David-MGI2063 <dberger at motorola dot com>
- Cc: "'bangerth at dealii dot org'" <bangerth at dealii dot org>, "'gcc-bugs at gcc dot gnu dot org'" <gcc-bugs at gcc dot gnu dot org>, "'gcc-prs at gcc dot gnu dot org'" <gcc-prs at gcc dot gnu dot org>, "'nobody at gcc dot gnu dot org'" <nobody at gcc dot gnu dot org>, "'gcc-gnats at gcc dot gnu dot org'" <gcc-gnats at gcc dot gnu dot org>
- Date: 10 Apr 2003 01:07:44 +0200
- Subject: Re: optimization/10362: Optimization with constant shifts and com pares fails on MIPS
- References: <D5A7E45D575DD61180130002A5DB377C04C8824B@ca25exm01>
Berger David-MGI2063 <dberger at motorola dot com> writes:
> volatile unsigned long i;
>
> void test(void)
> {
> i = (((i & 0xf0) >> 4) >= 14); /* This one generates incorrect code with -O2 */
> i = ((i & 0xf0) >= (14 << 4)); /* This is what the optimizer is trying to do */
> }
The optimization seems valid to me. Can you give an example where it
fails?
--
Falk