summaryrefslogtreecommitdiff
path: root/compiler_and_linker/unsorted/CodeGen.c
diff options
context:
space:
mode:
authorAsh Wolf <ninji@wuffs.org>2023-01-20 00:39:43 +0000
committerAsh Wolf <ninji@wuffs.org>2023-01-20 00:39:43 +0000
commit7d986adf37220e1981a707745b784b078de4e3bc (patch)
tree831dea5f470c0c6b3c373f38d3a5f0354bc22600 /compiler_and_linker/unsorted/CodeGen.c
parent4d670146b4054e11e90227f96a3a1c66410e8d0b (diff)
downloadMWCC-7d986adf37220e1981a707745b784b078de4e3bc.tar.gz
MWCC-7d986adf37220e1981a707745b784b078de4e3bc.zip
fix various inaccuracies exposed by the mach ppc plugin
Diffstat (limited to 'compiler_and_linker/unsorted/CodeGen.c')
-rw-r--r--compiler_and_linker/unsorted/CodeGen.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/compiler_and_linker/unsorted/CodeGen.c b/compiler_and_linker/unsorted/CodeGen.c
index 19c7d1d..908f71b 100644
--- a/compiler_and_linker/unsorted/CodeGen.c
+++ b/compiler_and_linker/unsorted/CodeGen.c
@@ -231,9 +231,9 @@ static void retain_argument_register(Object *obj, short reg) {
}
static void allocate_local_vregs(void) {
- VarInfo *vi;
ObjectList *list;
Object *obj;
+ VarInfo *vi;
if (copts.codegen_pic && uses_globals && assignable_registers[RegClass_GPR]) {
if (assignable_registers[RegClass_GPR]) {
@@ -863,7 +863,6 @@ void CodeGen_Generator(Statement *statements, Object *func, UInt8 mysteryFlag, B
Statement *stmt;
Boolean has_varargs;
PCodeBlock *tmp;
- Object *obj;
SInt32 size;
CodeGen_InitialSanityCheck();
@@ -877,8 +876,11 @@ void CodeGen_Generator(Statement *statements, Object *func, UInt8 mysteryFlag, B
if (!func) {
func = createstaticinitobject();
- } else if (func && func->name) {
- PrintProgressFunction(func->name->name);
+ } else {
+#ifdef CW_CLT
+ if (func && func->name)
+ PrintProgressFunction(func->name->name);
+#endif
}
gFunction = func;
@@ -981,8 +983,7 @@ void CodeGen_Generator(Statement *statements, Object *func, UInt8 mysteryFlag, B
break;
case ST_ENDCATCHDTOR:
CError_ASSERT(2056, stmt->expr->data.objref->datatype == DLOCAL);
- obj = stmt->expr->data.objref;
- add_immediate(3, local_base_register(obj), obj, 0);
+ add_immediate(3, local_base_register(stmt->expr->data.objref), stmt->expr->data.objref, 0);
{
UInt32 masks[RegClassMax] = {0, 0, 0, 0, 0};
masks[RegClass_GPR] |= 1 << 3;
@@ -1467,7 +1468,7 @@ void CodeGen_ParsePragma(HashNameNode *name) {
return;
}
- if (!strcmp(name->name, "unroll_speculative")) {
+ if (!strcmp(name->name, "ppc_unroll_speculative")) {
if (plex() == TK_IDENTIFIER) {
if (!strcmp(tkidentifier->name, "off")) {
copts.unroll_speculative = 0;
@@ -1484,7 +1485,7 @@ void CodeGen_ParsePragma(HashNameNode *name) {
return;
}
- if (!strcmp(name->name, "unroll_instr_limit")) {
+ if (!strcmp(name->name, "ppc_unroll_instructions_limit")) {
t = plex();
if (t == TK_INTCONST) {
copts.unroll_instr_limit = CInt64_GetULong(&tkintconst);
@@ -1539,7 +1540,7 @@ void CodeGen_ParsePragma(HashNameNode *name) {
return;
}
- if (!strcmp(name->name, "unroll_factor_limit")) {
+ if (!strcmp(name->name, "ppc_unroll_factor_limit")) {
t = plex();
if (t == TK_INTCONST) {
copts.unroll_factor_limit = CInt64_GetULong(&tkintconst);