diff options
author | sayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-10-30 00:56:59 +0000 |
---|---|---|
committer | sayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-10-30 00:56:59 +0000 |
commit | 9913d3a4c47a5b8371e30de43112f932aaba359c (patch) | |
tree | 3e72bc5f754672ecac841d4642054de785714fa0 /gcc/testsuite/gcc.dg/pr17581-1.c | |
parent | 9b8b68276179a5f081c2d0b5b83cff8c0438c1a7 (diff) | |
download | gcc-9913d3a4c47a5b8371e30de43112f932aaba359c.tar.gz |
PR rtl-optimization/17581
* cselib.c (cselib_process_insn): The last instruction of a libcall
block, with the REG_RETVAL note, should be considered in the libcall.
* gcse.c (do_local_cprop): Allow constants to be propagated outside
of libcall blocks.
(adjust_libcall_notes): Use simplify_replace_rtx instead of
replace_rtx to avoid creating invalid RTL in REG_RETVAL notes.
* gcc.dg/pr17581-1.c: New test case.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@89873 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr17581-1.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/pr17581-1.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr17581-1.c b/gcc/testsuite/gcc.dg/pr17581-1.c new file mode 100644 index 00000000000..757661e7683 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr17581-1.c @@ -0,0 +1,28 @@ +/* PR rtl-optimization/17581 */ +/* { dg-do run } */ +/* { dg-options "-O2" } */ + +int foo(int x) +{ + unsigned long long tmp = 0; + + switch(x) { + case 21: + tmp |= 1; + tmp |= 2; + tmp |= 8; + break; + default: + break; + } + + return (int)tmp; +} + +int main() +{ + if (foo(21) != 11) + abort (); + return 0; +} + |