commit b589b5bea208bd5be1fa724f5f7a2af6b65b2cae
parent 2faa69e787edb65a43a9d58c394adf27eb4dcbc8
Author: Roberto E. Vargas Caballero <Roberto E. Vargas Caballero>
Date: Sat, 23 Apr 2016 17:13:21 +0200
[cc2-qbe] Do not allocate space for labels
Labels are locals and they are not temporaries, so we need a specific
check for them
Diffstat:
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/cc2/arch/qbe/code.c b/cc2/arch/qbe/code.c
@@ -317,9 +317,10 @@ writeout(void)
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;