diff options
author | Jeff Law <law@redhat.com> | 2013-06-19 08:06:53 -0600 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2013-06-19 08:06:53 -0600 |
commit | d53e2f9954b227ebb8734f921e235c6cb90019ae (patch) | |
tree | d21098a62108b8186e6d4b3c4340baa42780dcaf /gcc/testsuite/gcc.dg/tree-ssa/forwprop-28.c | |
parent | 89e7fc04af656d11cb03e5e64ab1489e7fd256e5 (diff) | |
download | gcc-d53e2f9954b227ebb8734f921e235c6cb90019ae.zip gcc-d53e2f9954b227ebb8734f921e235c6cb90019ae.tar.gz gcc-d53e2f9954b227ebb8734f921e235c6cb90019ae.tar.bz2 |
tree-ssa-forwprop.c (simplify_bitwise_binary_boolean): New function.
* tree-ssa-forwprop.c (simplify_bitwise_binary_boolean): New function.
(simplify_bitwise_binary): Use it to simpify certain binary ops on
booleans.
* gcc.dg/tree-ssa/forwprop-28.c: New test.
From-SVN: r200201
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/forwprop-28.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/forwprop-28.c | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-28.c b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-28.c new file mode 100644 index 0000000..09d96ad --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-28.c @@ -0,0 +1,76 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-forwprop1" } */ + +extern char *frob (void); +extern _Bool testit (void); + +test (int code) +{ + char *temp = frob (); + int rotate = (code == 22); + if (temp == 0 && !rotate) + oof (); +} + +test_2 (int code) +{ + char *temp = frob (); + int rotate = (code == 22); + if (!rotate && temp == 0) + oof (); +} + + +test_3 (int code) +{ + char *temp = frob (); + int rotate = (code == 22); + if (!rotate || temp == 0) + oof (); +} + + +test_4 (int code) +{ + char *temp = frob (); + int rotate = (code == 22); + if (temp == 0 || !rotate) + oof (); +} + + +test_5 (int code) +{ + _Bool temp = testit (); + _Bool rotate = (code == 22); + if (temp == 0 && !rotate) + oof (); +} + +test_6 (int code) +{ + _Bool temp = testit (); + _Bool rotate = (code == 22); + if (!rotate && temp == 0) + oof (); +} + + +test_7 (int code) +{ + _Bool temp = testit (); + _Bool rotate = (code == 22); + if (!rotate || temp == 0) + oof (); +} + + +test_8 (int code) +{ + _Bool temp = testit (); + _Bool rotate = (code == 22); + if (temp == 0 || !rotate) + oof (); +} + +/* { dg-final { scan-tree-dump-times "Replaced" 8 "forwprop1"} } */ |