diff options
author | Richard Guenther <rguenther@suse.de> | 2007-02-16 13:41:03 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2007-02-16 13:41:03 +0000 |
commit | 421076b552721090c5901ff4797d155e5a5a69c8 (patch) | |
tree | aca0763151e885e1cc02f3593e3df8c155834feb /gcc/testsuite/gcc.dg/strict-overflow-5.c | |
parent | 6eedbf0dced75e0a1a66a13b3c769e7659295def (diff) | |
download | gcc-421076b552721090c5901ff4797d155e5a5a69c8.zip gcc-421076b552721090c5901ff4797d155e5a5a69c8.tar.gz gcc-421076b552721090c5901ff4797d155e5a5a69c8.tar.bz2 |
fold-const.c (tree_swap_operands_p): Treat SSA_NAMEs like DECLs but prefer SSA_NAMEs over DECLs.
2007-02-16 Richard Guenther <rguenther@suse.de>
Christian Bruel <christian.bruel@st.com>
* fold-const.c (tree_swap_operands_p): Treat SSA_NAMEs like
DECLs but prefer SSA_NAMEs over DECLs.
* gcc.dg/strict-overflow-5.c: New testcase.
Co-Authored-By: Christian Bruel <christian.bruel@st.com>
From-SVN: r122040
Diffstat (limited to 'gcc/testsuite/gcc.dg/strict-overflow-5.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/strict-overflow-5.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/strict-overflow-5.c b/gcc/testsuite/gcc.dg/strict-overflow-5.c new file mode 100644 index 0000000..26e0174 --- /dev/null +++ b/gcc/testsuite/gcc.dg/strict-overflow-5.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-options "-fstrict-overflow -O2 -fdump-tree-final_cleanup" } */ + +/* We can only unroll when using strict overflow semantics. */ + +int foo (int i) +{ + int index; + int r=0; + + for (index = i; index <= i+4; index+=2) + r++; + + return r; +} + +/* { dg-final { scan-tree-dump-times "r = 3" 1 "final_cleanup" } } */ +/* { dg-final { cleanup-tree-dump "final_cleanup" } } */ + |