This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: Turn off inlining for Java synchronized methods
- From: Andrew Haley <aph at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 10 Apr 2003 14:26:09 +0100 (BST)
- Subject: PATCH: Turn off inlining for Java synchronized methods
I'm checking this in to the branch and the trunk.
Andrew.
2003-04-10 Andrew Haley <aph at redhat dot com>
* tree-inline.c (inlinable_function_p): Disable inlining for
synchronized methods.
Index: tree-inline.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-inline.c,v
retrieving revision 1.38.2.5
diff -c -2 -p -r1.38.2.5 tree-inline.c
*** tree-inline.c 14 Mar 2003 14:53:52 -0000 1.38.2.5
--- tree-inline.c 10 Apr 2003 13:24:37 -0000
*************** inlinable_function_p (fn, id)
*** 945,948 ****
--- 945,954 ----
inlinable = 0;
+ #ifdef INLINER_FOR_JAVA
+ /* Synchronized methods can't be inlined. This is a bug. */
+ if (METHOD_SYNCHRONIZED (fn))
+ return 0;
+ #endif /* INLINER_FOR_JAVA */
+
/* We may be here either because fn is declared inline or because
we use -finline-functions. For the second case, we are more