Skip to content

Commit e351de3

Browse files
committed
8271272: C2: assert(!had_error) failed: bad dominance
Reviewed-by: kvn, thartmann, chagedorn
1 parent 6180cf1 commit e351de3

2 files changed

Lines changed: 58 additions & 1 deletion

File tree

src/hotspot/share/opto/loopnode.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2045,7 +2045,7 @@ Node* CountedLoopNode::match_incr_with_optional_truncation(Node* expr, Node** tr
20452045
}
20462046

20472047
LoopNode* CountedLoopNode::skip_strip_mined(int expect_skeleton) {
2048-
if (is_strip_mined() && is_valid_counted_loop(T_INT)) {
2048+
if (is_strip_mined() && in(EntryControl) != NULL && in(EntryControl)->is_OuterStripMinedLoop()) {
20492049
verify_strip_mined(expect_skeleton);
20502050
return in(EntryControl)->as_Loop();
20512051
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/*
2+
* Copyright (c) 2021, 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 8271272
27+
* @summary C2: assert(!had_error) failed: bad dominance
28+
*
29+
* @run main/othervm -Xcomp -XX:-TieredCompilation -XX:CompileOnly=TestMainNeverExecuted TestMainNeverExecuted
30+
*
31+
*/
32+
33+
public class TestMainNeverExecuted {
34+
public static long y;
35+
static int iArrFld[] = new int[400];
36+
static long x = 0;
37+
38+
public static void main(String[] strArr) {
39+
for (int i1 = 0; i1 < 100; i1++)
40+
vMeth(3, 5);
41+
}
42+
static void vMeth(int f, int g) {
43+
int i3 = 23;
44+
int i11 = 2, i12 = 12, i13 = 32901, i14 = 43741;
45+
for (i11 = 7; i11 < 325; ++i11) {
46+
i13 = 1;
47+
while ((i13 += 3) < 5) {
48+
iArrFld[i13 - 1] = 906;
49+
for (i14 = i13; i14 < 5; i14 += 2) {
50+
y += i14;
51+
i3 += i14;
52+
}
53+
}
54+
}
55+
x += i11 + i12 + i13 + i14;
56+
}
57+
}

0 commit comments

Comments
 (0)