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]

Re: [Java] PATCH for optimization/12547


tree-ssa version.

2003-11-12  Jason Merrill  <jason@redhat.com>

	PR optimization/12547
	* lang.c (java_tree_inlining_walk_subtrees): Restore.
	(LANG_HOOKS_TREE_INLINING_WALK_SUBTREES): Restore.

	* lang.c (java_tree_inlining_walk_subtrees): Just walk
	BLOCK_EXPR_BODY directly.

*** java/lang.c.~1~	2003-11-12 12:03:25.000000000 -0500
--- java/lang.c	2003-11-12 18:16:57.000000000 -0500
*************** static int java_handle_option (size_t sc
*** 57,62 ****
--- 57,64 ----
  static void put_decl_string (const char *, int);
  static void put_decl_node (tree);
  static void java_print_error_function (diagnostic_context *, const char *);
+ static tree java_tree_inlining_walk_subtrees (tree *, int *, walk_tree_fn,
+ 					      void *, void *);
  static int java_unsafe_for_reeval (tree);
  static int merge_init_test_initialization (void * *, void *);
  static int inline_init_test_initialization (void * *, void *);
*************** struct language_function GTY(())
*** 256,261 ****
--- 258,266 ----
  #undef LANG_HOOKS_GIMPLIFY_EXPR
  #define LANG_HOOKS_GIMPLIFY_EXPR java_gimplify_expr
  
+ #undef LANG_HOOKS_TREE_INLINING_WALK_SUBTREES
+ #define LANG_HOOKS_TREE_INLINING_WALK_SUBTREES java_tree_inlining_walk_subtrees
+ 
  #undef LANG_HOOKS_DECL_OK_FOR_SIBCALL
  #define LANG_HOOKS_DECL_OK_FOR_SIBCALL java_decl_ok_for_sibcall
  
*************** decl_constant_value (tree decl)
*** 809,814 ****
--- 814,858 ----
    return decl;
  }
  
+ /* Walk the language specific tree nodes during inlining.  */
+ 
+ static tree
+ java_tree_inlining_walk_subtrees (tree *tp ATTRIBUTE_UNUSED,
+ 				  int *subtrees ATTRIBUTE_UNUSED,
+ 				  walk_tree_fn func ATTRIBUTE_UNUSED,
+ 				  void *data ATTRIBUTE_UNUSED,
+ 				  void *htab ATTRIBUTE_UNUSED)
+ {
+   enum tree_code code;
+   tree result;
+ 
+ #define WALK_SUBTREE(NODE)				\
+   do							\
+     {							\
+       result = walk_tree (&(NODE), func, data, htab);	\
+       if (result)					\
+ 	return result;					\
+     }							\
+   while (0)
+ 
+   tree t = *tp;
+   if (!t)
+     return NULL_TREE;
+ 
+   code = TREE_CODE (t);
+   switch (code)
+     {
+     case BLOCK:
+       WALK_SUBTREE (BLOCK_EXPR_BODY (t));
+       return NULL_TREE;
+ 
+     default:
+       return NULL_TREE;
+     }
+ 
+   #undef WALK_SUBTREE
+ }
+ 
  /* Called from unsafe_for_reeval.  */
  static int
  java_unsafe_for_reeval (tree t)

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