8218721: C1's CEE optimization produces safepoint poll with invalid debug information

Bail out of CEE if one of the gotos is a safepoint but the if is not.

Reviewed-by: vlivanov, mdoerr
This commit is contained in:
Tobias Hartmann 2019-02-19 08:58:55 +01:00
parent 493a77061f
commit 799c9a66fd
3 changed files with 224 additions and 1 deletions

View file

@ -174,6 +174,12 @@ void CE_Eliminator::block_do(BlockBegin* block) {
for_each_phi_fun(t_block, phi, return; );
for_each_phi_fun(f_block, phi, return; );
// Only replace safepoint gotos if state_before information is available (if is a safepoint)
bool is_safepoint = if_->is_safepoint();
if (!is_safepoint && (t_goto->is_safepoint() || f_goto->is_safepoint())) {
return;
}
// 2) substitute conditional expression
// with an IfOp followed by a Goto
// cut if_ away and get node before
@ -202,7 +208,7 @@ void CE_Eliminator::block_do(BlockBegin* block) {
// append Goto to successor
ValueStack* state_before = if_->state_before();
Goto* goto_ = new Goto(sux, state_before, if_->is_safepoint() || t_goto->is_safepoint() || f_goto->is_safepoint());
Goto* goto_ = new Goto(sux, state_before, is_safepoint);
// prepare state for Goto
ValueStack* goto_state = if_state;