This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Java -O3 patch
- To: egcs-patches at egcs dot cygnus dot com
- Subject: Java -O3 patch
- From: Andrew Haley <aph at pasanda dot cygnus dot co dot uk>
- Date: 24 Jun 1999 17:25:16 -0000
This patch allows Java programs to be compiled with inlining turned
on. Without it, Java programs compiled with -O3 won't link.
Andrew.
1999-06-24 Andrew Haley <aph@cygnus.com>
* java/class.c (finish_class): Whenever a deferred method is
output, rescan the list of methods to see if a new candidate for
output can be found.
Index: class.c
===================================================================
RCS file: /cvs/egcs/egcs/gcc/java/class.c,v
retrieving revision 1.38.4.1
diff -p -2 -c -r1.38.4.1 class.c
*** class.c 1999/06/05 08:18:16 1.38.4.1
--- class.c 1999/06/24 17:21:25
*************** finish_class (cl)
*** 1201,1208 ****
{
tree method;
! /* Emit deferred inline methods. */
! for ( method = TYPE_METHODS (CLASS_TO_HANDLE_TYPE (current_class));
! method != NULL_TREE; method = TREE_CHAIN (method))
{
if (! TREE_ASM_WRITTEN (method) && DECL_SAVED_INSNS (method) != 0)
--- 1201,1208 ----
{
tree method;
+ tree type_methods = TYPE_METHODS (CLASS_TO_HANDLE_TYPE (current_class));
! /* Emit deferred inline methods. */
! for (method = type_methods; method != NULL_TREE; )
{
if (! TREE_ASM_WRITTEN (method) && DECL_SAVED_INSNS (method) != 0)
*************** finish_class (cl)
*** 1216,1221 ****
--- 1216,1226 ----
output_inline_function (method);
permanent_allocation (1);
+ /* Scan the list again to see if there are any earlier
+ methods to emit. */
+ method = type_methods;
+ continue;
}
}
+ method = TREE_CHAIN (method);
}