Java -O3 patch

Andrew Haley aph@pasanda.cygnus.co.uk
Thu Jul 1 06:05:00 GMT 1999


I have committed this patch.

Andrew.

------- Start of forwarded message -------
>From aph  Thu Jun 24 18:25:18 1999
Return-Path: <aph@cygnus.co.uk>
Date: 24 Jun 1999 17:25:16 -0000
From: Andrew Haley <aph@cygnus.co.uk>
To: egcs-patches@egcs.cygnus.com
Subject: Java -O3 patch

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);
      }
  
------- End of forwarded message -------


More information about the Gcc-patches mailing list