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] PATCH to finish is_gimple_stmt


Finishing up.  Tested athlon-pc-linux-gnu.

2003-06-26  Jason Merrill  <jason@redhat.com>

	* tree-simple.c (is_gimple_stmt): Complete.

*** tree-simple.c.~1~	2003-06-25 10:54:46.000000000 -0400
--- tree-simple.c	2003-06-26 15:54:46.000000000 -0400
*************** is_gimple_const (t)
*** 603,608 ****
--- 603,611 ----
  	  || TREE_CODE (t) == VECTOR_CST);
  }
  
+ /* Return nonzero if T looks like a valid GIMPLE statement.  Note that it
+    doesn't recurse to verify that everything is fully simplified.  */
+ 
  int
  is_gimple_stmt (tree t)
  {
*************** is_gimple_stmt (tree t)
*** 630,647 ****
  
      default:
        /* Not an expression?!?  */
!       abort ();
      }
  
    switch (code)
      {
      case CALL_EXPR:
      case MODIFY_EXPR:
        return 1;
  
      default:
!       /* FIXME enumerate the acceptable codes and change this to 0.  */
!       return 1;
      }
  }
  
--- 633,675 ----
  
      default:
        /* Not an expression?!?  */
!       return 0;
      }
  
    switch (code)
      {
+     case BIND_EXPR:
+     case COND_EXPR:
+       /* These are only valid if they're void.  */
+       return VOID_TYPE_P (TREE_TYPE (t));
+ 
+     case LOOP_EXPR:
+     case SWITCH_EXPR:
+     case GOTO_EXPR:
+     case RETURN_EXPR:
+     case LABEL_EXPR:
+     case CASE_LABEL_EXPR:
+     case TRY_CATCH_EXPR:
+     case TRY_FINALLY_EXPR:
+     case EH_FILTER_EXPR:
+     case CATCH_EXPR:
+     case ASM_EXPR:
+       /* These are always void.  */
+       return 1;
+ 
+     case VA_ARG_EXPR:
+       /* FIXME this should be lowered.  */
+       return 1;
+ 
+     case COMPOUND_EXPR:
+       /* FIXME should we work harder to make COMPOUND_EXPRs void?  */
      case CALL_EXPR:
      case MODIFY_EXPR:
+       /* These are valid regardless of their type.  */
        return 1;
  
      default:
!       return 0;
      }
  }
  

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