[tree-ssa] Testsuite updates and new test

law@redhat.com law@redhat.com
Thu Aug 14 19:26:00 GMT 2003


Minor updates.  One of the tests tended to create stuff like 0->fld[0].rtmem
which it appears led to special casing (*0) in tree-dfa.c.  Ugh.  Anyway,
I've updated the test so that it doesn't collapse the address down to zero.

Another test incorrectly required an IF statement to be removed.  Opps.

And another test for a case currently missed by the dominator optimizer.

	* gcc.dg/tree-ssa/20030711-2.c: Update slightly to avoid 
	dereferences of constant addresses.

	* gcc.dg/tree-ssa/20030729-1.c: Remove incorrect test for
	IF statement removal.

	* gcc.dg/tree-ssa/20030808-1.c: New test.

Index: 20030711-2.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa/Attic/20030711-2.c,v
retrieving revision 1.1.2.3
diff -c -3 -p -r1.1.2.3 20030711-2.c
*** 20030711-2.c	12 Aug 2003 17:42:34 -0000	1.1.2.3
--- 20030711-2.c	14 Aug 2003 19:21:25 -0000
*************** union tree_node
*** 32,48 ****
    struct tree_decl decl;
  };
  long
! get_alias_set (t)
       tree t;
  {
!   if (t->decl.rtl && (((t->decl.rtl ? 0
                          : (make_decl_rtl (t, 0), t->decl.rtl)))->code))
!     return (((((t->decl.rtl ? 0 : (make_decl_rtl (t, 0), t->decl.rtl)))->
                fld[1]).rtmem) == 0 ? 0 : (((((
                                                 {
                                                 t;}
                                              )->decl.
!                                             rtl ? 0 : (make_decl_rtl (t, 0),
                                                         t->decl.rtl)))->
                                            fld[1]).rtmem)->alias);
  }
--- 32,49 ----
    struct tree_decl decl;
  };
  long
! get_alias_set (t,z)
       tree t;
+      rtx z;
  {
!   if (t->decl.rtl && (((t->decl.rtl ? z
                          : (make_decl_rtl (t, 0), t->decl.rtl)))->code))
!     return (((((t->decl.rtl ? z : (make_decl_rtl (t, 0), t->decl.rtl)))->
                fld[1]).rtmem) == 0 ? 0 : (((((
                                                 {
                                                 t;}
                                              )->decl.
!                                             rtl ? z : (make_decl_rtl (t, 0),
                                                         t->decl.rtl)))->
                                            fld[1]).rtmem)->alias);
  }
Index: 20030729-1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/tree-ssa/Attic/20030729-1.c,v
retrieving revision 1.1.2.3
diff -c -3 -p -r1.1.2.3 20030729-1.c
*** 20030729-1.c	12 Aug 2003 17:42:34 -0000	1.1.2.3
--- 20030729-1.c	14 Aug 2003 19:21:26 -0000
*************** readonly_fields_p (type)
*** 49,55 ****
  /* There should be one load of ->common.code.  We currently fail this
     because we load from ->common.code using different types.  */
  /* { dg-final { scan-tree-dump-times "common\.code" 1 "ssa"} } */
- 
- /* And there should be a single conditional since the second conditional
-    is redundant with the first.  */
- /* { dg-final { scan-tree-dump-times "if " 1 "ssa"} } */
--- 49,51 ----
Index: 20030808-1.c
===================================================================
RCS file: 20030808-1.c
diff -N 20030808-1.c
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- 20030808-1.c	14 Aug 2003 19:21:26 -0000
***************
*** 0 ****
--- 1,38 ----
+ /* { dg-do compile } */
+ /* { dg-options "-O1 -fdump-tree-ssa" } */
+       
+ 
+ struct rtx_def;
+ typedef struct rtx_def *rtx;
+ enum rtx_code
+ {
+   UNKNOWN,
+   CODE_LABEL,
+   NOTE,
+   LAST_AND_UNUSED_RTX_CODE
+ };
+ typedef union rtunion_def rtunion;
+ struct rtx_def
+ {
+   enum rtx_code code:16;
+ };
+ void
+ delete_dead_jumptables ()
+ {
+   rtx insn, next;
+   if (insn->code == CODE_LABEL)
+     {
+       rtx const _rtx = insn;
+       if (_rtx->code != CODE_LABEL && _rtx->code != NOTE)
+ 	abort ();
+     }
+   ;
+ }
+ 
+ /* There should be precisely one load of ->code.  If there is
+    more than, then the dominator optimizations failed.  */
+ /* { dg-final { scan-tree-dump-times "->code" 1 "ssa"} } */
+    
+ /* There should be one IF statement.
+ /* { dg-final { scan-tree-dump-times "if " 1 "ssa"} } */
+ 






More information about the Gcc-patches mailing list