This is an archive of the discontinued LLVM Phabricator instance.

Fix double destruction of objects when OpenMP construct is canceled
ClosedPublic

Authored by mikerice on Jul 25 2017, 1:53 PM.

Details

Summary

When an omp for loop is canceled the constructed objects are being destructed twice.

It looks like the desired code is:

{

Obj o;
If (cancelled) branch-through-cleanups to cancel.exit.

}
[cleanups]
cancel.exit:

__kmpc_for_static_fini
br cancel.cont (*)

cancel.cont:

__kmpc_barrier
return

The problem seems to be the branch to cancel.cont is currently also going through the cleanups calling them again. This change just does a direct branch instead.

Diff Detail

Repository
rL LLVM

Event Timeline

mikerice created this revision.Jul 25 2017, 1:53 PM
This revision is now accepted and ready to land.Jul 26 2017, 1:34 PM
This revision was automatically updated to reflect the committed changes.