summaryrefslogtreecommitdiff
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/foldstring-1.c6
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/inline-3.c3
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ipa-cp-1.c30
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/local-pure-const.c3
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr41497.c27
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/restrict-1.c20
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/restrict-2.c14
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/restrict-4.c19
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-23.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-24.c9
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-26.c27
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/useless-1.c6
12 files changed, 69 insertions, 97 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/foldstring-1.c b/gcc/testsuite/gcc.dg/tree-ssa/foldstring-1.c
index 25a7ef49f8a..fa64ae14cc4 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/foldstring-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/foldstring-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-useless" } */
+/* { dg-options "-O1 -fdump-tree-fre" } */
void
arf ()
@@ -7,5 +7,5 @@ arf ()
if (""[0] == 0)
blah ();
}
-/* { dg-final { scan-tree-dump-times "= 0;" 1 "useless"} } */
-/* { dg-final { cleanup-tree-dump "useless" } } */
+/* { dg-final { scan-tree-dump-times "= 0;" 1 "fre"} } */
+/* { dg-final { cleanup-tree-dump "fre" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/inline-3.c b/gcc/testsuite/gcc.dg/tree-ssa/inline-3.c
index 13e27c307a4..511cc9e2562 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/inline-3.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/inline-3.c
@@ -1,6 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-einline2" } */
-/* { dg-options "-O2 -fdump-tree-einline2 -fpie" { target { ! nonpic } } } */
+/* { dg-add-options bind_pic_locally } */
+
extern void inlined ();
void inline_me_too (void);
void inline_through_me (void (*ptr)(void));
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ipa-cp-1.c b/gcc/testsuite/gcc.dg/tree-ssa/ipa-cp-1.c
index bd24446e162..b9c67a62609 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ipa-cp-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ipa-cp-1.c
@@ -1,33 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-O3 -fdump-tree-optimized -fno-inline" } */
-int
-very_long_function(int a)
-{
- return very_long_function (a)/4;
-}
-main()
-{
- very_long_function (1);
-}
-/* One appereance for dump, one self recursive call and one call from main. */
-/* { dg-final { scan-tree-dump-times "very_long_function.clone.0 \\(\\)" 3 "optimized"} } */
-/* { dg-final { cleanup-tree-dump "optimized" } } */
-/* { dg-do compile } */
-/* { dg-options "-O3 -fdump-tree-optimized -fno-inline" } */
-int
-very_long_function(int a)
-{
- return very_long_function (a)/4;
-}
-main()
-{
- very_long_function (1);
-}
-/* One appereance for dump, one self recursive call and one call from main. */
-/* { dg-final { scan-tree-dump-times "very_long_function.clone.0 \\(\\)" 3 "optimized"} } */
-/* { dg-final { cleanup-tree-dump "optimized" } } */
-/* { dg-do compile } */
-/* { dg-options "-O3 -fdump-tree-optimized -fno-inline" } */
+/* { dg-add-options bind_pic_locally } */
+
int
very_long_function(int a)
{
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/local-pure-const.c b/gcc/testsuite/gcc.dg/tree-ssa/local-pure-const.c
index 065d212cb5f..afb7ca4b0df 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/local-pure-const.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/local-pure-const.c
@@ -1,6 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-local-pure-const1" } */
-/* { dg-options "-O1 -fdump-tree-local-pure-const1 -fpie" { target { ! nonpic } } } */
+/* { dg-add-options bind_pic_locally } */
+
t(int a, int b, int c)
{
int *p;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr41497.c b/gcc/testsuite/gcc.dg/tree-ssa/pr41497.c
new file mode 100644
index 00000000000..e66ee846491
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr41497.c
@@ -0,0 +1,27 @@
+/* { dg-do run } */
+/* { dg-options "-Os" } */
+
+extern void abort (void);
+
+unsigned int a;
+int b, c;
+
+void
+foo (void)
+{
+ b = 0;
+ do {
+ for (a = -13; a == 0; a = (unsigned short)a)
+ c = 1;
+ b++;
+ } while (b == 0);
+}
+
+int
+main ()
+{
+ foo ();
+ if (a != -13)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/restrict-1.c b/gcc/testsuite/gcc.dg/tree-ssa/restrict-1.c
deleted file mode 100644
index 08fc10f5609..00000000000
--- a/gcc/testsuite/gcc.dg/tree-ssa/restrict-1.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/* { dg-do link } */
-/* { dg-options "-O -fno-strict-aliasing -fdump-tree-optimized" } */
-
-extern void link_error (void);
-
-void bar0 (int * __restrict__ arr1, int * __restrict__ arr2)
-{
- arr1[0] = 1;
- arr2[0] = 1;
- if (arr1[0] != 1)
- link_error ();
-}
-
-int main()
-{
- return 0;
-}
-
-/* { dg-final { scan-tree-dump-not "link_error" "optimized" } } */
-/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/restrict-2.c b/gcc/testsuite/gcc.dg/tree-ssa/restrict-2.c
deleted file mode 100644
index ec824653d5f..00000000000
--- a/gcc/testsuite/gcc.dg/tree-ssa/restrict-2.c
+++ /dev/null
@@ -1,14 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O -fno-strict-aliasing -fdump-tree-lim-details" } */
-
-void foo (float * __restrict__ a, float * __restrict__ b, int n, int j)
-{
- int i;
- for(i = 0; i < n; ++i)
- a[i] = (b[j+50] + b[j-50]) * 0.5f;
-}
-
-/* We should move the RHS of the store out of the loop. */
-
-/* { dg-final { scan-tree-dump-times "Moving statement" 11 "lim1" } } */
-/* { dg-final { cleanup-tree-dump "lim\[1-2\]" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/restrict-4.c b/gcc/testsuite/gcc.dg/tree-ssa/restrict-4.c
deleted file mode 100644
index 3a36def25cc..00000000000
--- a/gcc/testsuite/gcc.dg/tree-ssa/restrict-4.c
+++ /dev/null
@@ -1,19 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-lim1-details" } */
-
-struct Foo
-{
- int n;
- int * __restrict__ p;
-};
-void bar(struct Foo f, int * __restrict__ q)
-{
- int i;
- for (i = 0; i < f.n; ++i)
- {
- *q += f.p[i];
- }
-}
-
-/* { dg-final { scan-tree-dump "Executing store motion" "lim1" } } */
-/* { dg-final { cleanup-tree-dump "lim1" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-23.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-23.c
index 88c8bb71eb9..6aeb06af9ee 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-23.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-23.c
@@ -9,5 +9,5 @@ void foo(int n)
global.y += global.x*global.x;
}
-/* { dg-final { scan-tree-dump "Eliminated: 2" "pre" } } */
+/* { dg-final { scan-tree-dump "Eliminated: 3" "pre" } } */
/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-24.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-24.c
index 6729e2a297e..f91f4af74df 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-24.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-24.c
@@ -9,12 +9,7 @@ void foo(int *p, double *x, int n)
}
/* We should remove the unnecessary insertion of a phi-node and
- _not_ end up using the phi result for replacement *p.
- The issue here is that when PHI-translating the virtual operands
- we assign different value-numbers to the load. Re-running VN
- after insertion or trying to be clever and doing this on the
- fly during PHI translation would solve this. The next copyprop
- fixes this anyway. */
+ _not_ end up using the phi result for replacement *p. */
-/* { dg-final { scan-tree-dump-not "= prephitmp" "pre" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-not "= prephitmp" "pre" } } */
/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-26.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-26.c
new file mode 100644
index 00000000000..978b7abab3a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-26.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-Os -fdump-tree-pre-details" } */
+
+typedef union
+{
+ int* data;
+} SA;
+
+typedef struct
+{
+ int reserved;
+ char* array;
+}SB;
+
+typedef struct
+{
+ int status;
+}SC;
+
+void foo(SA* pResult, SB* method, SC* self)
+{
+ if (method->array[0] == 'L' && !self->status && pResult->data != 0)
+ pResult->data = pResult->data;
+}
+
+/* { dg-final { scan-tree-dump "Deleted redundant store" "pre" } } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/useless-1.c b/gcc/testsuite/gcc.dg/tree-ssa/useless-1.c
index 9170b7ca4de..68eab70046c 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/useless-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/useless-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-useless" } */
+/* { dg-options "-O1 -fdump-tree-gimple" } */
void
foo (void)
@@ -13,5 +13,5 @@ foo (void)
in the loop exit condition, it would be re-introduced during
GIMPLE lowering, at the cost of an extra statement, label,
and basic block. */
-/* { dg-final { scan-tree-dump-times "goto" 3 "useless"} } */
-/* { dg-final { cleanup-tree-dump "useless" } } */
+/* { dg-final { scan-tree-dump-times "goto" 3 "gimple"} } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */