summaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2006-06-15 09:42:03 +0000
committerrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2006-06-15 09:42:03 +0000
commitd8a99c1725ef11f24d3fdc97c4076af4d2071031 (patch)
tree85c42d4a341bc337e0b43abae07320d96c49e60f /gcc/testsuite
parentc81c13fbb2afca2bf70bae0d119449db5aa2e621 (diff)
downloadgcc-d8a99c1725ef11f24d3fdc97c4076af4d2071031.tar.gz
* tree-ssa-loop-niter.c (implies_nonnegative_p): New function.
(derive_constant_upper_bound): Derive more precise upper bound in common cases. Return type changed to double_int. (record_estimate): Reflect the changed return type of derive_constant_upper_bound. * double-int.c (double_int_zext, double_int_sext): Fix. * gcc.dg/tree-ssa/loop-18.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@114674 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/loop-18.c24
2 files changed, 28 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 0a934c9feb2..7f16d28684d 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2006-06-15 Zdenek Dvorak <dvorakz@suse.cz>
+
+ * gcc.dg/tree-ssa/loop-18.c: New test.
+
2006-06-14 Mark Mitchell <mark@codesourcery.com>
PR c++/27665
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-18.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-18.c
new file mode 100644
index 00000000000..ca75db941e5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-18.c
@@ -0,0 +1,24 @@
+/* A test for # of iterations estimation. We know that I does not overflow,
+ thus we can perform strength reduction (even though the 32-bit variable
+ i is first extended to 64-bit type). */
+
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+/* { dg-do compile { target x86_64-*-* } } */
+
+unsigned bar(void);
+
+void foo(unsigned *p, unsigned n)
+{
+ unsigned i;
+
+ for (i = 0; i < n; i++)
+ p[i] = bar ();
+}
+
+/* Check that the memory reference was replaced with MEM, and that there is no
+ multiplication. */
+
+/* { dg-final { scan-tree-dump-times "MEM" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "\[^\\n\\r\]*= \\* " 0 "optimized" } } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */