author | dcherepanov |
Wed, 20 Mar 2019 11:51:43 +0300 | |
changeset 54200 | af3f568cbd2d |
permissions | -rw-r--r-- |
54200
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
1 |
/* |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
2 |
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
4 |
* |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
8 |
* |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
13 |
* accompanied this code). |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
14 |
* |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
18 |
* |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
21 |
* questions. |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
22 |
*/ |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
23 |
|
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
24 |
/** |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
25 |
* @test |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
26 |
* @bug 8211100 |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
27 |
* @summary hotspot C1 issue with comparing long numbers on x86 32-bit |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
28 |
* |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
29 |
* @run main/othervm -XX:+PrintCompilation -XX:CompileOnly=compiler.c1.Test8211100::test |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
30 |
* -XX:CompileCommand=quiet compiler.c1.Test8211100 |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
31 |
*/ |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
32 |
|
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
33 |
package compiler.c1; |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
34 |
|
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
35 |
public class Test8211100 { |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
36 |
private static final int ITERATIONS = 100_000; |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
37 |
|
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
38 |
public static void main(String[] args) { |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
39 |
for (int i = 0; i < ITERATIONS; i++) { |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
40 |
test(4558828911L, |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
41 |
4294967296L); |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
42 |
} |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
43 |
} |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
44 |
|
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
45 |
private static void test(long one, long two) { |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
46 |
while (true) { |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
47 |
if (one >= two) { |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
48 |
break; |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
49 |
} |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
50 |
} |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
51 |
} |
af3f568cbd2d
8211100: hotspot C1 issue with comparing long numbers on x86 32-bit
dcherepanov
parents:
diff
changeset
|
52 |
} |