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 test


This is a new test which checks for another case where the dominator
optimizer should be removing a redundant load, but doesn't.  I'll be
installing changes to make this test pass momentarily.

        * gcc.dg/tree-ssa/20030807-5.c: New test.

Index: gcc.dg/tree-ssa/20030807-5.c
===================================================================
RCS file: gcc.dg/tree-ssa/20030807-5.c
diff -N gcc.dg/tree-ssa/20030807-5.c
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- gcc.dg/tree-ssa/20030807-5.c	11 Aug 2003 16:16:52 -0000
***************
*** 0 ****
--- 1,36 ----
+ /* { dg-do compile */
+ /* { dg-options "-O1 -fdump-tree-ssa" } */
+                                                                              

+ struct rtx_def;
+ typedef struct rtx_def *rtx;
+ 
+ 
+ struct rtx_def
+ {
+ 
+   int code;
+   unsigned int unchanging:1;
+ 
+ };
+ static rtx current_sym_addr;
+ 
+ static int
+ foo ()
+ {
+   if (current_sym_addr->code == 42
+       && (({
+ 	       rtx _rtx = current_sym_addr;
+ 	       if (((_rtx)->code) != 42)
+ 	         abort ();
+ 	       _rtx;}
+ 	   )->unchanging))
+     ;
+ }
+ 
+ /* 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 precisely one IF statement.  If there is
+    more than, then the dominator optimizations failed.  */
+ /* { dg-final { scan-tree-dump-times "if " 1 "ssa"} } */

  




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