This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java 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]

Disable RTL inliner for Java


As discussed recently on the java list(1), this patch disables the RTL inliner for the Java front end.

This version of the patch allows the user to specify -finline-functions in case they really want to use inlining.

I'm checking this in to both branch and mainline.

(1): http://gcc.gnu.org/ml/java/2002-05/msg00258.html

Bryce.



2002-06-10  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>

	* lang.c (LANG_HOOKS_POST_OPTIONS): Define.
	(java_post_options): New function. Turn off inlining unless
	-finline-functions is specified.

Index: lang.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/lang.c,v
retrieving revision 1.102
diff -u -r1.102 lang.c
--- lang.c	4 Jun 2002 07:10:54 -0000	1.102
+++ lang.c	10 Jun 2002 04:17:49 -0000
@@ -51,6 +51,8 @@
 static const char *java_init PARAMS ((const char *));
 static void java_finish PARAMS ((void));
 static void java_init_options PARAMS ((void));
+static void java_post_options PARAMS ((void));
+
 static int java_decode_option PARAMS ((int, char **));
 static void put_decl_string PARAMS ((const char *, int));
 static void put_decl_node PARAMS ((tree));
@@ -228,6 +230,8 @@
 #define LANG_HOOKS_INIT_OPTIONS java_init_options
 #undef LANG_HOOKS_DECODE_OPTION
 #define LANG_HOOKS_DECODE_OPTION java_decode_option
+#undef LANG_HOOKS_POST_OPTIONS
+#define LANG_HOOKS_POST_OPTIONS java_post_options
 #undef LANG_HOOKS_PARSE_FILE
 #define LANG_HOOKS_PARSE_FILE java_parse_file
 #undef LANG_HOOKS_MARK_ADDRESSABLE
@@ -761,6 +765,20 @@
 
   /* In Java floating point operations never trap.  */
   flag_trapping_math = 0;
+
+  flag_inline_functions = 2;
+}
+
+/* Post-switch processing.  */
+static void
+java_post_options ()
+{
+  /* Turn off RTL inliner unless -finline-functions was really specified.  */
+  if (flag_inline_functions != 1)
+    {
+      flag_no_inline = 1;
+      flag_inline_functions = 0;
+    }
 }
 
 #include "gt-java-lang.h"

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