commit 68b2cfb72656cb84311084385d33bf4e82de462e
Author:     Roberto E. Vargas Caballero <Roberto E. Vargas Caballero>
AuthorDate: Fri Apr 22 23:56:48 2016 +0200
Commit:     Roberto E. Vargas Caballero <Roberto E. Vargas Caballero>
CommitDate: Sat Apr 23 00:33:49 2016 +0200

    [cc2-qbe] Add OADDR to QBE
    
    OADDR is a nop in QBE, but we still have to transform the node in a
    temporary node without creating a temporary symbol.

diff --git a/cc2/arch/qbe/cgen.c b/cc2/arch/qbe/cgen.c
index 74bfff3..5f2ff87 100644
--- a/cc2/arch/qbe/cgen.c
+++ b/cc2/arch/qbe/cgen.c
@@ -258,7 +258,6 @@ cgen(Node *np)
        case OBAND:
        case OBOR:
        case OBXOR:
-       case OCPL:
        case OEQ:
        case ONE:
                off = 0;
@@ -285,15 +284,18 @@ cgen(Node *np)
        case OELOOP:
                return NULL;
        case OCAST:
-               assert(r == NULL);
                return cast(np, l);
-       case OPAR:
-       case ONEG:
        case OADDR:
-               abort();
+               np->flags |= ISTMP;
+               np->op = OTMP;
+               np->u.sym = l->u.sym;
+               return np;
        case OPTR:
                np->left = load(load(l));
                return tmpnode(np);
+       case OCPL:
+       case OPAR:
+       case ONEG:
        case OINC:
        case ODEC:
                abort();

Reply via email to