]> gcc.gnu.org Git - gcc.git/commitdiff
re GNATS gcj/85 (Compiler optimizes away private methods when native methods might...
authorTom Tromey <tromey@cygnus.com>
Fri, 5 Nov 1999 18:27:28 +0000 (18:27 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Fri, 5 Nov 1999 18:27:28 +0000 (18:27 +0000)
* class.c (finish_class): Emit inlined methods if any native
methods exist in the class.  Fixes PR gcj/85.

From-SVN: r30420

gcc/java/ChangeLog
gcc/java/class.c

index ecf140a86032274cea0a913b1e7158e6add3b867..b516afd94073a4ded8e0260fb323db7d05ea81cd 100644 (file)
@@ -1,3 +1,8 @@
+1999-11-05  Tom Tromey  <tromey@cygnus.com>
+
+       * class.c (finish_class): Emit inlined methods if any native
+       methods exist in the class.  Fixes PR gcj/85.
+
 Mon Nov  1 23:42:00 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
 
        * parse.y (method_header:): Issue error message for rule `type
index 03335285f411b5d4ac75c6741e40bbed19f40087..57930fde0bf7facd78e4eadf3145478c898bf446 100644 (file)
@@ -1205,7 +1205,21 @@ finish_class ()
 {
   tree method;
   tree type_methods = TYPE_METHODS (CLASS_TO_HANDLE_TYPE (current_class));
-  
+  int saw_native_method = 0;
+
+  /* Find out if we have any native methods.  We use this information
+     later.  */
+  for (method = type_methods;
+       method != NULL_TREE;
+       method = TREE_CHAIN (method))
+    {
+      if (METHOD_NATIVE (method))
+       {
+         saw_native_method = 1;
+         break;
+       }
+    }
+
   /* Emit deferred inline methods. */  
   for (method = type_methods; method != NULL_TREE; )
     {
@@ -1214,7 +1228,8 @@ finish_class ()
          /* It's a deferred inline method.  Decide if we need to emit it. */
          if (flag_keep_inline_functions
              || TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (method))
-             || ! METHOD_PRIVATE (method))
+             || ! METHOD_PRIVATE (method)
+             || saw_native_method)
            {
              temporary_allocation ();
              output_inline_function (method);
This page took 0.076615 seconds and 5 git commands to generate.