public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Adjust testcases that scan the store_ccp dump
@ 2008-03-25 15:34 Richard Guenther
  0 siblings, 0 replies; only message in thread
From: Richard Guenther @ 2008-03-25 15:34 UTC (permalink / raw)
  To: gcc-patches


Most of them are optimized way earlier, so better check that.  This
reduces the testsuite noise if disabling store_ccp.

Tested on x86_64-unknown-linux-gnu, I'll apply this later.

Thanks,
Richard.

2008-03-25  Richard Guenther  <rguenther@suse.de>

	* gcc.dg/tree-ssa/20030731-2.c: Scan dce1 dump.
	* gcc.dg/tree-ssa/20030917-1.c: Scan optimized dump.
	* gcc.dg/tree-ssa/20030917-3.c: Scan ccp1 dump.
	* gcc.dg/tree-ssa/20040721-1.c: Test linking, do not disable DOM.
	* gcc.dg/tree-ssa/pr21574.c: Scan the fre dump.
	* gcc.dg/tree-ssa/ssa-ccp-1.c: Scan ccp1 dump.
	* gcc.dg/tree-ssa/ssa-ccp-3.c: Scan ccp2 dump.

Index: gcc/testsuite/gcc.dg/tree-ssa/20030731-2.c
===================================================================
*** gcc/testsuite/gcc.dg/tree-ssa/20030731-2.c.orig	2008-03-25 13:37:42.000000000 +0100
--- gcc/testsuite/gcc.dg/tree-ssa/20030731-2.c	2008-03-25 13:52:09.000000000 +0100
***************
*** 1,7 ****
  /* { dg-do compile } */
! /* { dg-options "-O2 -fdump-tree-store_ccp" } */
!   
  
  bar (int i, int partial, int args_addr)
  {
    int offset = 0;
--- 1,7 ----
  /* { dg-do compile } */
! /* { dg-options "-O2 -fdump-tree-dce1" } */
  
+ void
  bar (int i, int partial, int args_addr)
  {
    int offset = 0;
*************** bar (int i, int partial, int args_addr)
*** 13,17 ****
  
  /* There should be only one IF conditional since the first does nothing
     useful.  */
! /* { dg-final { scan-tree-dump-times "if " 1 "store_ccp"} } */
! /* { dg-final { cleanup-tree-dump "store_ccp" } } */
--- 13,17 ----
  
  /* There should be only one IF conditional since the first does nothing
     useful.  */
! /* { dg-final { scan-tree-dump-times "if " 1 "dce1"} } */
! /* { dg-final { cleanup-tree-dump "dce1" } } */
Index: gcc/testsuite/gcc.dg/tree-ssa/20030917-1.c
===================================================================
*** gcc/testsuite/gcc.dg/tree-ssa/20030917-1.c.orig	2008-03-25 13:37:42.000000000 +0100
--- gcc/testsuite/gcc.dg/tree-ssa/20030917-1.c	2008-03-25 13:37:51.000000000 +0100
***************
*** 1,5 ****
  /* { dg-do compile } */
! /* { dg-options "-O2 -fdump-tree-store_ccp" } */
    
  
  extern int board[];
--- 1,5 ----
  /* { dg-do compile } */
! /* { dg-options "-O2 -fdump-tree-optimized" } */
    
  
  extern int board[];
*************** findbestextension (int blah, int blah2)
*** 15,19 ****
  }
  
  /* The argument to "foo" should be a variable, not a constant.  */
! /* { dg-final { scan-tree-dump-times "foo .defval" 1 "store_ccp"} } */
! /* { dg-final { cleanup-tree-dump "store_ccp" } } */
--- 15,19 ----
  }
  
  /* The argument to "foo" should be a variable, not a constant.  */
! /* { dg-final { scan-tree-dump-times "foo .defval" 1 "optimized"} } */
! /* { dg-final { cleanup-tree-dump "optimized" } } */
Index: gcc/testsuite/gcc.dg/tree-ssa/20030917-3.c
===================================================================
*** gcc/testsuite/gcc.dg/tree-ssa/20030917-3.c.orig	2008-03-25 13:37:42.000000000 +0100
--- gcc/testsuite/gcc.dg/tree-ssa/20030917-3.c	2008-03-25 13:52:49.000000000 +0100
***************
*** 1,5 ****
  /* { dg-do compile } */
! /* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-store_ccp" } */
  
  extern int printf (const char *, ...); 
  
--- 1,5 ----
  /* { dg-do compile } */
! /* { dg-options "-O -fdump-tree-ccp1" } */
  
  extern int printf (const char *, ...); 
  
*************** main ()
*** 20,24 ****
  
  
  /* The argument to "printf" should be a constant, not a variable.  */
! /* { dg-final { scan-tree-dump-times "printf.*, 0" 1 "store_ccp"} } */
! /* { dg-final { cleanup-tree-dump "store_ccp" } } */
--- 20,24 ----
  
  
  /* The argument to "printf" should be a constant, not a variable.  */
