shithub: scc

Download patch

ref: 999193996c042e7cf8f43e7b9512e131cf93b7c5
parent: fe2a918f1ec286a8d360d77643f1aae3e83a6848
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Sat Feb 4 17:01:03 EST 2017

[cc1] Add fold case for !!

	!!(a || b)

In this case we will have to ONEG together which can be folded.

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