Skip to content

Commit

Permalink
initialize cgstate.allregs in cod3.d (#16819)
Browse files Browse the repository at this point in the history
  • Loading branch information
WalterBright authored Aug 29, 2024
1 parent 80a4a56 commit 452ebe2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions compiler/src/dmd/backend/code.d
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ struct CGstate

int BPoff; // offset from BP
int EBPtoESP; // add to EBP offset to get ESP offset
reg_t BP; // frame pointer
REGSAVE regsave;

targ_size_t spoff;
Expand Down Expand Up @@ -219,6 +220,8 @@ struct CGstate

int dfoidx; // which block we are in
regm_t allregs; // ALLREGS optionally including mBP
regm_t fpregs; // all floating point registers
regm_t xmmregs; // all XMM registers
regm_t mfuncreg; // mask of registers preserved by function
regm_t msavereg; // Mask of registers that we would like to save.
// they are temporaries (set by scodelem())
Expand All @@ -227,6 +230,8 @@ struct CGstate
con_t regcon; // register contents
BackendPass pass;

bool AArch64; // true if AArch64 code generator

int cmp_flag; // pass extra flag from cdcod() to cdcmp()
/**********************************
* Set value in regimmed for reg.
Expand Down
1 change: 0 additions & 1 deletion compiler/src/dmd/backend/x86/cgcod.d
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ void codgen(Symbol *sfunc)

cgreg_init();
CSE.initialize();
cgstate.allregs = ALLREGS;
cgstate.Alloca.initialize();
cgstate.anyiasm = 0;

Expand Down
2 changes: 2 additions & 0 deletions compiler/src/dmd/backend/x86/cod3.d
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ void cod3_set32()
v = W|T|6;

TARGET_STACKALIGN = config.fpxmmregs ? 16 : 4;
cgstate.allregs = mAX|mBX|mCX|mDX|mSI|mDI;
}

/********************************
Expand Down Expand Up @@ -375,6 +376,7 @@ void cod3_set64()
v = W|T|6;

TARGET_STACKALIGN = config.fpxmmregs ? 16 : 8;
cgstate.allregs = mAX|mBX|mCX|mDX|mSI|mDI| mR8|mR9|mR10|mR11|mR12|mR13|mR14|mR15;
}

/*********************************
Expand Down

0 comments on commit 452ebe2

Please sign in to comment.