changeset 10517:4226e949ec95

8151818: C1: LIRGenerator::move_to_phi can't deal with illegal phi Reviewed-by: iveresov, kvn
author mdoerr
date Wed, 23 Mar 2016 15:35:38 -0700
parents 1e385207d9f2
children 1fec7d381d2b
files src/share/vm/c1/c1_LIRGenerator.cpp src/share/vm/c1/c1_ValueStack.hpp
diffstat 2 files changed, 12 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/c1/c1_LIRGenerator.cpp	Fri Mar 18 15:54:47 2016 +0100
+++ b/src/share/vm/c1/c1_LIRGenerator.cpp	Wed Mar 23 15:35:38 2016 -0700
@@ -999,8 +999,16 @@
   Phi* phi = sux_val->as_Phi();
   // cur_val can be null without phi being null in conjunction with inlining
   if (phi != NULL && cur_val != NULL && cur_val != phi && !phi->is_illegal()) {
+    Phi* cur_phi = cur_val->as_Phi();
+    if (cur_phi != NULL && cur_phi->is_illegal()) {
+      // Phi and local would need to get invalidated
+      // (which is unexpected for Linear Scan).
+      // But this case is very rare so we simply bail out.
+      bailout("propagation of illegal phi");
+      return;
+    }
     LIR_Opr operand = cur_val->operand();
-    if (cur_val->operand()->is_illegal()) {
+    if (operand->is_illegal()) {
       assert(cur_val->as_Constant() != NULL || cur_val->as_Local() != NULL,
              "these can be produced lazily");
       operand = operand_for_instruction(cur_val);
--- a/src/share/vm/c1/c1_ValueStack.hpp	Fri Mar 18 15:54:47 2016 +0100
+++ b/src/share/vm/c1/c1_ValueStack.hpp	Wed Mar 23 15:35:38 2016 -0700
@@ -99,14 +99,14 @@
   void clear_locals();                           // sets all locals to NULL;
 
   void invalidate_local(int i) {
-    assert(_locals.at(i)->type()->is_single_word() ||
+    assert(!_locals.at(i)->type()->is_double_word() ||
            _locals.at(i + 1) == NULL, "hi-word of doubleword value must be NULL");
     _locals.at_put(i, NULL);
   }
 
   Value local_at(int i) const {
     Value x = _locals.at(i);
-    assert(x == NULL || x->type()->is_single_word() ||
+    assert(x == NULL || !x->type()->is_double_word() ||
            _locals.at(i + 1) == NULL, "hi-word of doubleword value must be NULL");
     return x;
   }
@@ -131,7 +131,7 @@
   // stack access
   Value stack_at(int i) const {
     Value x = _stack.at(i);
-    assert(x->type()->is_single_word() ||
+    assert(!x->type()->is_double_word() ||
            _stack.at(i + 1) == NULL, "hi-word of doubleword value must be NULL");
     return x;
   }