JDK-7142167 : MAC: _get_previous_fp broken on bsd with llvm-gcc
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: hs23
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2012-02-02
  • Updated: 2012-10-08
  • Resolved: 2012-02-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 JDK 8 Other
7u4Fixed 8Fixed hs23Fixed
Description
While working on a bug on my Mac I noticed that _get_previous_fp is broken with LLVM-GCC.  The GCC version I am currently using is:

gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)

Comments
EVALUATION http://hg.openjdk.java.net/lambda/lambda/hotspot/rev/5e9fba4e8718
22-03-2012

EVALUATION http://hg.openjdk.java.net/hsx/hotspot-gc/hotspot/rev/5e9fba4e8718
18-02-2012

EVALUATION http://hg.openjdk.java.net/hsx/hotspot-comp/hotspot/rev/5e9fba4e8718
07-02-2012

SUGGESTED FIX diff --git a/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp b/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp --- a/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp +++ b/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp @@ -362,7 +362,7 @@ frame os::get_sender_for_C_frame(frame* } intptr_t* _get_previous_fp() { -#if defined(SPARC_WORKS) || defined(__clang__) +#if defined(SPARC_WORKS) || defined(__clang__) || defined(__llvm__) register intptr_t **ebp; __asm__("mov %%"SPELL_REG_FP", %0":"=r"(ebp)); #else
02-02-2012

EVALUATION The fix is to use the __clang__ implementation (as is the case for os::current_stack_pointer).
02-02-2012