This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[tree-ssa] New tests


20030821-1.c is a test for Zdenek for the bug we recently fixed in
bsi_next_in_bb.  This test should be passing.

20030815-1.c is a test for our over-active casting, which creates lots
of useless copies when we convert trees into RTL.  This test should
be failing.

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

Index: gcc.dg/tree-ssa/20030815-1.c
===================================================================
RCS file: gcc.dg/tree-ssa/20030815-1.c
diff -N gcc.dg/tree-ssa/20030815-1.c
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- gcc.dg/tree-ssa/20030815-1.c	26 Aug 2003 08:09:53 -0000
***************
*** 0 ****
--- 1,41 ----
+ /* { dg-do compile } */
+ /* { dg-options "-O1 -fdump-tree-ssa" } */
+ 
+ typedef unsigned int size_t;
+ struct rtx_def;
+ typedef struct rtx_def *rtx;
+ typedef union varray_data_tag
+ {
+   struct reg_info_def *reg[1];
+ } varray_data;
+ struct varray_head_tag
+ {
+   size_t num_elements;
+   varray_data data;
+ };
+ typedef struct varray_head_tag *varray_type;
+ typedef struct reg_info_def
+ {
+ } reg_info;
+ extern varray_type reg_n_info;
+ static rtx *reg_base_value;
+ static rtx *new_reg_base_value;
+ static rtx
+ blah (unsigned int regno)
+ {
+   if (new_reg_base_value[regno] && ((*(
+ 					{
+ 					if (regno >=
+ 					    reg_n_info->
+ 					    num_elements)
+ 					abort ();
+ 					&reg_n_info->data.reg[regno];}
+ 				     ))))
+     return reg_base_value[regno];
+ }
+ 
+ /* If we have a cast to a struct rtx_def * *, then we failed to
+    eliminate some useless typecasting.  */
+ /* { dg-final { scan-tree-dump-times "\\(struct rtx_def \\* \\*\\)" 0 "ssa"} 
} */
+                                                                              

+ 
Index: gcc.dg/tree-ssa/20030821-1.c
===================================================================
RCS file: gcc.dg/tree-ssa/20030821-1.c
diff -N gcc.dg/tree-ssa/20030821-1.c
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- gcc.dg/tree-ssa/20030821-1.c	26 Aug 2003 08:09:54 -0000
***************
*** 0 ****
--- 1,23 ----
+ /* { dg-do compile } */
+ /* { dg-options "-O1 -fdump-tree-optimized" } */
+ 
+ void foo(int k)
+ {
+   int i = 1;
+   void *label;
+ 
+   label = k ? &&x : &&y;
+ 
+   if (k == 1)
+     goto *label;
+ 
+   i = 0;
+   goto z;
+ z:
+ x:
+   if (i)
+     dont_remove ();
+ y: ;
+ }
+ 
+ /* { dg-final { scan-tree-dump-times "dont_remove" 1 "optimized"} } */







Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]