23
23
24
24
/*
25
25
* @test
26
- * @bug 8284358
26
+ * @bug 8284358 8296912
27
27
* @summary An unreachable loop is not removed, leading to a broken graph.
28
28
* @requires vm.compiler2.enabled
29
29
* @run main/othervm -Xcomp -XX:-TieredCompilation -XX:+UnlockDiagnosticVMOptions -XX:+StressIGVN -XX:StressSeed=1448005075
30
- * -XX:CompileCommand=compileonly,*TestDeadDataLoop::test* -XX:CompileCommand=dontinline,*TestDeadDataLoop::notInlined
30
+ * -XX:CompileCommand=compileonly,*TestDeadDataLoop::test* -XX:CompileCommand=dontinline,*TestDeadDataLoop::notInlined*
31
31
* compiler.c2.TestDeadDataLoop
32
32
* @run main/othervm -Xcomp -XX:-TieredCompilation -XX:+UnlockDiagnosticVMOptions -XX:+StressIGVN -XX:StressSeed=1922737097
33
- * -XX:CompileCommand=compileonly,*TestDeadDataLoop::test* -XX:CompileCommand=dontinline,*TestDeadDataLoop::notInlined
33
+ * -XX:CompileCommand=compileonly,*TestDeadDataLoop::test* -XX:CompileCommand=dontinline,*TestDeadDataLoop::notInlined*
34
+ * compiler.c2.TestDeadDataLoop
35
+ * @run main/othervm -Xcomp -XX:-TieredCompilation -XX:+UnlockDiagnosticVMOptions -XX:+StressIGVN -XX:StressSeed=2472844645
36
+ * -XX:CompileCommand=compileonly,*TestDeadDataLoop::test* -XX:CompileCommand=dontinline,*TestDeadDataLoop::notInlined*
34
37
* compiler.c2.TestDeadDataLoop
35
38
* @run main/othervm -Xcomp -XX:-TieredCompilation -XX:+UnlockDiagnosticVMOptions -XX:+StressIGVN
36
- * -XX:CompileCommand=compileonly,*TestDeadDataLoop::test* -XX:CompileCommand=dontinline,*TestDeadDataLoop::notInlined
39
+ * -XX:CompileCommand=compileonly,*TestDeadDataLoop::test* -XX:CompileCommand=dontinline,*TestDeadDataLoop::notInlined*
37
40
* compiler.c2.TestDeadDataLoop
38
41
*/
39
42
@@ -216,10 +219,29 @@ static void test10() {
216
219
}
217
220
}
218
221
222
+ static long l ;
223
+
224
+ static void test11 (boolean never ) {
225
+ float f = 1 ;
226
+ boolean b ;
227
+ for (int i = 0 ; i < 5 ; ++i ) {
228
+ b = (never || l < 0 );
229
+ l = notInlined2 ();
230
+ if (!never ) {
231
+ f += i ;
232
+ }
233
+ }
234
+ l += f ;
235
+ }
236
+
219
237
public static boolean notInlined () {
220
238
return false ;
221
239
}
222
240
241
+ public static int notInlined2 () {
242
+ return 42 ;
243
+ }
244
+
223
245
public static void main (String [] args ) {
224
246
// Make sure classes are initialized
225
247
Integer i = 42 ;
@@ -234,6 +256,7 @@ public static void main(String[] args) {
234
256
test8 ();
235
257
test9 ();
236
258
test10 ();
259
+ test11 (false );
237
260
}
238
261
}
239
262
0 commit comments