--- a/src/hotspot/share/adlc/formssel.cpp Fri Jul 13 11:21:55 2018 +0800
+++ b/src/hotspot/share/adlc/formssel.cpp Thu Jul 12 16:31:28 2018 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018, 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
@@ -3634,7 +3634,7 @@
&& (is_load_from_memory(mRule2->_opType) == data_type) // reg vs. (load memory)
&& (name_left != NULL) // NOT (load)
&& (name_right == NULL) ) { // NOT (load memory foo)
- const Form *form2_left = name_left ? globals[name_left] : NULL;
+ const Form *form2_left = globals[name_left];
if( form2_left && form2_left->is_cisc_mem(globals) ) {
cisc_spillable = Is_cisc_spillable;
operand = _name;
@@ -3645,7 +3645,7 @@
}
}
// Detect reg vs memory
- else if( form->is_cisc_reg(globals) && form2->is_cisc_mem(globals) ) {
+ else if (form->is_cisc_reg(globals) && form2 != NULL && form2->is_cisc_mem(globals)) {
cisc_spillable = Is_cisc_spillable;
operand = _name;
reg_type = _result;
@@ -3710,8 +3710,12 @@
}
// Check right operands: recursive walk to identify reg->mem operand
- if( (_rChild == NULL) && (mRule2->_rChild == NULL) ) {
- right_spillable = Maybe_cisc_spillable;
+ if (_rChild == NULL) {
+ if (mRule2->_rChild == NULL) {
+ right_spillable = Maybe_cisc_spillable;
+ } else {
+ assert(0, "_rChild should not be NULL");
+ }
} else {
right_spillable = _rChild->cisc_spill_match(globals, registers, mRule2->_rChild, operand, reg_type);
}