This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[tree-ssa] Test for useless stmt removal
- From: law at redhat dot com
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 15 Aug 2003 06:43:22 -0600
- Subject: [tree-ssa] Test for useless stmt removal
- Reply-to: law at redhat dot com
This patch extends to tests so that they also verify that a useless
statement created by the out-of-ssa pass is properly removed.
* gcc.dg/tree-ssa/20030814-4.c: Test optimized output to verify
useless statement created by out-of-ssa pass is removed.
* gcc.dg/tree-ssa/20030814-5.c: Similarly.
Index: 20030814-4.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa/Attic/20030814-4.c,v
retrieving revision 1.1.2.1
diff -c -3 -p -r1.1.2.1 20030814-4.c
*** 20030814-4.c 15 Aug 2003 05:16:32 -0000 1.1.2.1
--- 20030814-4.c 15 Aug 2003 12:40:57 -0000
***************
*** 1,5 ****
/* { dg-do compile } */
! /* { dg-options "-O1 -fdump-tree-ssa" } */
union tree_node;
typedef union tree_node *tree;
--- 1,5 ----
/* { dg-do compile } */
! /* { dg-options "-O1 -fdump-tree-ssa -fdump-tree-optimized" } */
union tree_node;
typedef union tree_node *tree;
*************** blah (decl, set)
*** 34,36 ****
--- 34,40 ----
/* There should be precisely one reference to pointer_alias_set. If there is
more than one, then the dominator optimizations failed. */
/* { dg-final { scan-tree-dump-times "pointer_alias_set" 1 "ssa"} } */
+
+ /* The assignment set = -1 in the ELSE clause of the last IF
+ statement should be removed by the final cleanup phase. */
+ /* { dg-final { scan-tree-dump-times "set = -1" 0 "optimized"} } */
Index: 20030814-5.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa/Attic/20030814-5.c,v
retrieving revision 1.1.2.1
diff -c -3 -p -r1.1.2.1 20030814-5.c
*** 20030814-5.c 15 Aug 2003 05:16:32 -0000 1.1.2.1
--- 20030814-5.c 15 Aug 2003 12:40:57 -0000
***************
*** 1,5 ****
/* { dg-do compile } */
! /* { dg-options "-O1 -fdump-tree-ssa" } */
union tree_node;
typedef union tree_node *tree;
--- 1,5 ----
/* { dg-do compile } */
! /* { dg-options "-O1 -fdump-tree-ssa -fdump-tree-optimized" } */
union tree_node;
typedef union tree_node *tree;
*************** blah (decl, set)
*** 22,28 ****
tree decl;
long set;
{
! decl->decl.pointer_alias_set = oof ();;
if (tree_code_type[decl->common.code] != 'd')
abort ();
record_alias_subset (decl->decl.pointer_alias_set);
--- 22,28 ----
tree decl;
long set;
{
! decl->decl.pointer_alias_set = oof();
if (tree_code_type[decl->common.code] != 'd')
abort ();
record_alias_subset (decl->decl.pointer_alias_set);
*************** blah (decl, set)
*** 34,36 ****
--- 34,40 ----
/* There should be precisely one reference to pointer_alias_set. If there is
more than one, then the dominator optimizations failed. */
/* { dg-final { scan-tree-dump-times "pointer_alias_set" 1 "ssa"} } */
+
+ /* The assignment set = -1 in the ELSE clause of the last IF
+ statement should be removed by the final cleanup phase. */
+ /* { dg-final { scan-tree-dump-times "set = -1" 0 "optimized"} } */