shithub: scc

Download patch

ref: c183aab9883ecbf6caaa473a1c54648257f4954c
parent: 2ba16ff549dccdaf9a6c915f3f9219410b9d5e3e
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Thu Jul 13 14:55:41 EDT 2017

[cc1] Don't try to simplify an assignation

How can you simplify an assignation?

--- a/cc1/fold.c
+++ b/cc1/fold.c
@@ -656,6 +656,17 @@
 	case OCALL:
 	case OPAR:
 	case OSYM:
+	case OASSIGN:
+	case OA_MUL:
+	case OA_DIV:
+	case OA_MOD:
+	case OA_ADD:
+	case OA_SUB:
+	case OA_SHL:
+	case OA_SHR:
+	case OA_AND:
+	case OA_XOR:
+	case OA_OR:
 		return np;
 	case OSNEG:
 	case OCPL:
@@ -663,9 +674,6 @@
 	case OPTR:
 	case INC:
 	case DEC:
-	case OASSIGN:
-	case OA_ADD:
-	case OA_SUB:
 	case OCAST:
 	case ONEG:
 		assert(!r);