JDK-8141137 : C2 fails rematerializing nodes using flag registers.
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2015-11-02
  • Updated: 2017-12-05
  • Resolved: 2015-11-18
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 9
9 b96Fixed
Related Reports
Relates :  
Description
We see assert(false, "attempted to spill a non-spillable item") running jck tests with the ppc64 port.
This assertion in get_spillcopy_wide() is reached from split_Rematerialize() that inserts a SpillCopy
of kind InputToRematerialization in the prolonged live range. In the opt build this results
in a not compilable method. 

In our case, 'def' is a node consuming a condition register defined by 'in'.  Get_spillcopy_wide() 
realizes condition registers (Op_RegFlags) can not be spilled and aborts.

As register allocation can not spill condition registers, it would have rematerialized 'in' later on, too.
So actually, the SpillCopy in the prolonged live range is not needed. 

As a fix, we skip adding it in case split_Rematerialze handles an operation consuming a condition register.
Also, this change modifies rematerialize() to avoid that this pattern causes several live ranges to be streched.