commit ce97999d1802923d4fe4507de5315b7819c6b312
Author:     Roberto E. Vargas Caballero <[email protected]>
AuthorDate: Sat Feb 4 22:01:03 2017 +0100
Commit:     Roberto E. Vargas Caballero <[email protected]>
CommitDate: Sat Feb 4 22:02:40 2017 +0100

    [cc1] Add fold case for !!
    
        !!(a || b)
    
    In this case we will have to ONEG together which can be folded.

diff --git a/cc1/fold.c b/cc1/fold.c
index 90a3445..c7df682 100644
--- a/cc1/fold.c
+++ b/cc1/fold.c
@@ -377,6 +377,10 @@ foldunary(Node *np, Node *l)
        Node *aux;
 
        switch (np->op) {
+       case ONEG:
+               if (l->op == ONEG && l->next->op == ONEG)
+                       break;
+               return NULL;
        case OADD:
                DBG("FOLD unary delete %d", np->op);
                np->left = NULL;

Reply via email to