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] Remove RTL expansion langhooks


As discussed earlier today in
http://gcc.gnu.org/ml/gcc-patches/2004-04/msg00508.html, the langhooks
used for RTL expansion are not needed anymore.  They all just end up
calling expand_expr_stmt_value.

Jason/Richard, do you see any value in keeping these hooks?  None of
them seem to do anything interesting.

Bootstrap in progress, but so far no problems in any of the language
libraries.


Diego.


	* c-lang.c (LANG_HOOKS_RTL_EXPAND_STMT): Remove.
	* c-semantics.c (expand_stmt_toplev): Remove.
	* langhooks-def.h (LANG_HOOKS_RTL_EXPAND_INITIALIZER): Remove.
	(LANG_HOOKS_RTL_EXPAND_START): Remove.
	(LANG_HOOKS_RTL_EXPAND_STMT): Remove.
	(LANG_HOOKS_RTL_EXPAND_END): Remove.
	* langhooks.h (struct lang_hooks_for_rtl_expansion): Remove.
	(struct lang_hooks): Update.
	* tree-optimize.c (tree_rest_of_compilation): Don't call
	lang_hooks.rtl_expand.start nor lang_hooks.rtl_expand.end.
	Call expand_expr_stmt_value instead of
	lang_hooks.rtl_expand.stmt.


cp/ChangeLog.tree-ssa

	* cp-lang.c (LANG_HOOKS_RTL_EXPAND_START): Remove.
	(LANG_HOOKS_RTL_EXPAND_STMT): Remove.
	* semantics.c (cxx_expand_function_start): Remove.


fortran/ChangeLog.tree-ssa

	* fortran/f95-lang.c (gfc_expand_stmt): Remove.
	(LANG_HOOKS_RTL_EXPAND_STMT): Remove.


java/ChangeLog.tree-ssa

	* decl.c (java_expand_stmt): Remove.
	* lang.c (LANG_HOOKS_RTL_EXPAND_STMT): Remove.


objc/ChangeLog.tree-ssa

	* objc-lang.c (LANG_HOOKS_RTL_EXPAND_STMT): Remove.

Index: c-common.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-common.h,v
retrieving revision 1.141.2.49
diff -d -c -p -u -r1.141.2.49 c-common.h
--- c-common.h	24 Mar 2004 18:47:36 -0000	1.141.2.49
+++ c-common.h	8 Apr 2004 19:29:04 -0000
@@ -340,7 +340,6 @@ extern void finish_stmt_tree (tree *);
 
 extern tree walk_stmt_tree (tree *, walk_tree_fn, void *);
 extern void prep_stmt (tree);
-extern void expand_stmt_toplev (tree);
 extern tree c_begin_if_stmt (void);
 extern tree c_begin_while_stmt (void);
 extern void c_finish_while_stmt_cond (tree, tree);
Index: c-lang.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-lang.c,v
retrieving revision 1.94.2.23
diff -d -c -p -u -r1.94.2.23 c-lang.c
--- c-lang.c	1 Apr 2004 17:20:48 -0000	1.94.2.23
+++ c-lang.c	8 Apr 2004 19:29:04 -0000
@@ -97,9 +97,6 @@ enum c_language_kind c_language = clk_c;
 #undef LANG_HOOKS_DUP_LANG_SPECIFIC_DECL
 #define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL c_dup_lang_specific_decl
 
-#undef LANG_HOOKS_RTL_EXPAND_STMT
-#define LANG_HOOKS_RTL_EXPAND_STMT expand_stmt_toplev
-
 /* Attribute hooks.  */
 #undef LANG_HOOKS_COMMON_ATTRIBUTE_TABLE
 #define LANG_HOOKS_COMMON_ATTRIBUTE_TABLE c_common_attribute_table
Index: c-semantics.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-semantics.c,v
retrieving revision 1.43.2.30
diff -d -c -p -u -r1.43.2.30 c-semantics.c
--- c-semantics.c	13 Feb 2004 13:10:58 -0000	1.43.2.30
+++ c-semantics.c	8 Apr 2004 19:29:04 -0000
@@ -320,14 +320,3 @@ prep_stmt (tree t)
     input_line = STMT_LINENO (t);
   current_stmt_tree ()->stmts_are_full_exprs_p = STMT_IS_FULL_EXPR_P (t);
 }
