RFR (M): 8004640: C2 assert failure in memnode.cpp: NULL+offs not RAW address?

Vladimir Kozlov vladimir.kozlov at oracle.com
Mon Mar 25 17:25:01 PDT 2013


IdealKit does not call transform() for raw address when generates post 
barrier code and C2 type system does not accept such type. 
AddPNode::Ideal() should be called to transform raw (NULL+offs) to 
CastX2P(offs). We got NULL as base because cardmark byte_map_base is 0x0 
which is valid value.

IdealKit delays transformations to avoid graph collapsing before it is 
finished. But delaying logic is broken because during Parse phase 
PhaseGVN::transform() does not replace old node with new transformed one.

Fix: always transform AddP nodes in IdealKit by calling _gvn.transform().

Clean delaying logic only to register new nodes for igvn and don't do 
useless delayed transformations. Also remove is_IterGVN() checks since 
IdealKit works only during Parse phase.

An other possible cause of the failure is to get dead nodes on IGVN 
_worklist. I looked on recent changes and did some modifications. In 
PhaseIdealLoop::build_and_optimize() moved dead nodes cleanup back after 
build_loop_late(). Used replace_edge(in, NULL) in 
remove_globally_dead_node() to cut all edges pointed to dead node and 
did other rearrangements in that method.

Tested with compiler jtreg, ctw, jprt. Did additional testing with 
GraphKit::byte_map_base_node() always returning null() with 


More information about the hotspot-compiler-dev mailing list