aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20030711-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20030714-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20040308-1.c18
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20040308-2.c18
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20040308-3.c17
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20040308-4.c17
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/copy-headers.c17
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ivcanon-1.c37
8 files changed, 119 insertions, 9 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030711-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030711-1.c
index eba207a25e5..c51c4fe5925 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030711-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030711-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom3" } */
+/* { dg-options "-O1 -fdump-tree-dom3 -ftree-loop-optimize" } */
union tree_node;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030714-2.c b/gcc/testsuite/gcc.dg/tree-ssa/20030714-2.c
index 6a43360b07f..76f7b62d469 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030714-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030714-2.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom3" } */
+/* { dg-options "-O1 -fdump-tree-dom3 -ftree-loop-optimize" } */
union tree_node;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20040308-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20040308-1.c
new file mode 100644
index 00000000000..59397d8cbb1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20040308-1.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-phiopt1-details" } */
+
+int t( int i)
+{
+ int j;
+ if(i ==0)
+ j = 1;
+ else
+ j = 0;
+
+
+ return j;
+}
+
+/* We should convert one COND_EXPRs into straightline code. */
+/* { dg-final { scan-tree-dump-times "straightline" 1 "phiopt1" {xfail *-*-* } } } */
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20040308-2.c b/gcc/testsuite/gcc.dg/tree-ssa/20040308-2.c
new file mode 100644
index 00000000000..3d2daae6f47
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20040308-2.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-phiopt1-details -fdump-tree-tailc-details" } */
+
+
+int f(int i)
+{
+ int result;
+ result = t(i);
+ if (result)
+ return result;
+ return 0;
+}
+
+/* We should convert one COND_EXPRs into straightline code. */
+/* { dg-final { scan-tree-dump-times "straightline" 1 "phiopt1" } } */
+/* Also we should have found that the call to t is tail called. */
+/* { dg-final { scan-tree-dump-times "Found tail call" 1 "tailc" } } */
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20040308-3.c b/gcc/testsuite/gcc.dg/tree-ssa/20040308-3.c
new file mode 100644
index 00000000000..86f003f127a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20040308-3.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-phiopt1-details" } */
+
+int t( int i)
+{
+ int j;
+ if(i>=0)
+ j = i;
+ else
+ j = -i;
+ return j;
+}
+
+/* We should convert one COND_EXPRs into straightline code with ABS. */
+/* { dg-final { scan-tree-dump-times "straightline" 1 "phiopt1"} } */
+/* { dg-final { scan-tree-dump-times "ABS_EXPR" 1 "phiopt1"} } */
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20040308-4.c b/gcc/testsuite/gcc.dg/tree-ssa/20040308-4.c
new file mode 100644
index 00000000000..ac85077551f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20040308-4.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-phiopt1-details" } */
+
+int t( int i, int k)
+{
+ int j;
+ if(i!=k)
+ j = i;
+ else
+ j = k;
+
+ return j;
+}
+
+/* We should convert one COND_EXPRs into straightline code. */
+/* { dg-final { scan-tree-dump-times "straightline" 1 "phiopt1"} } */
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/copy-headers.c b/gcc/testsuite/gcc.dg/tree-ssa/copy-headers.c
index efe831beab5..eb03840e770 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/copy-headers.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/copy-headers.c
@@ -1,15 +1,18 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-ch-details" } */
+/* { dg-options "-O2 -fdump-tree-dom1 -ftree-loop-optimize" } */
-extern int foo (int);
+extern void link_error (void);
void bla (void)
{
- int i, n = foo (0);
+ int i, j = 1;
- for (i = 0; i < n; i++)
- foo (i);
+ for (i = 0; i < 100; i++)
+ j = 0;
+
+ if (j)
+ link_error ();
}
-/* There should be a header scheduled for duplication. */
-/* { dg-final { scan-tree-dump-times "Scheduled" 1 "ch"} } */
+/* There should be no link_error call in the dom1 dump. */
+/* { dg-final { scan-tree-dump-times "link_error" 0 "dom1"} } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ivcanon-1.c b/gcc/testsuite/gcc.dg/tree-ssa/ivcanon-1.c
new file mode 100644
index 00000000000..430a9514ca5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ivcanon-1.c
@@ -0,0 +1,37 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-optimize -fscalar-evolutions -funroll-loops -fdump-tree-optimized" } */
+
+void foo(void)
+{
+ int n = 16875;
+
+ while (n)
+ {
+ if (n&1)
+ bar (n);
+ n >>= 1;
+ }
+}
+
+static inline int power (long x, unsigned int n)
+{
+ long y = n % 2 ? x : 1;
+
+ while (n >>= 1)
+ {
+ x = x * x;
+ if (n % 2)
+ y = y * x;
+ }
+
+ return y;
+}
+
+void test(long x)
+{
+ bar (power (x, 10));
+ bar (power (x, 27));
+}
+
+/* All loops should be completely unrolled, so there should be no labels. */
+/* { dg-final { scan-tree-dump-times "<L" 0 "optimized"} } */