Skip to content

Commit 600de7e

Browse files
Merge pull request #472 from Wuerfel21/W21-fix-inline-reg-reuse
Fix inline register reuse bug
2 parents d6e040e + 3ac74fd commit 600de7e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

backends/asm/outasm.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,14 @@ void ReplaceIRWithInline(IRList *irl, IR *origir, Function *func)
666666
IR *ir;
667667
IRCond cond = origir->cond;
668668
Operand *condlbl = NULL;
669-
static char *prefix = "_inline_";
669+
670+
static unsigned inlineNum = 0;
671+
char prefix[64];
672+
if (curfunc->optimize_flags & OPT_LOCAL_REUSE) {
673+
snprintf(prefix,64-1,"_inline%d_",++inlineNum);
674+
} else {
675+
strcpy(prefix,"_inline_");
676+
}
670677

671678
DeleteIR(irl, origir);
672679
if (cond != COND_TRUE) {

0 commit comments

Comments
 (0)