added code to save all registers for ms_gto

changed place of #ifdef to make this null-module compile faster
when no register variables are used.
This commit is contained in:
sater 1984-05-19 11:49:37 +00:00
parent 0cd7d8826e
commit ceeeca40f6

View file

@ -1,10 +1,9 @@
#ifndef NORCSID
static char rcsid[] = "$Header$";
#endif
#include "assert.h" #include "assert.h"
#include "param.h" #include "param.h"
#include "tables.h" #include "tables.h"
#ifdef REGVARS
#include "types.h" #include "types.h"
#include <cg_pattern.h> #include <cg_pattern.h>
#include "data.h" #include "data.h"
@ -31,8 +30,6 @@ static char rcsid[] = "$Header$";
* Author: Hans van Staveren * Author: Hans van Staveren
*/ */
#ifdef REGVARS
struct regvar *rvlist; struct regvar *rvlist;
struct regvar * struct regvar *
@ -95,7 +92,7 @@ tryreg(rvlp,typ) struct regvar *rvlp; {
} }
} }
fixregvars() { fixregvars(saveall) {
register struct regvar *rv; register struct regvar *rv;
register rvtyp,i; register rvtyp,i;
@ -103,7 +100,11 @@ fixregvars() {
i_regsave(); /* machine dependent initialization */ i_regsave(); /* machine dependent initialization */
for (rvtyp=reg_any;rvtyp<=reg_float;rvtyp++) { for (rvtyp=reg_any;rvtyp<=reg_float;rvtyp++) {
for(i=0;i<nregvar[rvtyp];i++) for(i=0;i<nregvar[rvtyp];i++)
if (regassigned[rvtyp][i].ra_score>0) { if (saveall) {
struct reginfo *rp;
rp= &machregs[rvnumbers[rvtyp][i]];
regsave(codestrings[rp->r_repr],-EM_WSIZE,rp->r_size);
} else if(regassigned[rvtyp][i].ra_score>0) {
rv=regassigned[rvtyp][i].ra_rv; rv=regassigned[rvtyp][i].ra_rv;
rv->rv_reg=rvnumbers[rvtyp][i]; rv->rv_reg=rvnumbers[rvtyp][i];
regsave(codestrings[machregs[rv->rv_reg].r_repr], regsave(codestrings[machregs[rv->rv_reg].r_repr],