JDK-4899545 : Server compiler emits redundant membar-volatile instructions
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 5.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2003-07-31
  • Updated: 2004-06-01
  • Resolved: 2004-06-01
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
The server compiler fails to eliminate redundant membar-volatile instructions

In the attached program thrd05201, the run() method generates the following OptoAssembly:

1b4   B17: #	B26 B18 <- B16 B19 	Loop: B17-B19 inner stride: 0 post of N282 Freq: 53.358
1b4 + 	MEMBAR-release
1b4 + 	OR     R_L7,R_L5,R_L2
1b8 + 	SRA    R_L2,0,R_G3	! int->long
1bc + 	SLLX   R_G3,#32,R_G4
1c0 + 	OR     R_G4,R_G3,R_G3	! long
1c4   	STX    R_G3,[R_L4 + #80]	! long Volatile!
1c8 + 	MEMBAR-volatile
1cc + 	MEMBAR-volatile
1d0 + 	LDUW   [R_L4 + #72],R_L0	! ptr
1d4   	LDX    [R_L0 + #80],R_G3	! long Volatile!
1d8   	NullCheck R_L0
1d8


See also b4336548.run:

054   B5: #     B3 <- B2        Loop: B2-B3 inner  Freq: 1.89393e-05
054 +   MEMBAR-release
054 +   STB    #0,[R_G4 + #276] ! byte Volatile!
058 +   MEMBAR-volatile
05c +   MEMBAR-volatile
060 +   BA     B3
060     MOV    #0,R_G1
060 


The extra membars may have a performance impact.

Comments
EVALUATION This was fixed by Steve Dever as part of the JSR-166 work. ###@###.### 2004-06-01
01-06-2004