MIPS: use OC_EQ instead of OC_NE for new_exception to avoid branch out of range error

git-svn-id: trunk@21791 -
This commit is contained in:
pierre 2012-07-05 21:04:03 +00:00
parent 5fb3d1398a
commit b63bc6be13

View File

@ -413,6 +413,9 @@ implementation
procedure new_exception(list:TAsmList;const t:texceptiontemps;exceptlabel:tasmlabel);
var
paraloc1,paraloc2,paraloc3 : tcgpara;
{$ifdef MIPS}
sbl : tasmlabel;
{$endif MIPS}
begin
paraloc1.init;
paraloc2.init;
@ -440,7 +443,14 @@ implementation
cg.alloccpuregisters(list,R_INTREGISTER,[RS_FUNCTION_RESULT_REG]);
cg.g_exception_reason_save(list, t.reasonbuf);
cg.a_cmp_const_reg_label(list,OS_S32,OC_NE,0,cg.makeregsize(list,NR_FUNCTION_RESULT_REG,OS_S32),exceptlabel);
{$ifdef MIPS}
current_asmdata.getjumplabel(sbl);
cg.a_cmp_const_reg_label(list,OS_S32,OC_EQ,0,cg.makeregsize(list,NR_FUNCTION_RESULT_REG,OS_S32),sbl);
cg.a_jmp_always(list,exceptlabel);
cg.a_label(list,sbl);
{$else not MIPS}
cg.a_cmp_const_reg_label(list,OS_S32,OC_NE,0,cg.makeregsize(list,NR_FUNCTION_RESULT_REG,OS_S32),exceptlabel);
{$endif not MIPS}
cg.dealloccpuregisters(list,R_INTREGISTER,[RS_FUNCTION_RESULT_REG]);
paraloc1.done;
paraloc2.done;