shithub: scc

Download patch

ref: 2d8f37202486a2322c4aa194e48facb531e1ffab
parent: eda67a00f4481efdf3c361b2f9cc7925aedfc41f
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Fri Jun 3 08:54:37 EDT 2016

[cc2-qbe] Allocate stack space only for automatic variables

We have different local variables, but we only have to allocate
space for automatic variables.

--- a/cc2/arch/qbe/code.c
+++ b/cc2/arch/qbe/code.c
@@ -330,7 +330,7 @@
 
 	/* allocate stack space for local variables) */
 	for ( ; p && p->id != TMPSYM; p = p->next) {
-		if (p->kind && p->kind != SLABEL)
+		if (p->kind == SAUTO)
 			alloc(p);
 	}
 	/* store formal parameters in parameters */