[RFC] Patch to fix register allocation (PR680)

Deepak Bhole dbhole at redhat.com
Thu Mar 31 11:37:37 PDT 2011


* Dr Andrew John Hughes <ahughes at redhat.com> [2011-03-31 14:28]:
> On 14:00 Thu 31 Mar     , Deepak Bhole wrote:
> > * Dr Andrew John Hughes <ahughes at redhat.com> [2011-03-28 14:14]:
> > > On 23:06 Fri 25 Mar     , Deepak Bhole wrote:
> > > > 
> > > > Posted:
> > > > 
> > > > http://mail.openjdk.java.net/pipermail/hotspot-dev/2011-March/003991.html
> > > > 
> > > > I also addressed a second xchgb call that was using =r (though it
> > > > doesn't cause failure, we might as well address it now).
> > > > 
> > > 
> > > Well there weren't any objections:
> > > 
> > > http://mail.openjdk.java.net/pipermail/hotspot-dev/2011-March/003992.html
> > > 
> > > Does the patch apply cleanly to both hs19 and hs20?
> > > 
> > 
> > Attached patches apply fine to hs19 and hs20.
> > 
> > I put the icedtea6 one in patches/openjdk .. for icedtea, there is no
> > such dir so I just put them in patches/. Please let me know if there is
> > a more appropriate place you prefer.
> > 
> 
> Did you read the last e-mail? I thought you were going to post a revised
> patch for 6 and I asked that one wasn't committed to 7.
>


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.

Deepak
 
> > Cheers,
> > Deepak
> > 
> > > Now we have a bug ID, please use that in the patch name and place it in
> > > patches/openjdk.  It's just a matter of time until they get it in upstream
> > > AFAICS.
> > > 
> > > Please post a fresh patch with the extended fix posted upstream, having
> > > made sure it works with both hs19 and hs20.
> > > 
> > > If you also want this in 1.10, you'll need to post a patch for that branch
> > > too.  Note that the defaults are inverted there (hs19 is default, hs20
> > > is optional) but they are the same versions.
> > > 
> > > I'll handle IcedTea7 when the patch is pushed to the 7 trees.
> > > 
> > > Thanks,
> > > -- 
> > > Andrew :)
> > > 
> > > Free Java Software Engineer
> > > Red Hat, Inc. (http://www.redhat.com)
> > > 
> > > Support Free Java!
> > > Contribute to GNU Classpath and IcedTea
> > > http://www.gnu.org/software/classpath
> > > http://icedtea.classpath.org
> > > PGP Key: F5862A37 (https://keys.indymedia.org/)
> > > Fingerprint = EA30 D855 D50F 90CD F54D  0698 0713 C3ED F586 2A37
> 
> > diff -r 64437a39a9c8 Makefile.am
> > --- a/Makefile.am	Thu Mar 31 15:34:49 2011 +0100
> > +++ b/Makefile.am	Thu Mar 31 13:55:13 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 13:55:13 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 13:55:13 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");
> > + }
> 
> > diff -r 7f137bd40e46 Makefile.am
> > --- a/Makefile.am	Wed Mar 30 01:27:14 2011 +0100
> > +++ b/Makefile.am	Thu Mar 31 13:57:22 2011 -0400
> > @@ -281,7 +281,8 @@
> >  	patches/parisc.patch \
> >  	patches/sh4-support.patch \
> >  	patches/jtreg-httpTest.patch \
> > -	patches/icedtea-update-bootclasspath.patch
> > +	patches/icedtea-update-bootclasspath.patch \
> > +	patches/7031385-gcc-register-allocation-fix.patch
> >  
> >  # Conditional patches
> >  
> > diff -r 7f137bd40e46 NEWS
> > --- a/NEWS	Wed Mar 30 01:27:14 2011 +0100
> > +++ b/NEWS	Thu Mar 31 13:57:22 2011 -0400
> > @@ -8,6 +8,8 @@
> >    - Match Shark in icedtea6, makes OSR work by removing vestigal check.
> >    - LLVM 2.7 non-product fixes.
> >    - Correct suffix for the llvm.atomic.cmp.swap intrinsic.
> > +* Bug fixes
> > +  - S7031385, PR680: Incorrect register allocation in orderAccess_linux_x86.inline.hpp
> >  
> >  New in release 1.13 (2010-07-29)
> >  
> > diff -r 7f137bd40e46 patches/7031385-gcc-register-allocation-fix.patch
> > --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
> > +++ b/patches/7031385-gcc-register-allocation-fix.patch	Thu Mar 31 13:57:22 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-02-28 11:03:15.000000000 -0500
> > ++++ openjdk/hotspot/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp	2011-03-31 10:40:38.328400681 -0400
> > +@@ -92,7 +92,7 @@
> > + 
> > + inline void     OrderAccess::store_fence(jbyte*  p, jbyte  v) {
> > +   __asm__ volatile (  "xchgb (%2),%0"
> > +-                    : "=r" (v)
> > ++                    : "=q" (v)
> > +                     : "0" (v), "r" (p)
> > +                     : "memory");
> > + }
> > +@@ -154,7 +154,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");
> > + }
> 
> 
> -- 
> Andrew :)
> 
> Free Java Software Engineer
> Red Hat, Inc. (http://www.redhat.com)
> 
> Support Free Java!
> Contribute to GNU Classpath and IcedTea
> http://www.gnu.org/software/classpath
> http://icedtea.classpath.org
> PGP Key: F5862A37 (https://keys.indymedia.org/)
> Fingerprint = EA30 D855 D50F 90CD F54D  0698 0713 C3ED F586 2A37



More information about the distro-pkg-dev mailing list