-
-/* Expand the statement at the outermost level of a function.  */
-
-void
-expand_stmt_toplev (tree t)
-{
-  /* Gimplification didn't happen, for some reason.  */
-  if (STATEMENT_CODE_P (TREE_CODE (t)))
-    abort ();
-  expand_expr_stmt_value (t, 0, 0);
-}
Index: langhooks-def.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/langhooks-def.h,v
retrieving revision 1.34.2.33
diff -d -c -p -u -r1.34.2.33 langhooks-def.h
--- langhooks-def.h	26 Mar 2004 16:22:15 -0000	1.34.2.33
+++ langhooks-def.h	8 Apr 2004 19:29:04 -0000
@@ -137,10 +137,6 @@ extern int lhd_gimplify_expr (tree *, tr
 #define LANG_HOOKS_FUNCTION_LEAVE_NESTED lhd_do_nothing_f
 #define LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P hook_bool_tree_true
 
-#define LANG_HOOKS_RTL_EXPAND_START	lhd_do_nothing
-#define LANG_HOOKS_RTL_EXPAND_STMT	(void (*) (tree)) abort
-#define LANG_HOOKS_RTL_EXPAND_END	lhd_do_nothing
-
 /* Attribute hooks.  */
 #define LANG_HOOKS_ATTRIBUTE_TABLE		NULL
 #define LANG_HOOKS_COMMON_ATTRIBUTE_TABLE	NULL
@@ -205,12 +201,6 @@ extern int lhd_gimplify_expr (tree *, tr
   LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P	\
 }
 
-#define LANG_HOOKS_RTL_EXPAND_INITIALIZER {	\
-  LANG_HOOKS_RTL_EXPAND_START,			\
-  LANG_HOOKS_RTL_EXPAND_STMT,			\
-  LANG_HOOKS_RTL_EXPAND_END			\
-}
-
 /* Hooks for tree gimplification.  */
 #define LANG_HOOKS_GIMPLIFY_EXPR lhd_gimplify_expr
 #define LANG_HOOKS_GIMPLE_BEFORE_INLINING true
@@ -326,7 +316,6 @@ extern tree lhd_make_node (enum tree_cod
   LANG_HOOKS_TREE_DUMP_INITIALIZER, \
   LANG_HOOKS_DECLS, \
   LANG_HOOKS_FOR_TYPES_INITIALIZER, \
-  LANG_HOOKS_RTL_EXPAND_INITIALIZER, \
   LANG_HOOKS_GIMPLIFY_EXPR, \
   LANG_HOOKS_GIMPLE_BEFORE_INLINING \
 }
Index: langhooks.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/langhooks.h,v
retrieving revision 1.42.2.33
diff -d -c -p -u -r1.42.2.33 langhooks.h
--- langhooks.h	26 Mar 2004 16:22:15 -0000	1.42.2.33
+++ langhooks.h	8 Apr 2004 19:29:04 -0000
@@ -81,19 +81,6 @@ struct lang_hooks_for_functions
   bool (*missing_noreturn_ok_p) (tree);
 };
 
-/* Lang hooks for rtl code generation.  */
-struct lang_hooks_for_rtl_expansion
-{
-  /* Called after expand_function_start, but before expanding the body.  */
-  void (*start) (void);
-
-  /* Called to expand each statement.  */
-  void (*stmt) (tree);
-
-  /* Called after expanding the body but before expand_function_end.  */
-  void (*end) (void);
-};
-
 /* The following hooks are used by tree-dump.c.  */
 
 struct lang_hooks_for_tree_dump
@@ -425,8 +412,6 @@ struct lang_hooks
   struct lang_hooks_for_decls decls;
 
   struct lang_hooks_for_types types;
-
-  struct lang_hooks_for_rtl_expansion rtl_expand;
 
   /* Perform language-specific gimplification on the argument.  Returns an
      enum gimplify_status, though we can't see that type here.  */
