shithub: scc

Download patch

ref: 9f098e0ead1a6be8a47dae73713a61f66da84013
parent: a4c6501c1838127d508608bf11f5d2b5013723ac
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Sun Jun 11 05:54:41 EDT 2017

[cc1] Add comment about possible error in foldunary()

folding cast operator can generate wrong code

--- a/cc1/fold.c
+++ b/cc1/fold.c
@@ -389,6 +389,7 @@
 	case OCAST:
 		if (op != OCAST)
 			return foldcast(np, l);
+		/* TODO: This is wrong: (float)(int) 7.2 */
 		DBG("FOLD unary collapse %d", np->op);
 		np->left = l->left;
 		l->left = NULL;