Path: blob/master/test/hotspot/jtreg/compiler/regalloc/VolatileLoadMemBarsOnlyUses.java
41149 views
/*1* Copyright (c) 2018, Red Hat, Inc. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223/**24* @test25* @bug 821038926* @summary C2: assert(n->outcnt() != 0 || C->top() == n || n->is_Proj()) failed: No dead instructions after post-alloc27*28* @run main/othervm -Xcomp -XX:CompileOnly=VolatileLoadMemBarsOnlyUses VolatileLoadMemBarsOnlyUses29*30*/3132public class VolatileLoadMemBarsOnlyUses {3334public static final int N = 400;35public static long instanceCount=-94L;36public static volatile byte byFld=-108;3738public int mainTest(String[] strArr1) {3940int i17=9, i19=1, i20=63, i21=-32916, i22=0, iArr[]=new int[N];41boolean b1=false;42double d3=76.18241;4344for (int i : iArr) {45for (i17 = 2; i17 < 63; i17++) {46if (b1) break;47byFld += (byte)(0.131F + (i17 * i17));48}49for (i19 = 1; 63 > i19; ++i19) {50for (i21 = 1; i21 < 2; i21++) {51d3 = i22;52if (b1) continue;53i20 = i21;54}55d3 -= byFld;56instanceCount = 46725L;57}58switch ((((i22 >>> 1) % 4) * 5) + 91) {59case 98:60break;61case 110:62break;63case 105:64break;65case 103:66break;67default:68}69}7071return i20;72}73public static void main(String[] strArr) {74VolatileLoadMemBarsOnlyUses _instance = new VolatileLoadMemBarsOnlyUses();75for (int i = 0; i < 10; i++ ) {76_instance.mainTest(strArr);77}78}79}808182