[RFC] Patch to fix register allocation (PR680)

Deepak Bhole dbhole at redhat.com
Thu Mar 31 12:12:39 PDT 2011


* Deepak Bhole <dbhole at redhat.com> [2011-03-31 14:38]:
> 
> This is the revised patch for 6 with the extended fix and one that
> applies cleanly to hs19 an hs20. 
> 
> The 7 one I posted because the work was already done, just had to 
> update the .patch file. Feel free to ignore it.
> 
> As for 1.10, wanted to make sure things were good on HEAD before I did
> that.
> 

Hi,

Patch for HEAD and 1.10 is attached. OK for commit?

ChangeLog:
2011-03-31  Deepak Bhole <dbhole at redhat.com>

    S7031385, PR680: Incorrect register allocation in
    orderAccess_linux_x86.inline.hpp
    * Makefile.am: Apply new icedtea-pr680-gcc-register-allocation-fix.patch
    patch.
    * NEWS: Updated
    * patches/pr680-gcc-register-allocation-fix.patch: New patch.
    Fixes register allocation by constraining output to one of a/b/c/d
    registers.

Cheers,
Deepak
-------------- next part --------------
diff -r 11db21f38d4b Makefile.am
--- a/Makefile.am	Thu Mar 31 19:35:41 2011 +0100
+++ b/Makefile.am	Thu Mar 31 15:09:39 2011 -0400
@@ -327,7 +327,8 @@
 	patches/openjdk/7023591-AAShapePipe.patch \
 	patches/openjdk/7027667-AAShapePipeRegTest.patch \
 	patches/g356743-libpng-1.5.patch \
-	patches/mark_sun_toolkit_privileged_code.patch
+	patches/mark_sun_toolkit_privileged_code.patch \
+	patches/openjdk/7031385-gcc-register-allocation-fix.patch
 
 if WITH_ALT_HSBUILD
 ICEDTEA_PATCHES += \
diff -r 11db21f38d4b NEWS
--- a/NEWS	Thu Mar 31 19:35:41 2011 +0100
+++ b/NEWS	Thu Mar 31 15:09:39 2011 -0400
@@ -17,6 +17,7 @@
   - Add missing privileged block around access to the sun.awt.nativedebug property.
 * Fixes
   - G356743: Support libpng 1.5.
+  - S7031385, PR680: Incorrect register allocation in orderAccess_linux_x86.inline.hpp
 * CACAO
   - Ignore all unknown options, but report them.
   - Fixes build for newer gcc (at least 4.4) on PPC64, breaks older gcc.
diff -r 11db21f38d4b patches/openjdk/7031385-gcc-register-allocation-fix.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/openjdk/7031385-gcc-register-allocation-fix.patch	Thu Mar 31 15:09:39 2011 -0400
@@ -0,0 +1,21 @@
+diff -ur openjdk.orig/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp openjdk/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp
+--- openjdk.orig/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp	2011-03-31 13:05:19.924400634 -0400
++++ openjdk/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp	2011-03-31 13:06:00.617400605 -0400
+@@ -86,7 +86,7 @@
+ 
+ inline void     OrderAccess::store_fence(jbyte*  p, jbyte  v) {
+   __asm__ volatile (  "xchgb (%2),%0"
+-                    : "=r" (v)
++                    : "=q" (v)
+                     : "0" (v), "r" (p)
+                     : "memory");
+ }
+@@ -148,7 +148,7 @@
+ // Must duplicate definitions instead of calling store_fence because we don't want to cast away volatile.
+ inline void     OrderAccess::release_store_fence(volatile jbyte*  p, jbyte  v) {
+   __asm__ volatile (  "xchgb (%2),%0"
+-                    : "=r" (v)
++                    : "=q" (v)
+                     : "0" (v), "r" (p)
+                     : "memory");
+ }
-------------- next part --------------
diff -r 64437a39a9c8 Makefile.am
--- a/Makefile.am	Thu Mar 31 15:34:49 2011 +0100
+++ b/Makefile.am	Thu Mar 31 15:10:44 2011 -0400
@@ -334,7 +334,8 @@
 	patches/mark_sun_toolkit_privileged_code.patch \
 	patches/g356743-libpng-1.5.patch \
 	patches/revert-6885123.patch \
-	patches/hotspot/$(HSBUILD)/7032388-work_without_cmov_instruction.patch
+	patches/hotspot/$(HSBUILD)/7032388-work_without_cmov_instruction.patch \
+	patches/openjdk/7031385-gcc-register-allocation-fix.patch
 
 if WITH_ALT_HSBUILD
 ICEDTEA_PATCHES += \
diff -r 64437a39a9c8 NEWS
--- a/NEWS	Thu Mar 31 15:34:49 2011 +0100
+++ b/NEWS	Thu Mar 31 15:10:44 2011 -0400
@@ -21,6 +21,7 @@
 * Bug fixes
   - PR637: make check should exit with an error code if any regression test failed.
   - G356743: Support libpng 1.5.
+  - S7031385, PR680: Incorrect register allocation in orderAccess_linux_x86.inline.hpp
 * Allow selection of test suites using the jtreg_checks argument e.g. jtreg_checks="langtools"
 * CACAO
   - Ignore all unknown options, but report them.
diff -r 64437a39a9c8 patches/openjdk/7031385-gcc-register-allocation-fix.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/openjdk/7031385-gcc-register-allocation-fix.patch	Thu Mar 31 15:10:44 2011 -0400
@@ -0,0 +1,21 @@
+diff -ur openjdk.orig/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp openjdk/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp
+--- openjdk.orig/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp	2011-03-31 13:05:19.924400634 -0400
++++ openjdk/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp	2011-03-31 13:06:00.617400605 -0400
+@@ -93,7 +93,7 @@
+ 
+ inline void     OrderAccess::store_fence(jbyte*  p, jbyte  v) {
+   __asm__ volatile (  "xchgb (%2),%0"
+-                    : "=r" (v)
++                    : "=q" (v)
+                     : "0" (v), "r" (p)
+                     : "memory");
+ }
+@@ -155,7 +155,7 @@
+ // Must duplicate definitions instead of calling store_fence because we don't want to cast away volatile.
+ inline void     OrderAccess::release_store_fence(volatile jbyte*  p, jbyte  v) {
+   __asm__ volatile (  "xchgb (%2),%0"
+-                    : "=r" (v)
++                    : "=q" (v)
+                     : "0" (v), "r" (p)
+                     : "memory");
+ }


More information about the distro-pkg-dev mailing list