fix SPARC register allocation bugs (not verified) #130

This commit is contained in:
Costa Vitor 2009-06-15 10:29:31 -05:00
parent 9569d04a9f
commit f5a72828a0
2 changed files with 11 additions and 1 deletions

View File

@ -1584,6 +1584,7 @@ run_emulator(YAP_dogoalinfo *dgi)
{ {
choiceptr myB; choiceptr myB;
int out; int out;
BACKUP_MACHINE_REGS();
Yap_PrologMode = UserMode; Yap_PrologMode = UserMode;
out = Yap_absmi(0); out = Yap_absmi(0);
@ -1656,6 +1657,7 @@ X_API int
YAP_RetryGoal(YAP_dogoalinfo *dgi) YAP_RetryGoal(YAP_dogoalinfo *dgi)
{ {
choiceptr myB; choiceptr myB;
int out;
BACKUP_MACHINE_REGS(); BACKUP_MACHINE_REGS();
myB = (choiceptr)(LCL0-dgi->b); myB = (choiceptr)(LCL0-dgi->b);
@ -1665,7 +1667,9 @@ YAP_RetryGoal(YAP_dogoalinfo *dgi)
return FALSE; return FALSE;
} }
P = FAILCODE; P = FAILCODE;
return run_emulator(dgi); out = run_emulator(dgi);
RECOVER_MACHINE_REGS();
return out;
} }
X_API int X_API int
@ -1673,6 +1677,7 @@ YAP_LeaveGoal(int backtrack, YAP_dogoalinfo *dgi)
{ {
choiceptr myB; choiceptr myB;
BACKUP_MACHINE_REGS();
myB = (choiceptr)(LCL0-dgi->b); myB = (choiceptr)(LCL0-dgi->b);
if (B > myB) { if (B > myB) {
/* someone cut us */ /* someone cut us */
@ -2588,6 +2593,7 @@ YAP_ExtendList(Term t0, Term inp)
{ {
Term t; Term t;
CELL *ptr = RepPair(t0); CELL *ptr = RepPair(t0);
BACKUP_H();
ptr[0] = inp; ptr[0] = inp;
ptr[1] = AbsPair(ptr+2); ptr[1] = AbsPair(ptr+2);

View File

@ -1506,6 +1506,10 @@ clean_trail(Term t, DBTerm *dbt, Term t0)
{ {
tr_fr_ptr pt1, pbase; tr_fr_ptr pt1, pbase;
#ifdef SHADOW_HB
register CELL *HBREG = HB;
#endif /* SHADOW_HB */
pbase = B->cp_tr; pbase = B->cp_tr;
pt1 = TR - 1; pt1 = TR - 1;
while (pt1 >= pbase) { while (pt1 >= pbase) {