Index: tree-optimize.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-optimize.c,v
retrieving revision 1.1.4.137
diff -d -c -p -u -r1.1.4.137 tree-optimize.c
--- tree-optimize.c	1 Apr 2004 18:28:15 -0000	1.1.4.137
+++ tree-optimize.c	8 Apr 2004 19:29:04 -0000
@@ -551,9 +551,6 @@ tree_rest_of_compilation (tree fndecl, b
   /* Set up parameters and prepare for return, for the function.  */
   expand_function_start (fndecl, 0);
 
-  /* Allow language dialects to perform special processing.  */
-  lang_hooks.rtl_expand.start ();
-
   /* If this function is `main', emit a call to `__main'
      to run global initializers, etc.  */
   if (DECL_NAME (fndecl)
@@ -562,7 +559,7 @@ tree_rest_of_compilation (tree fndecl, b
     expand_main_function ();
 
   /* Generate the RTL for this function.  */
-  lang_hooks.rtl_expand.stmt (DECL_SAVED_TREE (fndecl));
+  expand_expr_stmt_value (DECL_SAVED_TREE (fndecl), 0, 0);
 
   /* We hard-wired immediate_size_expand to zero above.
      expand_function_end will decrement this variable.  So, we set the
@@ -578,9 +575,6 @@ tree_rest_of_compilation (tree fndecl, b
   /* The following insns belong to the top scope.  */
   record_block_change (DECL_INITIAL (current_function_decl));
   
-  /* Allow language dialects to perform special processing.  */
-  lang_hooks.rtl_expand.end ();
-
   /* Generate rtl for function exit.  */
   expand_function_end ();
 
Index: cp/cp-lang.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/cp-lang.c,v
retrieving revision 1.36.2.36
diff -d -c -p -u -r1.36.2.36 cp-lang.c
--- cp/cp-lang.c	26 Mar 2004 16:23:57 -0000	1.36.2.36
+++ cp/cp-lang.c	8 Apr 2004 19:29:04 -0000
@@ -119,11 +119,6 @@ static void cxx_initialize_diagnostics (
 #undef LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P
 #define LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P cp_missing_noreturn_ok_p
 
-#undef LANG_HOOKS_RTL_EXPAND_START
-#define LANG_HOOKS_RTL_EXPAND_START cxx_expand_function_start
-#undef LANG_HOOKS_RTL_EXPAND_STMT
-#define LANG_HOOKS_RTL_EXPAND_STMT expand_stmt_toplev
-
 /* Attribute hooks.  */
 #undef LANG_HOOKS_COMMON_ATTRIBUTE_TABLE
 #define LANG_HOOKS_COMMON_ATTRIBUTE_TABLE c_common_attribute_table
Index: cp/semantics.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/semantics.c,v
retrieving revision 1.264.2.49
diff -d -c -p -u -r1.264.2.49 semantics.c
--- cp/semantics.c	26 Mar 2004 16:24:07 -0000	1.264.2.49
+++ cp/semantics.c	8 Apr 2004 19:29:05 -0000
@@ -3001,13 +3001,6 @@ finalize_nrv (tree *tp, tree var, tree r
   htab_delete (data.visited);
 }
 
-/* Start generating the RTL for FN.  */
-
-void
-cxx_expand_function_start (void)
-{
-}
-
 /* Perform initialization related to this module.  */
 
 void
Index: fortran/f95-lang.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/Attic/f95-lang.c,v
retrieving revision 1.1.2.19
diff -d -c -p -u -r1.1.2.19 f95-lang.c
--- fortran/f95-lang.c	4 Apr 2004 23:27:49 -0000	1.1.2.19
+++ fortran/f95-lang.c	8 Apr 2004 19:29:05 -0000
@@ -104,7 +104,6 @@ int global_bindings_p (void);
 void insert_block (tree);
 void set_block (tree);
 static void gfc_be_parse_file (int);
-static void gfc_expand_stmt (tree);
 static void gfc_expand_function (tree);
 
 #undef LANG_HOOKS_NAME
@@ -123,7 +122,6 @@ static void gfc_expand_function (tree);
 #undef LANG_HOOKS_SIGNED_TYPE
 #undef LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE
 #undef LANG_HOOKS_GIMPLE_BEFORE_INLINING
-#undef LANG_HOOKS_RTL_EXPAND_STMT
 #undef LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION
 
 /* Define lang hooks.  */
@@ -143,7 +141,6 @@ static void gfc_expand_function (tree);
 #define LANG_HOOKS_SIGNED_TYPE             gfc_signed_type
 #define LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE gfc_signed_or_unsigned_type
 #define LANG_HOOKS_GIMPLE_BEFORE_INLINING false
-#define LANG_HOOKS_RTL_EXPAND_STMT	gfc_expand_stmt
 #define LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION gfc_expand_function
 
 const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
@@ -200,15 +197,6 @@ static void
 gfc_expand_function (tree fndecl)
 {
   tree_rest_of_compilation (fndecl, 0);
-}
-
-/* We generate GENERIC trees, so just pass everything on to the backend
-   expanders.  */
-
-static void
-gfc_expand_stmt (tree t)
-{
-  expand_expr_stmt_value (t, 0, 0);
 }
 
 
Index: java/decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/decl.c,v
retrieving revision 1.128.2.38
diff -d -c -p -u -r1.128.2.38 decl.c
--- java/decl.c	19 Feb 2004 09:05:47 -0000	1.128.2.38
+++ java/decl.c	8 Apr 2004 19:29:05 -0000
@@ -1848,14 +1848,6 @@ java_expand_body (tree fndecl)
   tree_rest_of_compilation (fndecl, 0);
 }
 
-/* Expand a Java statement.  */
-
-void
-java_expand_stmt (tree t)
-{
-  expand_expr_stmt_value (t, 0, 0);
-}
-
 /* We pessimistically marked all methods and fields external until we
    knew what set of classes we were planning to compile.  Now mark those
    associated with CLASS to be generated locally as not external.  */
Index: java/java-tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/java-tree.h,v
retrieving revision 1.153.2.33
diff -d -c -p -u -r1.153.2.33 java-tree.h
--- java/java-tree.h	26 Mar 2004 16:24:20 -0000	1.153.2.33
+++ java/java-tree.h	8 Apr 2004 19:29:05 -0000
@@ -1343,7 +1343,6 @@ extern tree *get_stmts (void);
 
 extern void finish_method (tree);
 extern void java_expand_body (tree);
-extern void java_expand_stmt (tree);
 
 extern int get_symbol_table_index (tree, tree *);
 
Index: java/lang.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/lang.c,v
retrieving revision 1.103.2.29
diff -d -c -p -u -r1.103.2.29 lang.c
--- java/lang.c	26 Mar 2004 16:24:21 -0000	1.103.2.29
+++ java/lang.c	8 Apr 2004 19:29:05 -0000
@@ -266,9 +266,6 @@ struct language_function GTY(())
 #undef LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION
 #define LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION java_expand_body
 
-#undef LANG_HOOKS_RTL_EXPAND_STMT
-#define LANG_HOOKS_RTL_EXPAND_STMT java_expand_stmt
-
 /* Each front end provides its own.  */
 const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
 
Index: objc/objc-lang.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/objc/objc-lang.c,v
retrieving revision 1.24.2.18
diff -d -c -p -u -r1.24.2.18 objc-lang.c
--- objc/objc-lang.c	1 Apr 2004 17:21:37 -0000	1.24.2.18
+++ objc/objc-lang.c	8 Apr 2004 19:29:05 -0000
@@ -93,9 +93,6 @@ enum c_language_kind c_language = clk_ob
 #undef LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P
 #define LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P c_missing_noreturn_ok_p
 
-#undef LANG_HOOKS_RTL_EXPAND_STMT
-#define LANG_HOOKS_RTL_EXPAND_STMT expand_stmt_toplev
-
 /* Attribute hooks.  */
 #undef LANG_HOOKS_COMMON_ATTRIBUTE_TABLE
 #define LANG_HOOKS_COMMON_ATTRIBUTE_TABLE c_common_attribute_table



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