提交 6c94d52d 编写于 作者: R roland

8210389: C2: assert(n->outcnt() != 0 || C->top() == n || n->is_Proj()) failed:...

8210389: C2: assert(n->outcnt() != 0 || C->top() == n || n->is_Proj()) failed: No dead instructions after post-alloc
Reviewed-by: kvn, thartmann
上级 89ff5641
......@@ -3361,6 +3361,32 @@ void Compile::final_graph_reshaping_impl( Node *n, Final_Reshape_Counts &frc) {
n->set_req(MemBarNode::Precedent, top());
}
break;
case Op_MemBarAcquire: {
if (n->as_MemBar()->trailing_load() && n->req() > MemBarNode::Precedent) {
// At parse time, the trailing MemBarAcquire for a volatile load
// is created with an edge to the load. After optimizations,
// that input may be a chain of Phis. If those phis have no
// other use, then the MemBarAcquire keeps them alive and
// register allocation can be confused.
ResourceMark rm;
Unique_Node_List wq;
wq.push(n->in(MemBarNode::Precedent));
n->set_req(MemBarNode::Precedent, top());
while (wq.size() > 0) {
Node* m = wq.pop();
if (m->outcnt() == 0) {
for (uint j = 0; j < m->req(); j++) {
Node* in = m->in(j);
if (in != NULL) {
wq.push(in);
}
}
m->disconnect_inputs(NULL, this);
}
}
}
break;
}
case Op_RangeCheck: {
RangeCheckNode* rc = n->as_RangeCheck();
Node* iff = new IfNode(rc->in(0), rc->in(1), rc->_prob, rc->_fcnt);
......
/*
* Copyright (c) 2018, Red Hat, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* @test
* @bug 8210389
* @summary C2: assert(n->outcnt() != 0 || C->top() == n || n->is_Proj()) failed: No dead instructions after post-alloc
*
* @run main/othervm -Xcomp -XX:CompileOnly=VolatileLoadMemBarsOnlyUses VolatileLoadMemBarsOnlyUses
*
*/
public class VolatileLoadMemBarsOnlyUses {
public static final int N = 400;
public static long instanceCount=-94L;
public static volatile byte byFld=-108;
public int mainTest(String[] strArr1) {
int i17=9, i19=1, i20=63, i21=-32916, i22=0, iArr[]=new int[N];
boolean b1=false;
double d3=76.18241;
for (int i : iArr) {
for (i17 = 2; i17 < 63; i17++) {
if (b1) break;
byFld += (byte)(0.131F + (i17 * i17));
}
for (i19 = 1; 63 > i19; ++i19) {
for (i21 = 1; i21 < 2; i21++) {
d3 = i22;
if (b1) continue;
i20 = i21;
}
d3 -= byFld;
instanceCount = 46725L;
}
switch ((((i22 >>> 1) % 4) * 5) + 91) {
case 98:
break;
case 110:
break;
case 105:
break;
case 103:
break;
default:
}
}
return i20;
}
public static void main(String[] strArr) {
VolatileLoadMemBarsOnlyUses _instance = new VolatileLoadMemBarsOnlyUses();
for (int i = 0; i < 10; i++ ) {
_instance.mainTest(strArr);
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册