6778669: Patch from Red Hat -- fixes compilation errors

Some fixes which are required to build on recent GCCs.

Reviewed-by: never, kvn
This commit is contained in:
Lillian Angel 2009-02-27 03:35:40 -08:00 committed by Christian Thalinger
parent 114da9bcfc
commit d6cdfde9d9
20 changed files with 188 additions and 175 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright 1998-2008 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 1998-2009 Sun Microsystems, Inc. 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
@ -844,8 +844,12 @@ void InstructForm::build_components() {
for (_parameters.reset(); (name = _parameters.iter()) != NULL;) {
OperandForm *opForm = (OperandForm*)_localNames[name];
const Form *form = _effects[name];
Effect *e = form ? form->is_effect() : NULL;
Effect* e = NULL;
{
const Form* form = _effects[name];
e = form ? form->is_effect() : NULL;
}
if (e != NULL) {
has_temp |= e->is(Component::TEMP);
@ -1110,7 +1114,7 @@ bool InstructForm::cisc_spills_to(ArchDesc &AD, InstructForm *instr) {
const char *op_name = NULL;
const char *reg_type = NULL;
FormDict &globals = AD.globalNames();
cisc_spill_operand = _matrule->cisc_spill_match(globals, AD.get_registers(), instr->_matrule, op_name, reg_type);
cisc_spill_operand = _matrule->matchrule_cisc_spill_match(globals, AD.get_registers(), instr->_matrule, op_name, reg_type);
if( (cisc_spill_operand != Not_cisc_spillable) && (op_name != NULL) && equivalent_predicates(this, instr) ) {
cisc_spill_operand = operand_position(op_name, Component::USE);
int def_oper = operand_position(op_name, Component::DEF);
@ -2194,7 +2198,7 @@ int OperandForm::operand_position(const char *name, int usedef) {
// Return -1 if not in list.
int OperandForm::constant_position(FormDict &globals, const Component *last) {
// Iterate through components and count constants preceeding 'constant'
uint position = 0;
int position = 0;
Component *comp;
_components.reset();
while( (comp = _components.iter()) != NULL && (comp != last) ) {
@ -2297,7 +2301,7 @@ void OperandForm::disp_is_oop(FILE *fp, FormDict &globals) {
if ( op->is_base_constant(globals) == Form::idealP ) {
// Find the constant's index: _c0, _c1, _c2, ... , _cN
uint idx = op->constant_position( globals, rep_var);
fprintf(fp," virtual bool disp_is_oop() const {", _ident);
fprintf(fp," virtual bool disp_is_oop() const {");
fprintf(fp, " return _c%d->isa_oop_ptr();", idx);
fprintf(fp, " }\n");
}
@ -3035,9 +3039,9 @@ bool MatchNode::find_type(const char *type, int &position) const {
// Recursive call collecting info on top-level operands, not transitive.
// Implementation does not modify state of internal structures.
void MatchNode::append_components(FormDict &locals, ComponentList &components,
bool deflag) const {
int usedef = deflag ? Component::DEF : Component::USE;
void MatchNode::append_components(FormDict& locals, ComponentList& components,
bool def_flag) const {
int usedef = def_flag ? Component::DEF : Component::USE;
FormDict &globals = _AD.globalNames();
assert (_name != NULL, "MatchNode::build_components encountered empty node\n");
@ -3055,10 +3059,10 @@ void MatchNode::append_components(FormDict &locals, ComponentList &components,
return;
}
// Promote results of "Set" to DEF
bool def_flag = (!strcmp(_opType, "Set")) ? true : false;
if (_lChild) _lChild->append_components(locals, components, def_flag);
def_flag = false; // only applies to component immediately following 'Set'
if (_rChild) _rChild->append_components(locals, components, def_flag);
bool tmpdef_flag = (!strcmp(_opType, "Set")) ? true : false;
if (_lChild) _lChild->append_components(locals, components, tmpdef_flag);
tmpdef_flag = false; // only applies to component immediately following 'Set'
if (_rChild) _rChild->append_components(locals, components, tmpdef_flag);
}
// Find the n'th base-operand in the match node,
@ -3404,9 +3408,9 @@ bool static root_ops_match(FormDict &globals, const char *op1, const char *op2)
return (form1 == form2);
}
//-------------------------cisc_spill_match------------------------------------
//-------------------------cisc_spill_match_node-------------------------------
// Recursively check two MatchRules for legal conversion via cisc-spilling
int MatchNode::cisc_spill_match(FormDict &globals, RegisterForm *registers, MatchNode *mRule2, const char * &operand, const char * &reg_type) {
int MatchNode::cisc_spill_match(FormDict& globals, RegisterForm* registers, MatchNode* mRule2, const char* &operand, const char* &reg_type) {
int cisc_spillable = Maybe_cisc_spillable;
int left_spillable = Maybe_cisc_spillable;
int right_spillable = Maybe_cisc_spillable;
@ -3480,13 +3484,13 @@ int MatchNode::cisc_spill_match(FormDict &globals, RegisterForm *registers, Mat
return cisc_spillable;
}
//---------------------------cisc_spill_match----------------------------------
//---------------------------cisc_spill_match_rule------------------------------
// Recursively check two MatchRules for legal conversion via cisc-spilling
// This method handles the root of Match tree,
// general recursive checks done in MatchNode
int MatchRule::cisc_spill_match(FormDict &globals, RegisterForm *registers,
MatchRule *mRule2, const char * &operand,
const char * &reg_type) {
int MatchRule::matchrule_cisc_spill_match(FormDict& globals, RegisterForm* registers,
MatchRule* mRule2, const char* &operand,
const char* &reg_type) {
int cisc_spillable = Maybe_cisc_spillable;
int left_spillable = Maybe_cisc_spillable;
int right_spillable = Maybe_cisc_spillable;
@ -3524,7 +3528,7 @@ int MatchRule::cisc_spill_match(FormDict &globals, RegisterForm *registers,
//----------------------------- equivalent ------------------------------------
// Recursively check to see if two match rules are equivalent.
// This rule handles the root.
bool MatchRule::equivalent(FormDict &globals, MatchRule *mRule2) {
bool MatchRule::equivalent(FormDict &globals, MatchNode *mRule2) {
// Check that each sets a result
if (sets_result() != mRule2->sets_result()) {
return false;
@ -3640,7 +3644,7 @@ void MatchNode::swap_commutative_op(bool atroot, int id) {
//-------------------------- swap_commutative_op ------------------------------
// Recursively swap specified commutative operation with subtree operands.
void MatchRule::swap_commutative_op(const char* instr_ident, int count, int& match_rules_cnt) {
void MatchRule::matchrule_swap_commutative_op(const char* instr_ident, int count, int& match_rules_cnt) {
assert(match_rules_cnt < 100," too many match rule clones");
// Clone
MatchRule* clone = new MatchRule(_AD, this);
@ -3653,8 +3657,8 @@ void MatchRule::swap_commutative_op(const char* instr_ident, int count, int& mat
clone->_next = this->_next;
this-> _next = clone;
if( (--count) > 0 ) {
this-> swap_commutative_op(instr_ident, count, match_rules_cnt);
clone->swap_commutative_op(instr_ident, count, match_rules_cnt);
this-> matchrule_swap_commutative_op(instr_ident, count, match_rules_cnt);
clone->matchrule_swap_commutative_op(instr_ident, count, match_rules_cnt);
}
}
@ -3686,7 +3690,7 @@ MatchRule::~MatchRule() {
// Recursive call collecting info on top-level operands, not transitive.
// Implementation does not modify state of internal structures.
void MatchRule::append_components(FormDict &locals, ComponentList &components) const {
void MatchRule::append_components(FormDict& locals, ComponentList& components, bool def_flag) const {
assert (_name != NULL, "MatchNode::build_components encountered empty node\n");
MatchNode::append_components(locals, components,