shithub: scc

Download patch

ref: fc8f4fd0225d1806fe8e25d8ce847ca1abc219d1
parent: eabc4e5d3aaad045c424770eeb56104e18dbf9c8
author: Roberto E. Vargas Caballero <[email protected]>
date: Fri Apr 15 10:48:03 EDT 2016

[cc2-qbe] Do not emit local temporary variables

They do not need to be allocated.

--- a/cc2/arch/qbe/code.c
+++ b/cc2/arch/qbe/code.c
@@ -201,7 +201,7 @@
 
 	puts(")\n{");
 
-	for ( ; p; p = p->next) {
+	for ( ; p && p->id != TMPSYM; p = p->next) {
 		tp = &p->type;
 		printf("\t%s %s= alloc%lld %lld\n",
 		       symname(p), size2asm(tp),