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]

S/390: Fix backtrace support for Java


Hello,

this fixes the last remaining problem with backtraces for Java
by making sure that the prolog stores the stack frame backchain
pointer before any possibly trapping memory access if we need 
to support asynchronous exceptions.

This makes it possible to set the HAVE_BACKTRACE symbol 
for libjava.  This fixes the SyncTest test case timeouts.

Bootstrapped/regtested on s390-ibm-linux and s390x-ibm-linux
on both 3.3 and CVS head; committed to both.


gcc/ ChangeLog:

	* config/s390/s390.c (s390_emit_prologoue): Make sure backchain is
	set up before any trapping memory access if flag_non_call_exceptions.

libjava/ ChangeLog:

	* configure.in (HAVE_BACKTRACE) [s390*-*-linux*]: Define.
	* configure: Regenerate.


Index: gcc/config/s390/s390.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/s390/s390.c,v
retrieving revision 1.70.2.2
diff -c -p -r1.70.2.2 s390.c
*** gcc/config/s390/s390.c	24 Jan 2003 17:12:05 -0000	1.70.2.2
--- gcc/config/s390/s390.c	15 Feb 2003 21:57:01 -0000
*************** s390_emit_prologue ()
*** 5215,5220 ****
--- 5215,5230 ----
  	  set_mem_alias_set (addr, s390_sr_alias_set);
  	  insn = emit_insn (gen_move_insn (addr, temp_reg));
  	}
+ 
+       /* If we support asynchronous exceptions (e.g. for Java),
+ 	 we need to make sure the backchain pointer is set up
+ 	 before any possibly trapping memory access.  */
+ 
+       if (TARGET_BACKCHAIN && flag_non_call_exceptions)
+ 	{
+ 	  addr = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (VOIDmode));
+ 	  emit_insn (gen_rtx_CLOBBER (VOIDmode, addr));
+ 	}
      }
  
    /* Save fprs 8 - 15 (64 bit ABI).  */
Index: libjava/configure.in
===================================================================
RCS file: /cvs/gcc/gcc/libjava/configure.in,v
retrieving revision 1.142.4.5
diff -c -p -r1.142.4.5 configure.in
*** libjava/configure.in	13 Feb 2003 02:09:26 -0000	1.142.4.5
--- libjava/configure.in	15 Feb 2003 21:57:10 -0000
*************** else
*** 515,523 ****
         ia64-*-linux*)
  	 # Has broken backtrace()
  	 ;;
-        s390*-*-linux*)
- 	 # Has broken backtrace()
- 	 ;;
         *)
           AC_DEFINE(HAVE_BACKTRACE)
  	 ;;
--- 515,520 ----

-- 
  Dr. Ulrich Weigand
  weigand at informatik dot uni-erlangen dot de


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