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 sibcalls for all targets


It seems that tail call optimization can break Java.  Such
optimizations didn't used to matter, since all that happened was that
we'd get an inaccurate backtrace.  Nowadays, we use that backtrace to
find the class loader of a caller, and sibcalls breaks that.

Another fix might allow sibcalls when calling a method that we know
will be loaded by the same class loader.  However, accurate debugging
backtraces are very useful, and Java users expect them.  Comments
welcome...

Andrew.


2003-02-03  Andrew Haley  <aph@redhat.com>

	* configure.in (BACKTRACESPEC): Disable sibcalls for all targets.
	* configure.host (libgcj_flags): Likewise.
	* configure: Rebuild.

Index: configure.host
===================================================================
RCS file: /cvs/gcc/gcc/libjava/configure.host,v
retrieving revision 1.47
diff -u -r1.47 configure.host
--- configure.host      3 Feb 2003 17:10:16 -0000       1.47
+++ configure.host      19 May 2003 15:11:25 -0000
@@ -29,7 +29,7 @@
 #   can_unwind_signal   Set to "yes" if the EH unwinder supports throwing
 #               from a signal handler.
 
-libgcj_flags=
+libgcj_flags=-fno-optimize-sibling-calls
 libgcj_cflags=
 libgcj_cxxflags=
 libgcj_javaflags=
Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/libjava/configure.in,v
retrieving revision 1.149
diff -u -r1.149 configure.in
--- configure.in 3 Feb 2003 15:59:48 -0000      1.149
+++ configure.in 19 May 2003 15:11:25 -0000
@@ -1020,10 +1020,10 @@
 fi
 
 # Define here any compiler flags that you need in order to make backtrace() wor
k.
-BACKTRACESPEC=
+BACKTRACESPEC=-fno-optimize-sibling-calls
 case "${host}" in
  x86_64*-*-linux*)
-    BACKTRACESPEC=-fno-omit-frame-pointer
+    BACKTRACESPEC="${BACKTRACESPEC} -fno-omit-frame-pointer"
     ;;
 esac
 AC_SUBST(BACKTRACESPEC)


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