From 530206482667dd180acc4ca1e339389308f0736b Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Tue, 19 Jul 2011 10:57:15 +0000 Subject: gimplify.c (gimplify_expr): Gimplify TRUTH_NOT_EXPR as BIT_XOR_EXPR, same as the RTL expander does. 2011-07-19 Richard Guenther * gimplify.c (gimplify_expr): Gimplify TRUTH_NOT_EXPR as BIT_XOR_EXPR, same as the RTL expander does. * tree-cfg.c (verify_expr): Disallow TRUTH_NOT_EXPR in the gimple IL. (verify_gimple_assign_unary): Likewise. * tree-ssa-propagate.c (valid_gimple_rhs_p): Disallow TRUTH_*_EXPR. * tree-ssa-forwprop.c (forward_propagate_comparison): Handle BIT_NOT_EXPR and BIT_XOR_EXPR instead of TRUTH_NOT_EXPR. * gcc.dg/tree-ssa/bool-10.c: Adjust expected pattern. * gcc.dg/tree-ssa/bool-11.c: Likewise. * gcc.dg/torture/20110719-1.c: New testcase. From-SVN: r176442 --- gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/gcc.dg/torture/20110719-1.c | 10 ++++++++++ gcc/testsuite/gcc.dg/tree-ssa/bool-10.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/bool-11.c | 2 +- 4 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/torture/20110719-1.c (limited to 'gcc/testsuite') diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 07c283d..d87ce8d74 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2011-07-19 Richard Guenther + + * gcc.dg/tree-ssa/bool-10.c: Adjust expected pattern. + * gcc.dg/tree-ssa/bool-11.c: Likewise. + * gcc.dg/torture/20110719-1.c: New testcase. + 2011-07-19 Jakub Jelinek PR tree-optimization/49768 diff --git a/gcc/testsuite/gcc.dg/torture/20110719-1.c b/gcc/testsuite/gcc.dg/torture/20110719-1.c new file mode 100644 index 0000000..7797e08 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/20110719-1.c @@ -0,0 +1,10 @@ +extern void abort (void); +int i; +int main() +{ + int b = i != 0; + int c = ~b; + if (c != -1) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/tree-ssa/bool-10.c b/gcc/testsuite/gcc.dg/tree-ssa/bool-10.c index d7bf20d..58d0645 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/bool-10.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/bool-10.c @@ -9,6 +9,6 @@ int f(_Bool x) /* There should be no != 1 which is produced by the front-end as bool_var != 1 is the same as !bool_var. */ /* { dg-final { scan-tree-dump-times "!= 1" 0 "optimized"} } */ -/* { dg-final { scan-tree-dump-times "!x" 1 "optimized"} } */ +/* { dg-final { scan-tree-dump-times "~x" 1 "optimized"} } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/bool-11.c b/gcc/testsuite/gcc.dg/tree-ssa/bool-11.c index 8d88b7e..ee266c7 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/bool-11.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/bool-11.c @@ -9,6 +9,6 @@ int f(_Bool x) /* There should be no == 0 which is produced by the front-end as bool_var == 0 is the same as !bool_var. */ /* { dg-final { scan-tree-dump-times "== 0" 0 "optimized"} } */ -/* { dg-final { scan-tree-dump-times "!x" 1 "optimized"} } */ +/* { dg-final { scan-tree-dump-times "~x" 1 "optimized"} } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ -- cgit v1.1