diff options
author | phython <phython@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-06-12 08:03:23 +0000 |
---|---|---|
committer | phython <phython@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-06-12 08:03:23 +0000 |
commit | d810c37d467da842d0510d0e5d9b3be7e0741a73 (patch) | |
tree | 341f5a35ba0116afe7ce890b2b5c25eed5beff64 /gcc/testsuite/gcc.dg/pr14796-1.c | |
parent | cb18759a98a77b3004b2d0b4633ab59f9fdfae43 (diff) | |
download | gcc-d810c37d467da842d0510d0e5d9b3be7e0741a73.tar.gz |
2005-06-12 James A. Morrison <phython@gcc.gnu.org>
PR tree-optimization/14796
* fold-const.c (fold_binary): Transform (A >> C) << C into
one BIT_AND_EXPR.
<shift>: Transform (A OP c1) OP c2 into A OP (c1 + c2).
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100853 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr14796-1.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/pr14796-1.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr14796-1.c b/gcc/testsuite/gcc.dg/pr14796-1.c new file mode 100644 index 00000000000..c927e2b5403 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr14796-1.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-fdump-tree-gimple" } */ + +int f (int a) { + return (a << 3) << 6; +} + +int g (int b) { + return (b >> 5) << 5; +} + +/* { dg-final { scan-tree-dump "a << 9" "gimple" } } */ +/* { dg-final { scan-tree-dump "b & -32" "gimple" } } */ +/* { dg-final { cleanup-tree-dump "gimple" } } */ |