8046698: assert(false) failed: only Initialize or AddP expected macro.cpp:943
roland.westrelin at oracle.com
Fri Jun 13 15:31:45 UTC 2014
Because of a try/catch in a loop, a Allocate node is in the loop body while the uses of the results are outside the loop (see test case in webrev). Then loop unswitching clones the loop body (including the Allocate but not the Initialization node and other uses of the result projection) and adds a Phi to connect the Allocate nodes to the loop exit. CallNode::result_cast() doesn’t expect a Phi as output so returns NULL which to the allocation elimination code means no use for the allocation (allocation can be eliminated). The fix changes CallNode::result_cast() so it returns the CallNode when the result projection has a Phi as output which causes the allocation elimination code to skip that allocation. Every call to result_cast() is already followed by a check for is_CheckCastPP() so no other change is needed.
More information about the hotspot-compiler-dev