This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PR70920] transform (intptr_t) x eq/ne CST to x eq/ne (typeof x) cst
- From: Andreas Schwab <schwab at suse dot de>
- To: Prathamesh Kulkarni <prathamesh dot kulkarni at linaro dot org>
- Cc: Richard Biener <rguenther at suse dot de>, gcc Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 28 Jul 2016 12:28:58 +0200
- Subject: Re: [PR70920] transform (intptr_t) x eq/ne CST to x eq/ne (typeof x) cst
- Authentication-results: sourceware.org; auth=none
- References: <CAAgBjM=7jXUBgeAz8DVfUVrqUTwLEiq-kH=cjkd6JtbTkDi9Fg@mail.gmail.com> <alpine.LSU.2.11.1607251057120.30444@t29.fhfr.qr> <CAAgBjMng-muqz1Gi2ALk8EjDRBYdoz0L80dd+yjbC16TYUDTLA@mail.gmail.com>
On Mo, Jul 25 2016, Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> wrote:
> diff --git a/gcc/testsuite/gcc.dg/pr70920-4.c b/gcc/testsuite/gcc.dg/pr70920-4.c
> new file mode 100644
> index 0000000..dedb895
> --- /dev/null
> +++ b/gcc/testsuite/gcc.dg/pr70920-4.c
> @@ -0,0 +1,21 @@
> +/* { dg-do compile } */
> +/* { dg-options "-O2 -fdump-tree-ccp-details -Wno-int-to-pointer-cast" } */
> +
> +#include <stdint.h>
> +
> +void f1();
> +void f2();
> +
> +void
> +foo (int a)
> +{
> + void *cst = 0;
> + if ((int *) a == cst)
> + {
> + f1 ();
> + if (a)
> + f2 ();
> + }
> +}
> +
> +/* { dg-final { scan-tree-dump "gimple_simplified to if \\(_\[0-9\]* == 0\\)" "ccp1" } } */
This fails on all ilp32 platforms.
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."