! /* { dg-final { scan-tree-dump-times "printf.*, 0" 1 "ccp1"} } */
! /* { dg-final { cleanup-tree-dump "ccp1" } } */
Index: gcc/testsuite/gcc.dg/tree-ssa/20040721-1.c
===================================================================
*** gcc/testsuite/gcc.dg/tree-ssa/20040721-1.c.orig	2008-03-25 13:37:42.000000000 +0100
--- gcc/testsuite/gcc.dg/tree-ssa/20040721-1.c	2008-03-25 13:37:51.000000000 +0100
***************
*** 1,11 ****
! /* { dg-do compile } */
! /* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-store_ccp-vops" } */
  
  /* Test to check whether global variables are being
     constant propagated. */
  
  int G;
  
  foo (int i)
  {
     if (i > 0)
--- 1,14 ----
! /* { dg-do link } */
! /* { dg-options "-O2" } */
  
  /* Test to check whether global variables are being
     constant propagated. */
  
+ extern void link_error (void);
+ 
  int G;
  
+ void
  foo (int i)
  {
     if (i > 0)
*************** foo (int i)
*** 17,28 ****
       link_error ();
  }
  
  main ()
  {
     foo (0);
     return 0;
  }
  
- /* There should be no G on the RHS of an assignment. */
- /* { dg-final { scan-tree-dump-times "= G;" 0 "store_ccp"} } */
- /* { dg-final { cleanup-tree-dump "store_ccp" } } */
--- 20,29 ----
       link_error ();
  }
  
+ int
  main ()
  {
     foo (0);
     return 0;
  }
  
Index: gcc/testsuite/gcc.dg/tree-ssa/pr21574.c
===================================================================
*** gcc/testsuite/gcc.dg/tree-ssa/pr21574.c.orig	2008-03-25 13:37:42.000000000 +0100
--- gcc/testsuite/gcc.dg/tree-ssa/pr21574.c	2008-03-25 13:37:51.000000000 +0100
***************
*** 1,5 ****
  /* { dg-do compile } */
! /* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-store_ccp" } */
  
  int
  foo (int *p)
--- 1,5 ----
  /* { dg-do compile } */
! /* { dg-options "-O -fdump-tree-fre-details" } */
  
  int
  foo (int *p)
*************** foo (int *p)
*** 8,13 ****
    return *p;
  }
  
! /* The store to *p should be propagated to the return statement.  */
! /* { dg-final { scan-tree-dump-times "return 0" 1 "store_ccp" } } */
! /* { dg-final { cleanup-tree-dump "store_ccp" } } */
--- 8,13 ----
    return *p;
  }
  
! /* The store to *p should be propagated to the load statement.  */
! /* { dg-final { scan-tree-dump "Replaced \\\*p_.\\\(D\\\) with 0" "fre" } } */
! /* { dg-final { cleanup-tree-dump "fre" } } */
Index: gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-1.c
===================================================================
*** gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-1.c.orig	2008-03-25 13:37:42.000000000 +0100
--- gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-1.c	2008-03-25 13:54:44.000000000 +0100
***************
*** 1,5 ****
  /* { dg-do compile } */ 
! /* { dg-options "-O2 -fdump-tree-store_ccp" } */
  
  extern void link_error (void);
  
--- 1,5 ----
  /* { dg-do compile } */ 
! /* { dg-options "-O -fdump-tree-ccp1" } */
  
  extern void link_error (void);
  
*************** void test11111 (int p, int q, int r)
*** 71,75 ****
  
  /* There should be not link_error calls, if there is any the
     optimization has failed */
! /* { dg-final { scan-tree-dump-times "link_error" 0 "store_ccp"} } */
! /* { dg-final { cleanup-tree-dump "store_ccp" } } */
--- 71,75 ----
  
  /* There should be not link_error calls, if there is any the
     optimization has failed */
! /* { dg-final { scan-tree-dump-times "link_error" 0 "ccp1"} } */
! /* { dg-final { cleanup-tree-dump "ccp1" } } */
Index: gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-3.c
===================================================================
*** gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-3.c.orig	2008-03-25 13:37:42.000000000 +0100
--- gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-3.c	2008-03-25 14:00:50.000000000 +0100
***************
*** 1,10 ****
  /* { dg-do compile } */
! /* { dg-options "-O2 -fdump-tree-store_ccp" } */
  
  extern void link_error (void);
  
! /* some addresses clearly cannot be equal, check that some address
!     expressions can be evaluated as constants */
  
  char g1, g2;
  void test6 (char p1, char p2)
--- 1,12 ----
  /* { dg-do compile } */
! /* { dg-options "-O -fdump-tree-ccp2" } */
  
  extern void link_error (void);
  
! /* Some addresses clearly cannot be equal, check that some address
!    expressions can be evaluated as constants.
!    Most of the tests are folding tests, but at least some require
!    points-to analysis, so we scan the first CCP dump after PTA.  */
  
  char g1, g2;
  void test6 (char p1, char p2)
*************** int* test666 (int * __restrict__ rp1, in
*** 131,135 ****
     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 "store_ccp" { xfail *-*-* } } } */
! /* { dg-final { cleanup-tree-dump "store_ccp" } } */
--- 133,137 ----
     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 "ccp2" { xfail *-*-* } } } */
! /* { dg-final { cleanup-tree-dump "ccp2" } } */

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-03-25 14:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-25 15:34 [PATCH] Adjust testcases that scan the store_ccp dump Richard Guenther

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).