Below are a few bug fixes that didn't make it into the SGI Pro64
version 0.13 release. Each fix is only a few lines of code. The
problems arise only occasionally, but these changes still might
prove helpful to some. The line numbers below might not exactly
match the 0.13 source.
- David
----------------------------------------
(1) LNO scalar renaming needs to reset field_id to zero. In the
file be/lno/ff_utils.cxx, near the end of the function
scalar_rename, replace:
***************
*** 650,656 ****
OPCODE_rtype(scalar_op),
Promote_Type(OPCODE_desc(scalar_op))));
WN_set_ty(scalar_ref,Be_Type_Tbl(Promote_Type(desc)));
< WN_offset(scalar_ref)=new_symbol.WN_Offset();
if (Alias_Mgr) {
Create_alias(Alias_Mgr,scalar_ref);
}
--- 650,656 ----
OPCODE_rtype(scalar_op),
Promote_Type(OPCODE_desc(scalar_op))));
WN_set_ty(scalar_ref,Be_Type_Tbl(Promote_Type(desc)));
> WN_set_field_id(scalar_ref, 0); // fix 819155
if (Alias_Mgr) {
Create_alias(Alias_Mgr,scalar_ref);
}
----------------------------------------
(2) CICSE_Transform segfaults when a loop-invariant TN value is stored.
In be/cg/cio_rwtran.cxx, in the middle of the body of the method
CIO_RWTRAN::CICSE_Transform, replace:
***************
*** 2524,2530 ****
// If source TN occurs later as a result, then new TN is required
// NOT ALWAYS NECESSARY! IMPROVE THIS!
INT tn_index = hTN_MAP32_Get( tn_last_op, change.new_tns[0] );
< if ( OP_Precedes( change.source, cicse_table[tn_index].op ) )
change.new_tns[0] = Build_TN_Like( change.new_tns[0] );
} else {
--- 2524,2531 ----
// If source TN occurs later as a result, then new TN is required
// NOT ALWAYS NECESSARY! IMPROVE THIS!
INT tn_index = hTN_MAP32_Get( tn_last_op, change.new_tns[0] );
> if ( tn_index == 0 ||
> OP_Precedes( change.source, cicse_table[tn_index].op ) )
change.new_tns[0] = Build_TN_Like( change.new_tns[0] );
} else {
----------------------------------------
(3) Undo an incorrect change to IVR. In the file be/opt/opt_ivr.cxx,
in the body of the method IVR::Ident_all_iv_cands, replace:
***************
*** 1032,1038 ****
// the type of the IV is the type of increment expr.
MTYPE dtype;
if (incr->Defstmt())
< dtype = incr->Defstmt()->Rhs()->Dsctyp();
else
dtype = incr->Defphi()->OPND(0)->Defstmt()->Rhs()->Dtyp();
--- 1032,1038 ----
// the type of the IV is the type of increment expr.
MTYPE dtype;
if (incr->Defstmt())
> dtype = incr->Defstmt()->Rhs()->Dtyp();
else
dtype = incr->Defphi()->OPND(0)->Defstmt()->Rhs()->Dtyp();
----------------------------------------
(4) If Fix_zero_version generates a new version, the volatile flag
should be set correctly. In the file be/opt/opt_find.cxx, in
each of the methods CODEMAP::Fix_zero_version, insert:
***************
*** 783,789 ****
if (phi_res->Is_flag_set(CF_MADEUP_TYPE))
retval->Set_flag(CF_MADEUP_TYPE);
// TODO: Probably need to set a bunch of *retval's fields
// here. See opt_ivr.cxx for examples.
--- 783,794 ----
if (phi_res->Is_flag_set(CF_MADEUP_TYPE))
retval->Set_flag(CF_MADEUP_TYPE);
> // Fix 815093: Set volatile flag
> if ( Opt_stab()->Is_volatile( phi_res->Aux_id() ) ) {
> retval->Set_is_volatile();
> }
>
// TODO: Probably need to set a bunch of *retval's fields
// here. See opt_ivr.cxx for examples.
***************
*** 848,853 ****
chi_opnd->Lod_ty(),
chi_opnd->Field_id(),
TRUE);
// TODO: Probably need to set a bunch of *retval's fields
// here. See opt_ivr.cxx for examples.
--- 853,863 ----
chi_opnd->Lod_ty(),
chi_opnd->Field_id(),
TRUE);
>
> // Fix 815093: Set volatile flag
> if ( Opt_stab()->Is_volatile( chi_opnd->Aux_id() ) ) {
> retval->Set_is_volatile();
> }
// TODO: Probably need to set a bunch of *retval's fields
// here. See opt_ivr.cxx for examples.
----------------------------------------
|