1 /*
2  * Copyright (c) 2019, 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 8229701
27  * @summary C2 OSR compilation fails with "shouldn't process one node several times" in final graph reshaping
28  *
29  * @run main/othervm ConvI2LWideningAssertTooStrong
30  *
31  */
32 
33 public class ConvI2LWideningAssertTooStrong {
34 
35     public static final int N = 400;
36 
37     public static long instanceCount=708L;
38     public static volatile int iFld1=30517;
39     public static int iArrFld[]=new int[N];
40 
vMeth(short s)41     public static void vMeth(short s) {
42         int i9=29117, i11=-6;
43 
44         for (i9 = 11; i9 < 377; i9++) {
45             switch ((i9 % 8) + 22) {
46             case 24:
47                 instanceCount = i9;
48                 instanceCount += instanceCount;
49                 break;
50             case 25:
51                 try {
52                     i11 = (20705 % i11);
53                     iArrFld[i9 - 1] = (55094 / iFld1);
54                 } catch (ArithmeticException a_e) {}
55                 break;
56             default:
57             }
58         }
59     }
60 
main(String[] strArr)61     public static void main(String[] strArr) {
62         ConvI2LWideningAssertTooStrong _instance = new ConvI2LWideningAssertTooStrong();
63         for (int i = 0; i < 10 * 202 * 8; i++ ) {
64             _instance.vMeth((short)20806);
65         }
66     }
67 }
68