Skip to content

Commit b027ab4

Browse files
author
Rahul Raghavan
committed
8238812: assert(false) failed: bad AD file
1 parent b80e1b6 commit b027ab4

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/hotspot/share/opto/compile.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4161,10 +4161,10 @@ Node* Compile::conv_I2X_index(PhaseGVN* phase, Node* idx, const TypeInt* sizetyp
41614161
}
41624162

41634163
// Convert integer value to a narrowed long type dependent on ctrl (for example, a range check)
4164-
Node* Compile::constrained_convI2L(PhaseGVN* phase, Node* value, const TypeInt* itype, Node* ctrl) {
4164+
Node* Compile::constrained_convI2L(PhaseGVN* phase, Node* value, const TypeInt* itype, Node* ctrl, bool carry_dependency) {
41654165
if (ctrl != NULL) {
41664166
// Express control dependency by a CastII node with a narrow type.
4167-
value = new CastIINode(value, itype, false, true /* range check dependency */);
4167+
value = new CastIINode(value, itype, carry_dependency, true /* range check dependency */);
41684168
// Make the CastII node dependent on the control input to prevent the narrowed ConvI2L
41694169
// node from floating above the range check during loop optimizations. Otherwise, the
41704170
// ConvI2L node may be eliminated independently of the range check, causing the data path

src/hotspot/share/opto/compile.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1157,7 +1157,7 @@ class Compile : public Phase {
11571157
Node* ctrl = NULL);
11581158

11591159
// Convert integer value to a narrowed long type dependent on ctrl (for example, a range check)
1160-
static Node* constrained_convI2L(PhaseGVN* phase, Node* value, const TypeInt* itype, Node* ctrl);
1160+
static Node* constrained_convI2L(PhaseGVN* phase, Node* value, const TypeInt* itype, Node* ctrl, bool carry_dependency = false);
11611161

11621162
// Auxiliary methods for randomized fuzzing/stressing
11631163
int random();

src/hotspot/share/opto/parse2.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,8 +869,9 @@ bool Parse::create_jump_tables(Node* key_val, SwitchRange* lo, SwitchRange* hi)
869869
// while the control path is not removed. This can happen if the type of key_val
870870
// is later known to be out of bounds of [0, num_cases] and therefore a narrow cast
871871
// would be replaced by TOP while C2 is not able to fold the corresponding range checks.
872+
// Set _carry_dependency for the cast to avoid being removed by IGVN.
872873
#ifdef _LP64
873-
key_val = C->constrained_convI2L(&_gvn, key_val, TypeInt::INT, control());
874+
key_val = C->constrained_convI2L(&_gvn, key_val, TypeInt::INT, control(), true /* carry_dependency */);
874875
#endif
875876

876877
// Shift the value by wordsize so we have an index into the table, rather

0 commit comments

Comments
 (0)