diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-09-13 21:00:03 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-09-13 21:00:03 +0000 |
commit | 12f6bb18de5446e4c07b99e524fb1cc7860f77ef (patch) | |
tree | 142dc459a1da90111739127e8c28d54c9c9564e9 /gcc/testsuite/gcc.target/i386/pr45617.c | |
parent | 0ff1cf27f2cda8594724b92105143c6205cb771e (diff) | |
download | gcc-12f6bb18de5446e4c07b99e524fb1cc7860f77ef.tar.gz |
PR rtl-optimization/45617
* combine.c (simplify_comparison): Optimize (X >> N) {>,>=,<,<=} C
even if low N bits of X aren't known to be zero.
* gcc.target/i386/pr45617.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@164257 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.target/i386/pr45617.c')
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr45617.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/i386/pr45617.c b/gcc/testsuite/gcc.target/i386/pr45617.c new file mode 100644 index 00000000000..58f977289c8 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr45617.c @@ -0,0 +1,22 @@ +/* PR rtl-optimization/45617 */ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +int f1 (int x) +{ + return (x >> 23) > 12; +} +int f2 (int x) +{ + return x > ((13 << 23) - 1); +} +int f3 (int x) +{ + return (x >> 23) >= 12; +} +int f4 (int x) +{ + return x >= (12 << 23); +} + +/* { dg-final { scan-assembler-not "sarl" } } */ |