6805427: adlc compiler may generate incorrect machnode emission code

Reviewed-by: kvn, twisti
This commit is contained in:
Tom Rodriguez 2009-02-25 10:53:14 -08:00
parent decdeea77d
commit a82243d887
2 changed files with 18 additions and 10 deletions

View file

@ -101,6 +101,7 @@ public:
const char *_ins_pipe; // Instruction Scheduline description class
uint *_uniq_idx; // Indexes of unique operands
int _uniq_idx_length; // Length of _uniq_idx array
uint _num_uniq; // Number of unique operands
ComponentList _components; // List of Components matches MachNode's
// operand structure
@ -257,11 +258,13 @@ public:
void set_unique_opnds();
uint num_unique_opnds() { return _num_uniq; }
uint unique_opnds_idx(int idx) {
if( _uniq_idx != NULL && idx > 0 )
if( _uniq_idx != NULL && idx > 0 ) {
assert(idx < _uniq_idx_length, "out of bounds");
return _uniq_idx[idx];
else
} else {
return idx;
}
}
}
// Operands which are only KILLs aren't part of the input array and
// require special handling in some cases. Their position in this