Jakub Jelinek wrote: > On Mon, Mar 04, 2013 at 12:15:31PM +0100, Georg-Johann Lay wrote: >> http://gcc.gnu.org/r196428 >> >> Fixed this test case that assumed int is always 32 bits at least. >> >> PR testsuite/52641 >> PR tree-optimization/52631 >> * gcc.dg/tree-ssa/pr52631.c: Fix 16-bit int. >> >> --- gcc.dg/tree-ssa/pr52631.c (revision 196329) >> +++ gcc.dg/tree-ssa/pr52631.c (working copy) >> @@ -3,7 +3,11 @@ >> >> unsigned f(unsigned a) >> { >> +#if __SIZEOF_INT__ == 2 >> + unsigned b = a >> 15; >> +#else >> unsigned b = a >> 31; >> +#endif > > So perhaps better > unsigned b = a >> (__SIZEOF_INT__ * __CHAR_BIT__ - 1); > ?
Yes, maybe. I just fixed the int=16 case, dunno what the optimization pass is supposed to do with 64-bit integers... Johann