fix more matching bugs

This commit is contained in:
Ash Wolf 2023-01-14 18:58:26 +00:00
parent 86a48bfea1
commit c12644aae1
5 changed files with 10 additions and 6 deletions

View File

@ -122,7 +122,8 @@ Statement *IRO_Optimizer(Object *func, Statement *statements) {
CError_ASSERT(234, stIsSetup); CError_ASSERT(234, stIsSetup);
#ifdef CW_PATCH_DEBUG #ifdef CW_PATCH_DEBUG
IRO_Log = 1; if (copts.debuglisting)
IRO_Log = 1;
#endif #endif
DisableDueToAsm = 0; DisableDueToAsm = 0;

View File

@ -296,7 +296,8 @@ void IRO_DumpBits(char *name, BitVector *bv) {
void IRO_DumpAfterPhase(char *str, Boolean flag) { void IRO_DumpAfterPhase(char *str, Boolean flag) {
#ifdef CW_PATCH_DEBUG #ifdef CW_PATCH_DEBUG
flag = 1; if (copts.debuglisting)
flag = 1;
#endif #endif
if (flag) { if (flag) {
IRO_Dump("Dumping function %s after %s \n", FunctionName ? FunctionName->name->name : "Init-code", str); IRO_Dump("Dumping function %s after %s \n", FunctionName ? FunctionName->name->name : "Init-code", str);

View File

@ -610,9 +610,11 @@ void ObjGen_DeclareFloatConst(Object *object) {
gl = MachO_GetGList(Sections[sectionID]); gl = MachO_GetGList(Sections[sectionID]);
if (object->type->size == 4) { if (object->type->size == 4) {
float f = object->u.data.u.floatconst->value; float f = object->u.data.u.floatconst->value;
CTool_EndianConvertMem(&f, 4);
AppendGListData(gl, &f, 4); AppendGListData(gl, &f, 4);
} else if (object->type->size == 8) { } else if (object->type->size == 8) {
double f = object->u.data.u.floatconst->value; double f = object->u.data.u.floatconst->value;
CTool_EndianConvertMem(&f, 8);
AppendGListData(gl, &f, 8); AppendGListData(gl, &f, 8);
} else { } else {
CError_FATAL(998); CError_FATAL(998);

View File

@ -115,8 +115,8 @@ static void pclistblock(PCodeBlock *block, char *format, UInt32 vecSize) {
fprintf( fprintf(
pcfile, pcfile,
" %.8" PRIx32 " %.8" PRIx32 " %4" PRId32 " %-7s%c %s\n", " %.8" PRIX32 " %.8" PRIX32 " %4" PRId32 " %-7s%c %s\n",
offset, opcode, latency, offset, CTool_EndianConvertWord32(opcode), latency,
opcodeinfo[instr->op].name, chr, buf opcodeinfo[instr->op].name, chr, buf
); );

View File

@ -2379,7 +2379,7 @@ static void adjustforward(PCodeBlock *block) {
} }
} }
for (op = instr->args, i = instr->argCount; i--; op++) { for (op = scan->args, i = scan->argCount; i--; op++) {
if ( if (
PC_OP_IS_WRITE_ANY_REGISTER(op, RegClass_GPR) && PC_OP_IS_WRITE_ANY_REGISTER(op, RegClass_GPR) &&
(op->data.reg.reg == reg0 || op->data.reg.reg == reg1) (op->data.reg.reg == reg0 || op->data.reg.reg == reg1)
@ -2418,7 +2418,7 @@ static void adjustforward(PCodeBlock *block) {
} }
} }
for (op = instr->args, i = instr->argCount; i--; op++) { for (op = scan->args, i = scan->argCount; i--; op++) {
if ( if (
PC_OP_IS_WRITE_ANY_REGISTER(op, RegClass_GPR) && PC_OP_IS_WRITE_ANY_REGISTER(op, RegClass_GPR) &&
(op->data.reg.reg == reg0 || op->data.reg.reg == reg1) (op->data.reg.reg == reg0 || op->data.reg.reg == reg1)