-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
8262017: C2: assert(n != __null) failed: Bad immediate dominator info.
8205407: [windows, vs<2017] C4800 after 8203197 Reviewed-by: mbalao, roland Backport-of: 2db9005c07585b580b3ec0889b8b5e3ed0d0ca6a
- Loading branch information
1 parent
44eac48
commit 385e34d
Showing
5 changed files
with
308 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
158 changes: 158 additions & 0 deletions
158
hotspot/test/compiler/rangechecks/TestRangeCheckLimits.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
/* | ||
* Copyright (c) 2021, Oracle and/or its affiliates. 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 8262017 | ||
* @summary Dominator failure because ConvL2I node becomes TOP due to missing overflow/underflow handling in range check elimination | ||
* in PhaseIdealLoop::add_constraint(). | ||
* @run main/othervm -Xcomp -XX:-TieredCompilation -XX:CompileCommand=compileonly,compiler.rangechecks.TestRangeCheckLimits::* | ||
* compiler.rangechecks.TestRangeCheckLimits | ||
*/ | ||
|
||
package compiler.rangechecks; | ||
|
||
public class TestRangeCheckLimits { | ||
static int a = 400; | ||
static volatile int b; | ||
static long lFld; | ||
static int iFld; | ||
|
||
public static void main(String[] k) { | ||
// Test all cases in PhaseIdealLoop::add_constraint(). | ||
testPositiveCaseMainLoop(); | ||
testNegativeCaseMainLoop(); | ||
testPositiveCasePreLoop(); | ||
testNegativeCasePreLoop(); | ||
} | ||
|
||
public static void testPositiveCaseMainLoop() { | ||
int e, f, g = 0, h[] = new int[a]; | ||
double i[] = new double[a]; | ||
long j = 9; | ||
Helper.init(h, 3); | ||
for (e = 5; e < 154; e++) { | ||
for (f = 1; f < 169; f += 2) { | ||
b = e; | ||
} | ||
i[1] = b; | ||
for (g = 8; g < 168; g += 2) { | ||
j = g - 5; | ||
if (j > Integer.MAX_VALUE - 1) { | ||
switch (3) { | ||
case 3: | ||
} | ||
} | ||
} | ||
} | ||
if (g != 168) { | ||
throw new RuntimeException("fail"); | ||
} | ||
lFld = j; | ||
} | ||
|
||
|
||
public static void testPositiveCasePreLoop() { | ||
int e, f, g = 0, h[] = new int[a]; | ||
double i[] = new double[a]; | ||
long j = 9; | ||
Helper.init(h, 3); | ||
for (e = 5; e < 154; e++) { | ||
for (f = 1; f < 169; f += 2) { | ||
b = e; | ||
} | ||
i[1] = b; | ||
for (g = 8; g < 168; g += 2) { | ||
j = g + 5; | ||
if (j > 180) { | ||
switch (3) { | ||
case 3: | ||
} | ||
} | ||
} | ||
} | ||
if (g != 168) { | ||
throw new RuntimeException("fail"); | ||
} | ||
lFld = j; | ||
} | ||
|
||
public static void testNegativeCaseMainLoop() { | ||
int e, f, g = 0, h[] = new int[a]; | ||
double i[] = new double[a]; | ||
long j = 9; | ||
Helper.init(h, 3); | ||
for (e = 5; e < 154; e++) { | ||
for (f = 1; f < 169; f += 2) { | ||
b = e; | ||
} | ||
i[1] = b; | ||
for (g = 8; g < 168; g += 2) { | ||
j = g; | ||
if (j < 5) { | ||
switch (3) { | ||
case 3: | ||
} | ||
} | ||
} | ||
} | ||
if (g != 168) { | ||
throw new RuntimeException("fail"); | ||
} | ||
lFld = j; | ||
} | ||
|
||
|
||
public static void testNegativeCasePreLoop() { | ||
int e, f, g = 0, h[] = new int[a]; | ||
double i[] = new double[a]; | ||
long j = 9; | ||
Helper.init(h, 3); | ||
for (e = 5; e < 154; e++) { | ||
for (f = 1; f < 169; f += 2) { | ||
b = e; | ||
} | ||
i[1] = b; | ||
for (g = 168; g > 8; g -= 2) { | ||
j = g - 5; | ||
if (j > Integer.MAX_VALUE - 1) { | ||
switch (3) { | ||
case 3: | ||
} | ||
} | ||
} | ||
} | ||
if (g != 8) { | ||
throw new RuntimeException("fail"); | ||
} | ||
lFld = j; | ||
} | ||
} | ||
|
||
class Helper { | ||
public static void init(int[] a, int seed) { | ||
for (int j = 0; j < a.length; j++) { | ||
a[j] = (j % 2 == 0) ? seed + j : seed - j; | ||
} | ||
} | ||
} |
385e34d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review
Issues