This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: optimization/10362: Optimization with constant shifts and com pares fails on MIPS


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]