diff options
author | sayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-10-29 17:51:07 +0000 |
---|---|---|
committer | sayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-10-29 17:51:07 +0000 |
commit | 1518c00b2b1db9f64be74ea7261e39cae88638fe (patch) | |
tree | b49a8dec3cf8d233b45cd54501b107cf1aa58844 /gcc/testsuite/gcc.dg/fold-xornot-1.c | |
parent | fe537a55c56e3ff3a238087604a89b1f4fa1f0f5 (diff) | |
download | gcc-1518c00b2b1db9f64be74ea7261e39cae88638fe.tar.gz |
PR tree-optimization/15458
* fold-const.c (fold_binary): Optimize ~X ^ C as X ^ ~C, where C
is a constant.
* gcc.dg/fold-xornot-1.c: New test case.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@118152 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/fold-xornot-1.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/fold-xornot-1.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/fold-xornot-1.c b/gcc/testsuite/gcc.dg/fold-xornot-1.c new file mode 100644 index 00000000000..c92095d081f --- /dev/null +++ b/gcc/testsuite/gcc.dg/fold-xornot-1.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-original" } */ + +int foo(int x) +{ + return ~(x ^ 4); +} + +int bar(int y) +{ + return ~y ^ 4; +} + +/* { dg-final { scan-tree-dump-times "x \\^ -5" 1 "original" } } */ +/* { dg-final { scan-tree-dump-times "y \\^ -5" 1 "original" } } */ +/* { dg-final { cleanup-tree-dump "original" } } */ |