--- a/src/hotspot/share/opto/compile.cpp Wed Aug 22 15:10:40 2018 +0800
+++ b/src/hotspot/share/opto/compile.cpp Tue Aug 14 16:54:47 2018 +0200
@@ -2767,6 +2767,17 @@
LoadNode::is_immutable_value(n->in(MemNode::Address))),
"raw memory operations should have control edge");
}
+ if (n->is_MemBar()) {
+ MemBarNode* mb = n->as_MemBar();
+ if (mb->trailing_store() || mb->trailing_load_store()) {
+ assert(mb->leading_membar()->trailing_membar() == mb, "bad membar pair");
+ Node* mem = mb->in(MemBarNode::Precedent);
+ assert((mb->trailing_store() && mem->is_Store() && mem->as_Store()->is_release()) ||
+ (mb->trailing_load_store() && mem->is_LoadStore()), "missing mem op");
+ } else if (mb->leading()) {
+ assert(mb->trailing_membar()->leading_membar() == mb, "bad membar pair");
+ }
+ }
#endif
// Count FPU ops and common calls, implements item (3)
switch( nop ) {