test/compiler/6910484/Test.java

Mon, 28 Jul 2014 15:06:38 -0700

author
fzhinkin
date
Mon, 28 Jul 2014 15:06:38 -0700
changeset 6997
dbb05f6d93c4
parent 1907
c18cbe5936b8
child 6876
710a3c8b516e
permissions
-rw-r--r--

8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
Summary: call rtm_deopt() only if there were no compilation bailouts before.
Reviewed-by: kvn

kvn@1589 1 /*
kvn@1589 2 * Copyright 2009 SAP. All Rights Reserved.
kvn@1589 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
kvn@1589 4 *
kvn@1589 5 * This code is free software; you can redistribute it and/or modify it
kvn@1589 6 * under the terms of the GNU General Public License version 2 only, as
kvn@1589 7 * published by the Free Software Foundation.
kvn@1589 8 *
kvn@1589 9 * This code is distributed in the hope that it will be useful, but WITHOUT
kvn@1589 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
kvn@1589 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
kvn@1589 12 * version 2 for more details (a copy is included in the LICENSE file that
kvn@1589 13 * accompanied this code).
kvn@1589 14 *
kvn@1589 15 * You should have received a copy of the GNU General Public License version
kvn@1589 16 * 2 along with this work; if not, write to the Free Software Foundation,
kvn@1589 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
kvn@1589 18 *
trims@1907 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@1907 20 * or visit www.oracle.com if you need additional information or have any
trims@1907 21 * questions.
kvn@1589 22 */
kvn@1589 23
kvn@1589 24 /**
kvn@1589 25 * @test
kvn@1589 26 * @bug 6910484
kvn@1589 27 * @summary incorrect integer optimization (loosing and op-r in a given example)
kvn@1589 28 *
kvn@1589 29 * @run main/othervm -Xbatch Test
kvn@1589 30 */
kvn@1589 31
kvn@1589 32 public class Test {
kvn@1589 33
kvn@1589 34 public static void main(String[] args) {
kvn@1589 35 long iteration = 0;
kvn@1589 36 for(int i = 0; i <11000; i++) {
kvn@1589 37 iteration++;
kvn@1589 38 int result = test(255);
kvn@1589 39 if (result != 112) {
kvn@1589 40 System.out.println("expected 112, but got " + result + " after iteration " + iteration);
kvn@1589 41 System.exit(97);
kvn@1589 42 }
kvn@1589 43 }
kvn@1589 44 }
kvn@1589 45
kvn@1589 46 private static int test(int x) {
kvn@1589 47 return (x & -32) / 2;
kvn@1589 48 }
kvn@1589 49
kvn@1589 50 }

mercurial