shithub: scc

Download patch

ref: 91b6945dbc23941cf41afcd59e02fe2eafaee132
parent: 85ebcbcd9fe786761fb9c16e01a015376b14ad5f
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Sat Apr 23 13:13:21 EDT 2016

[cc2-qbe] Do not allocate space for labels

Labels are locals and they are not temporaries, so we need a specific
check for them

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