8036748: assert(_base == Int) failed: Not an Int w/ -XX:+TraceIterativeGVN
authorvlivanov
Fri, 24 Oct 2014 09:14:41 -0700
changeset 27422 954620f336dc
parent 27421 df2b6ff5c959
child 27423 a52be21f172a
8036748: assert(_base == Int) failed: Not an Int w/ -XX:+TraceIterativeGVN Reviewed-by: kvn, roland
hotspot/src/share/vm/opto/callnode.cpp
hotspot/test/compiler/debug/TraceIterativeGVN.java
--- a/hotspot/src/share/vm/opto/callnode.cpp	Fri Oct 24 09:13:12 2014 -0700
+++ b/hotspot/src/share/vm/opto/callnode.cpp	Fri Oct 24 09:14:41 2014 -0700
@@ -939,7 +939,8 @@
 #ifndef PRODUCT
   if (!(call->req() > TypeFunc::Parms &&
         call->in(TypeFunc::Parms) != NULL &&
-        call->in(TypeFunc::Parms)->is_Con())) {
+        call->in(TypeFunc::Parms)->is_Con() &&
+        call->in(TypeFunc::Parms)->bottom_type()->isa_int())) {
     assert(in_dump() != 0, "OK if dumping");
     tty->print("[bad uncommon trap]");
     return 0;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/debug/TraceIterativeGVN.java	Fri Oct 24 09:14:41 2014 -0700
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @run main/othervm -Xbatch -XX:-TieredCompilation
+ *                   -XX:+IgnoreUnrecognizedVMOptions -XX:+TraceIterativeGVN
+ *                   TraceIterativeGVN
+ */
+public class TraceIterativeGVN {
+    public static void main(String[] args) {
+        for (int i = 0; i < 100_000; i++) {
+            Byte.valueOf((byte)0);
+        }
+        System.out.println("TEST PASSED");
+    }
+}