This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[tree-ssa] tidy ssa-ccp-* results
- From: Richard Henderson <rth at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 4 Feb 2004 03:20:01 -0800
- Subject: [tree-ssa] tidy ssa-ccp-* results
I don't like any of these tests. Only one of the ssa-ccp-N.c
tests actually tests something related to the CCP algorithm.
None of these are it.
Three of the tests are basically duplicates of aggregate
tests that already exist elsewhere. I killed them.
r~
* gcc.dg/tree-ssa/20040204-1.c: Rename from ssa-ccp-5.c.
Look at .optimized output. XFAIL.
* gcc.dg/tree-ssa/ssa-ccp-11.c: XFAIL.
* gcc.dg/tree-ssa/ssa-ccp-3.c: XFAIL.
* gcc.dg/tree-ssa/ssa-ccp-4.c: Remove.
* gcc.dg/tree-ssa/ssa-ccp-6.c: Remove.
* gcc.dg/tree-ssa/ssa-ccp-8.c: Remove.
Index: 20040204-1.c
===================================================================
RCS file: 20040204-1.c
diff -N 20040204-1.c
*** /dev/null 1 Jan 1970 00:00:00 -0000
--- 20040204-1.c 4 Feb 2004 11:11:31 -0000
***************
*** 0 ****
--- 1,36 ----
+ /* { dg-do compile } */
+ /* { dg-options "-O1 -fdump-tree-optimized" } */
+
+ extern void link_error (void);
+
+ /*
+ test that a condition is propagated inside an if
+ */
+
+ void test5 (int x)
+ {
+ extern int foo (int);
+ if (x == 0)
+ foo (x);
+ else if (x == 0 )
+ link_error ();
+ }
+
+ void test55 (int x, int y)
+ {
+ int u;
+ if (x == 5 && y)
+ {
+ u = x + 22;
+ if (u != 27)
+ link_error ();
+ }
+ }
+
+ /* There should be not link_error calls, if there is any the
+ optimization has failed */
+ /* ??? Ug. This one may or may not fail based on how fold decides
+ that the && should be emitted (based on BRANCH_COST). Fix this
+ by teaching dom to look through && and register all components
+ as true. */
+ /* { dg-final { scan-tree-dump-times "link_error" 0 "optimized" { xfail *-*-* } } } */
Index: ssa-ccp-11.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa/Attic/ssa-ccp-11.c,v
retrieving revision 1.1.2.1
diff -c -p -d -r1.1.2.1 ssa-ccp-11.c
*** ssa-ccp-11.c 17 Dec 2003 00:07:47 -0000 1.1.2.1
--- ssa-ccp-11.c 4 Feb 2004 11:11:31 -0000
*************** int test1111 (int param)
*** 38,41 ****
}
/* All ifs should be eliminated. */
! /* { dg-final { scan-tree-dump-times "if" 0 "optimized"} } */
--- 38,41 ----
}
/* All ifs should be eliminated. */
! /* { dg-final { scan-tree-dump-times "if" 0 "optimized" { xfail *-*-* } } } */
Index: ssa-ccp-3.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa/Attic/ssa-ccp-3.c,v
retrieving revision 1.1.2.1
diff -c -p -d -r1.1.2.1 ssa-ccp-3.c
*** ssa-ccp-3.c 16 Jul 2003 15:18:35 -0000 1.1.2.1
--- ssa-ccp-3.c 4 Feb 2004 11:11:31 -0000
*************** int* test666 (int * __restrict__ rp1, in
*** 129,133 ****
/* There should be not link_error calls, if there is any the
optimization has failed */
! /* { dg-final { scan-tree-dump-times "link_error" 0 "ccp"} } */
!
--- 129,134 ----
/* There should be not link_error calls, if there is any the
optimization has failed */
! /* ??? While we indeed don't handle some of these, a couple of the
! restrict tests are incorrect. */
! /* { dg-final { scan-tree-dump-times "link_error" 0 "ccp" { xfail *-*-* } } } */
Index: ssa-ccp-4.c
===================================================================
RCS file: ssa-ccp-4.c
diff -N ssa-ccp-4.c
*** ssa-ccp-4.c 16 Jul 2003 15:18:35 -0000 1.1.2.1
--- /dev/null 1 Jan 1970 00:00:00 -0000
***************
*** 1,46 ****
- /* { dg-do compile } */
- /* { dg-options "-O1 -fdump-tree-ccp" } */
-
- extern void link_error (void);
-
- /* some array tests -- more to come */
-
-
- void test14 (int *intarr)
- {
- intarr[0] = 0;
- if (intarr[0] != 0)
- link_error ();
- }
-
-
- void test15 (int *intarr)
- {
- intarr[0] = 0;
- intarr[1] = 1;
- if (intarr[0] != 0)
- link_error ();
- if (intarr[1] != 1)
- link_error ();
- }
-
-
- void test16 (int *intarr, short *shortarr)
- {
- intarr[0] = 1;
- shortarr[0] = 1;
- intarr[0] += 1;
- shortarr[0] += 1;
-
- if (intarr[0] != 2)
- link_error ();
-
- if (shortarr[0] != 2)
- link_error ();
- }
-
-
- /* There should be not link_error calls, if there is any the
- optimization has failed */
- /* { dg-final { scan-tree-dump-times "link_error" 0 "ccp"} } */
-
--- 0 ----
Index: ssa-ccp-5.c
===================================================================
RCS file: ssa-ccp-5.c
diff -N ssa-ccp-5.c
*** ssa-ccp-5.c 16 Jul 2003 15:18:35 -0000 1.1.2.1
--- /dev/null 1 Jan 1970 00:00:00 -0000
***************
*** 1,33 ****
- /* { dg-do compile } */
- /* { dg-options "-O1 -fdump-tree-ccp" } */
-
- extern void link_error (void);
-
- /*
- test that a condition is propagated inside an if
- */
-
- void test5 (int x)
- {
- extern int foo (int);
- if (x == 0)
- foo (x);
- else if (x == 0 )
- link_error ();
- }
-
- void test55 (int x, int y)
- {
- int u;
- if (x == 5 && y)
- {
- u = x + 22;
- if (u != 27)
- link_error ();
- }
- }
-
- /* There should be not link_error calls, if there is any the
- optimization has failed */
- /* { dg-final { scan-tree-dump-times "link_error" 0 "ccp"} } */
-
--- 0 ----
Index: ssa-ccp-6.c
===================================================================
RCS file: ssa-ccp-6.c
diff -N ssa-ccp-6.c
*** ssa-ccp-6.c 16 Jul 2003 15:18:35 -0000 1.1.2.1
--- /dev/null 1 Jan 1970 00:00:00 -0000
***************
*** 1,61 ****
- /* { dg-do compile } */
- /* { dg-options "-O1 -fno-tree-dominator-opts -fdump-tree-ccp" } */
-
- extern void link_error (void);
-
- /* tests to check if some identities can be proven by the compiler */
-
-
- void test6 (unsigned int a)
- {
- if (a != a)
- link_error ();
- }
-
- void test66 (unsigned int a)
- {
- unsigned int b = a;
- if (b != a)
- link_error ();
- }
-
- void test666 (unsigned int a)
- {
- unsigned int b = a - 32;
- if (b != (a - 32))
- link_error ();
- }
-
- void test6666 (unsigned int a)
- {
- if (a-32 != a-32)
- link_error ();
- }
-
-
-
- /*
- This should be moved to a place that scans the copyprop dump
- */
-
- void test66666 (int a)
- {
- int b = a;
- if (a > 25)
- {
- int c = b;
- if (c < 30)
- {
- int d = c;
- if (d != a)
- link_error ();
-
- }
- }
- }
-
-
- /* There should be not link_error calls, if there is any the
- optimization has failed */
- /* { dg-final { scan-tree-dump-times "link_error" 0 "ccp"} } */
-
--- 0 ----
Index: ssa-ccp-8.c
===================================================================
RCS file: ssa-ccp-8.c
diff -N ssa-ccp-8.c
*** ssa-ccp-8.c 16 Jul 2003 15:18:35 -0000 1.1.2.1
--- /dev/null 1 Jan 1970 00:00:00 -0000
***************
*** 1,97 ****
- /* { dg-do compile } */
- /* { dg-options "-O1 -fdump-tree-ccp" } */
-
- /* structures -- more tests to come */
-
-
- struct foo {
- int a;
- int b;
- int c[10];
- short d;
- };
-
- extern void link_error (void);
-
- void
- test8 (struct foo *f)
- {
- f->a = 0;
- f->b = 0;
- if (f->a != 0)
- link_error ();
- }
-
- void
- test88 (struct foo f)
- {
- f.a = 0;
- f.b = 0;
- if (f.a != 0)
- link_error ();
- }
-
- void
- test888 (struct foo *f)
- {
- f->c[0] = 0;
- f->c[1] = 0;
- if (f->c[0] != 0)
- link_error ();
- }
-
-
- void
- test8888 (struct foo f)
- {
- f.a = 0;
- f.d = 0;
- if (f.a != 0)
- link_error ();
- }
-
- void
- test88888 (struct foo *f)
- {
- f->a = 0;
- f->d = 0;
- if (f->a != 0)
- link_error ();
- }
-
- void
- test888888 (struct foo *f)
- {
- short k;
- f->a = 0;
- k = 6;
- if (f->a != 0)
- link_error ();
- }
-
-
- void
- test8888888 (struct foo f)
- {
- short k;
- f.a = 0;
- k = 6;
- if (f.a != 0)
- link_error ();
- }
-
- void
- test88888888 (int *arr)
- {
- short k;
- arr[0] = 0;
- k = 6;
- if (arr[0] != 0)
- link_error ();
- }
-
-
- /* There should be no link_error calls, if there is any, the
- optimization has failed */
- /* { dg-final { scan-tree-dump-times "link_error" 0 "ccp"} } */
-
--- 0 ----