Mon, 23 Mar 2020 19:52:34 +0800
8240576: JVM crashes after transformation in C2 IdealLoopTree::merge_many_backedges
Reviewed-by: kvn
Contributed-by: hedongbo@huawei.com
fyang@9910 | 1 | /* |
fyang@9910 | 2 | * Copyright (c) 2020, Huawei Technologies Co. Ltd. All rights reserved. |
fyang@9910 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
fyang@9910 | 4 | * |
fyang@9910 | 5 | * This code is free software; you can redistribute it and/or modify it |
fyang@9910 | 6 | * under the terms of the GNU General Public License version 2 only, as |
fyang@9910 | 7 | * published by the Free Software Foundation. |
fyang@9910 | 8 | * |
fyang@9910 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
fyang@9910 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
fyang@9910 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
fyang@9910 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
fyang@9910 | 13 | * accompanied this code). |
fyang@9910 | 14 | * |
fyang@9910 | 15 | * You should have received a copy of the GNU General Public License version |
fyang@9910 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
fyang@9910 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
fyang@9910 | 18 | * |
fyang@9910 | 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
fyang@9910 | 20 | * or visit www.oracle.com if you need additional information or have any |
fyang@9910 | 21 | * questions. |
fyang@9910 | 22 | */ |
fyang@9910 | 23 | |
fyang@9910 | 24 | /** |
fyang@9910 | 25 | * @test |
fyang@9910 | 26 | * @bug 8240576 |
fyang@9910 | 27 | * @summary JVM crashes after transformation in C2 IdealLoopTree::merge_many_backedges |
fyang@9910 | 28 | * |
fyang@9910 | 29 | * @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation |
fyang@9910 | 30 | * compiler.loopopts.TestBeautifyLoops |
fyang@9910 | 31 | */ |
fyang@9910 | 32 | |
fyang@9910 | 33 | package compiler.loopopts; |
fyang@9910 | 34 | |
fyang@9910 | 35 | public class TestBeautifyLoops { |
fyang@9910 | 36 | private int mI = 0; |
fyang@9910 | 37 | private long mJ = 0; |
fyang@9910 | 38 | private float mF = 0f; |
fyang@9910 | 39 | |
fyang@9910 | 40 | public void testMethod() { |
fyang@9910 | 41 | for (int i0 = 0; i0 < 100; i0++) { |
fyang@9910 | 42 | if (mF != 0) { |
fyang@9910 | 43 | // do nothing |
fyang@9910 | 44 | } else { |
fyang@9910 | 45 | try { |
fyang@9910 | 46 | mJ = Long.MAX_VALUE; |
fyang@9910 | 47 | for (int i1 = 0; i1 < 101; i1++) { |
fyang@9910 | 48 | for (int i2 = 0; i2 < 102; i2++) { |
fyang@9910 | 49 | mI = new Integer(0x1234); |
fyang@9910 | 50 | } |
fyang@9910 | 51 | } |
fyang@9910 | 52 | } catch (Exception ignored) {} |
fyang@9910 | 53 | } |
fyang@9910 | 54 | } |
fyang@9910 | 55 | } |
fyang@9910 | 56 | |
fyang@9910 | 57 | public static void main(String[] args) { |
fyang@9910 | 58 | TestBeautifyLoops obj = new TestBeautifyLoops(); |
fyang@9910 | 59 | obj.testMethod(); |
fyang@9910 | 60 | } |
fyang@9910 | 61 | } |