This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [testsuite,committed] Fix 16-bit int test (PR52641)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Georg-Johann Lay <avr at gjlay dot de>
- Cc: gcc-patches at gcc dot gnu dot org, Jeff Law <law at redhat dot com>
- Date: Mon, 4 Mar 2013 12:20:05 +0100
- Subject: Re: [testsuite,committed] Fix 16-bit int test (PR52641)
- References: <51348253.9000506@gjlay.de>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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);
?
Jakub