1 /*
2  * Copyright (c) 2018, Red Hat, Inc. All rights reserved.
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * This code is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License version 2 only, as
7  * published by the Free Software Foundation.
8  *
9  * This code is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12  * version 2 for more details (a copy is included in the LICENSE file that
13  * accompanied this code).
14  *
15  * You should have received a copy of the GNU General Public License version
16  * 2 along with this work; if not, write to the Free Software Foundation,
17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18  *
19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20  * or visit www.oracle.com if you need additional information or have any
21  * questions.
22  */
23 
24 /**
25  * @test
26  * @bug 8210390
27  * @summary C2 still crashes with "assert(mode == ControlAroundStripMined && use == sfpt) failed: missed a node"
28  *
29  * @run main/othervm -Xcomp StripMinedLoopReorgOffsets
30  *
31  */
32 
33 public class StripMinedLoopReorgOffsets {
34 
35     public static final int N = 400;
36 
37     public static long instanceCount=-4622920139809038929L;
38 
mainTest(String[] strArr1)39     public void mainTest(String[] strArr1) {
40 
41         int i1=-211, i20=54720, i21=205, i22=2184, i23=58, i24=-50110, iArr3[]=new int[N];
42 
43         for (i20 = 16; 331 > i20; ++i20) {
44             i1 = i20;
45             i21 += i1;
46             iArr3[i20] <<= (int)StripMinedLoopReorgOffsets.instanceCount;
47             for (i22 = 4; i22 < 80; i22++) {
48                 i21 = i23;
49                 i24 = 1;
50                 while (++i24 < 2) {
51                     try {
52                         iArr3[i22] = (i23 / i1);
53                     } catch (ArithmeticException a_e) {}
54                 }
55             }
56         }
57 
58         System.out.println("i1 i20 = " + i1 + "," + i20);
59         System.out.println("i21 i22 i23 = " + i21 + "," + i22 + "," + i23);
60         System.out.println("i24 = " + i24);
61     }
main(String[] strArr)62     public static void main(String[] strArr) {
63         StripMinedLoopReorgOffsets _instance = new StripMinedLoopReorgOffsets();
64         for (int i = 0; i < 10; i++ ) {
65             _instance.mainTest(strArr);
66         }
67     }
68 }
69