===================================================================
@@ -12,5 +12,5 @@ int foo(struct X *q)
/* We should have propragated &q->a into (*pointer). */
/* { dg-final { scan-tree-dump-times "pointer" 0 "forwprop1"} } */
-/* { dg-final { scan-tree-dump "->a\\\[0\\\]" "forwprop1" } } */
+/* { dg-final { scan-tree-dump "\\\[0\\\]" "forwprop1" } } */
/* { dg-final { cleanup-tree-dump "forwprop1" } } */
===================================================================
@@ -21,5 +21,9 @@ int bar (void)
return q->i;
}
-/* { dg-final { scan-tree-dump-times "a.b.i" 2 "ccp1" } } */
+/* The first access is through struct A, so a.b.i is fine,
+ the second access needs to preserve the original access type struct B. */
+
+/* { dg-final { scan-tree-dump-times "a.b.i" 1 "ccp1" } } */
+/* { dg-final { scan-tree-dump-times "MEM\\\[\\\(struct B \\\*\\\)&a\\\].i" 1 "ccp1" } } */
/* { dg-final { cleanup-tree-dump "ccp1" } } */
===================================================================
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O -fdump-tree-forwprop1" } */
+/* { dg-options "-O -fdump-tree-fre-details" } */
int b;
unsigned a;
@@ -15,9 +15,8 @@ void test2(void)
}
/* The indirect load should be replaced by a load from a and a
- conversion to int. */
+ conversion to int. FRE should then be able to replace
+ the rhs of the store to b by 1. */
-/* { dg-final { scan-tree-dump "= a;" "forwprop1" } } */
-/* { dg-final { scan-tree-dump "= \\\(int\\\) " "forwprop1" } } */
-/* { dg-final { scan-tree-dump-not "= \\\*" "forwprop1" } } */
-/* { dg-final { cleanup-tree-dump "forwprop1" } } */
+/* { dg-final { scan-tree-dump "Replaced\[^\\n\]*with 1" "fre" } } */
+/* { dg-final { cleanup-tree-dump "fre" } } */
===================================================================
@@ -1,13 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-optimized" } */
-struct a{
- int a;
- int b;
-} a;
-int *
-t()
-{
- return (int *)&a;
-}
-/* { dg-final { scan-tree-dump "a.a" "optimized"} } */
-/* { dg-final { cleanup-tree-dump "optimized" } } */
===================================================================
@@ -1,28 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-optimized" } */
-union a
-{
- struct s1
- {
- long long a;
- long long b;
- } s1;
- struct s2
- {
- int c;
- int d;
- } s2;
- struct s3
- {
- unsigned long long e;
- unsigned long long f;
- } s3;
-} a;
-int *
-t ()
-{
- return (int *) &a;
-}
-
-/* { dg-final { scan-tree-dump "a.s2.c" "optimized"} } */
-/* { dg-final { cleanup-tree-dump "optimized" } } */
===================================================================
@@ -1,5 +1,5 @@
/* { dg-do run } */
-/* { dg-options "-O -fdump-tree-forwprop1" } */
+/* { dg-options "-O -fdump-tree-optimized-vops" } */
struct Value
{
@@ -35,12 +35,14 @@ int main(int argc, char *argv[])
return 0;
}
-/* Check that we forward propagated
+/* Check that we propagate
D.2182_13 = (struct Ref *) &D.2137.lhs;
to
D.2182_13->lhs.m ={v} &I;
yielding
- D.2137.lhs.m ={v} &I; */
+ D.2137.lhs.m ={v} &I;
+ so that SRA can promote all locals to registers and we end up
+ referencing a single virtual operand at abort () after optimization. */
-/* { dg-final { scan-tree-dump-times "D\\\.....\\\..hs\\\.m =" 2 "forwprop1" } } */
-/* { dg-final { cleanup-tree-dump "forwprop1" } } */
+/* { dg-final { scan-tree-dump-times ".MEM_\[0-9\]*\\\(D\\\)" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */