shithub: scc

Download patch

ref: 1220f2d67439a31cff760ae7d97818a8f84fec87
parent: 020554b30192131ab687d5bfb6b89b3518173085
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Fri Mar 13 05:39:33 EDT 2015

Improve optcasts

Copy type only when it is needed, not always (for example when
they are the same)

--- a/cc2/optm.c
+++ b/cc2/optm.c
@@ -27,7 +27,9 @@
 		tp = &np->type;
 		break;
 	default:
-		np->type = *tp;
+		if (np->type.size > tp->size)
+			np->type = *tp;
+		break;
 	}
 
 	np->left = optcasts(np->left, tp);