aboutsummaryrefslogtreecommitdiff
path: root/ssa.c
diff options
context:
space:
mode:
authorTeddy <ted.sybil@gmail.com>2014-05-05 13:55:18 +0800
committerTeddy <ted.sybil@gmail.com>2014-05-05 13:55:18 +0800
commit9d5a3d9e203572a1e33a3690c2fad5e03426e4c0 (patch)
tree5a5a200736cb3a6d2753204259591621603c9a0c /ssa.c
parentb6e3e473d0b9c1550791cc3d21d86bfa2920acb8 (diff)
fix bugs in mips_load
Diffstat (limited to 'ssa.c')
-rw-r--r--ssa.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/ssa.c b/ssa.c
index 82c865d..79d7b1a 100644
--- a/ssa.c
+++ b/ssa.c
@@ -1959,7 +1959,7 @@ int copr_comp(const void *a, const void *b) {
return (*(COpr_t *)a)->range->l - (*(COpr_t *)b)->range->l;
}
-const int avail_regs[] = {8, 9, 10, 11, 12, 13, 14, 15, 24, 25};
+const int avail_regs[] = {8, 9, 10, 11, 12, 13, 14, 15, 16, 24, 25};
const int MAX_AVAIL_REGS = sizeof(avail_regs) / sizeof(avail_regs[0]);
void register_alloc(void) {
@@ -2383,7 +2383,9 @@ void cexpmap_destroy(CExpMap_t cem) {
void copr_shortcut(COpr_t *opr) {
COpr_t t = *opr;
if (!t) return;
- *opr = t->same;
+ t = t->same;
+ if (t->kind == TMP)
+ *opr = t->same;
}
void subexp_elimination(void) {
@@ -2510,7 +2512,7 @@ void ssa_func(CType_t func) {
renaming_vars(oprs);
/* optimization on SSA */
const_propagation();
-/* subexp_elimination(); */
+ subexp_elimination();
strength_reduction();
/* out of SSA */
mark_insts();