This is the mail archive of the gcc-patches@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: [PR70920] transform (intptr_t) x eq/ne CST to x eq/ne (typeof x) cst


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."


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