diff options
author | Teddy <[email protected]> | 2014-05-06 13:24:47 +0800 |
---|---|---|
committer | Teddy <[email protected]> | 2014-05-06 13:24:47 +0800 |
commit | bc0b78bde2a8d46a0fb61b32b3fc591b1ae16cd4 (patch) | |
tree | b936da2fd68e6d3d21b30447a283ab3c6b98fedc | |
parent | 696f1e9fb8f3c4004f22d8adaddec5d709c90e7b (diff) |
...
-rw-r--r-- | mips.c | 8 | ||||
-rw-r--r-- | ssa.c | 2 |
2 files changed, 9 insertions, 1 deletions
@@ -519,6 +519,14 @@ void mips_generate(void) { int rd = i->dest->reg; int j; memset(used_reg, 0, sizeof used_reg); + /* NOTE: bad hack */ + if (i->src1->kind == IMMF && !strcmp(i->src1->info.str, "__print_string")) + { + printf( "\tlw $a0, 0($sp)\n" + "\tli $2, 4\n" + "\tsyscall\n"); + break; + } if (rt->type == CSTRUCT || rt->type == CUNION) used_reg[30] = 1; /* save $fp */ for (p = defs; p; p = p->next) @@ -152,7 +152,7 @@ void cfg_add_edge(CBlock_t from, CBlock_t to) { } void dtree_add_edge(CBlock_t from, CBlock_t to) { -/* printf("%d d-> %d\n", from->id, to->id); */ + fprintf(stderr, "%d d-> %d\n", from->id, to->id); int id = from->id; CEdge *e = NEW(CEdge); e->to = to; |