Skip to content

Commit 6997bfc

Browse files
committed
8323154: C2: assert(cmp != nullptr && cmp->Opcode() == Op_Cmp(bt)) failed: no exit test
Reviewed-by: roland, thartmann, qamai
1 parent 16be388 commit 6997bfc

File tree

2 files changed

+50
-1
lines changed

2 files changed

+50
-1
lines changed

src/hotspot/share/opto/subnode.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ static bool ok_to_convert(Node* inc, Node* var) {
155155
static bool is_cloop_condition(BoolNode* bol) {
156156
for (DUIterator_Fast imax, i = bol->fast_outs(imax); i < imax; i++) {
157157
Node* out = bol->fast_out(i);
158-
if (out->is_CountedLoopEnd()) {
158+
if (out->is_BaseCountedLoopEnd()) {
159159
return true;
160160
}
161161
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
* Copyright (c) 2024, Oracle and/or its affiliates. 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+
package compiler.c2;
24+
25+
/*
26+
* @test
27+
* @bug 8323154
28+
* @summary Long counted loop exit check should not be transformed into an unsigned check
29+
*
30+
* @run main/othervm -Xbatch -XX:CompileCommand=compileonly,compiler.c2.TestMinValueStrideLongCountedLoop::test
31+
* compiler.c2.TestMinValueStrideLongCountedLoop
32+
*/
33+
34+
public class TestMinValueStrideLongCountedLoop {
35+
static long limit = 0;
36+
static long res = 0;
37+
38+
public static void main(String[] args) {
39+
for (int i = 0; i < 10000; i++) {
40+
test();
41+
}
42+
}
43+
44+
static void test() {
45+
for (long i = 0; i >= limit + (Long.MIN_VALUE + 1); i += Long.MIN_VALUE) {
46+
res += 42;
47+
}
48+
}
49+
}

0 commit comments

Comments
 (0)