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]

Patch: Omit frame pointers on x86


Previously, stack traces on i386 required a frame pointer to be available as a fallback mechansim when tracing the stack. The new stack trace infrastructure uses DWARF2 unwind info exclusively, so frame pointers are never required on systems that support DWARF2 unwind. Omitting frame pointers frees up a register for general purpose use, which should improve peformance and reduce code size slightly.

-fno-omit-frame-pointer is actually still the default on 32-bit x86, so this patch will now explicitly specify -fomit-frame-pointer for that platform, except on Windows. On 64-bit x86, no frame pointer is the default, so we don't need to specify anything.

I'm checking this in to HEAD.

Bryce

2005-06-01  Bryce McKinlay  <mckinlay@redhat.com>

	* configure.ac (BACKTRACESPEC): Remove definition, but continue to
	AC_SUBST definition from configure.host.
	* configure.host: Don't use -fno-omit-frame-pointer. Set BACKTRACESPEC
	to -fomit-frame-pointer on 32-bit x86 linux.

Index: configure.ac
===================================================================
RCS file: /cvs/gcc/gcc/libjava/configure.ac,v
retrieving revision 1.31
diff -u -r1.31 configure.ac
--- configure.ac	25 May 2005 23:24:05 -0000	1.31
+++ configure.ac	1 Jun 2005 22:39:59 -0000
@@ -1148,6 +1148,7 @@
 AC_SUBST(DIVIDESPEC)
 AC_SUBST(CHECKREFSPEC)
 AC_SUBST(EXCEPTIONSPEC)
+AC_SUBST(BACKTRACESPEC)
 AC_SUBST(IEEESPEC)
 
 AM_CONDITIONAL(NATIVE, test "$NATIVE" = yes)
@@ -1345,15 +1346,6 @@
    SIGNAL_HANDLER_AUX=
 fi
 
-# Define here any compiler flags that you need in order to make backtrace() work.
-BACKTRACESPEC=
-case "${host}" in
- x86_64*-*-linux*|i?86-*)
-    BACKTRACESPEC=-fno-omit-frame-pointer
-    ;;
-esac
-AC_SUBST(BACKTRACESPEC)
-
 AC_SUBST(SYSDEP_SOURCES)
 
 if test -z "$SIGNAL_HANDLER_AUX"; then
Index: configure.host
===================================================================
RCS file: /cvs/gcc/gcc/libjava/configure.host,v
retrieving revision 1.68
diff -u -r1.68 configure.host
--- configure.host	25 May 2005 23:24:05 -0000	1.68
+++ configure.host	1 Jun 2005 22:39:59 -0000
@@ -69,6 +69,7 @@
 DIVIDESPEC=-fuse-divide-subroutine
 EXCEPTIONSPEC=-fnon-call-exceptions
 CHECKREFSPEC=
+BACKTRACESPEC=
 
 # This case statement supports per-CPU defaults.
 case "${host}" in
@@ -94,17 +95,18 @@
 	;;
   i686-*|i586-*|i486-*|i386-*)
 	sysdeps_dir=i386
-	libgcj_flags="${libgcj_flags} -ffloat-store -fno-omit-frame-pointer"
+	libgcj_flags="${libgcj_flags} -ffloat-store"
 	libgcj_interpreter=yes
 	libgcj_cxxflags=
 	libgcj_cflags=
 	DIVIDESPEC=-fno-use-divide-subroutine
+	BACKTRACESPEC=-fomit-frame-pointer
 	enable_hash_synchronization_default=yes
 	slow_pthread_self=yes
 	;;
   x86_64-*)
 	sysdeps_dir=x86-64
-	libgcj_flags="${libgcj_flags} -ffloat-store -fno-omit-frame-pointer"
+	libgcj_flags="${libgcj_flags} -ffloat-store"
 	libgcj_cxxflags=
 	libgcj_cflags=
 	DIVIDESPEC=-f%{m32:no-}use-divide-subroutine
@@ -266,6 +268,8 @@
 case "${host}" in
   *-cygwin* | *-mingw*)
 	fallback_backtrace_h=sysdep/i386/backtrace.h  
+	# We need a frame pointer on Windows, so override BACKTRACESPEC
+  	BACKTRACESPEC=
   ;;
 esac
 

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