[hackers] [scc] [cc2-qbe] Do not allocate space for labels || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Sun, 24 Apr 2016 17:29:37 +0200 (CEST)

commit b589b5bea208bd5be1fa724f5f7a2af6b65b2cae
Author: Roberto E. Vargas Caballero <Roberto E. Vargas Caballero>
AuthorDate: Sat Apr 23 17:13:21 2016 +0200
Commit: Roberto E. Vargas Caballero <Roberto E. Vargas Caballero>
CommitDate: Sat Apr 23 17:13:21 2016 +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

diff --git a/cc2/arch/qbe/code.c b/cc2/arch/qbe/code.c
index c26723b..41ea806 100644
--- a/cc2/arch/qbe/code.c
+++ b/cc2/arch/qbe/code.c
_AT_@ -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;
Received on Sun Apr 24 2016 - 17:29:37 CEST

This archive was generated by hypermail 2.3.0 : Sun Apr 24 2016 - 17:36:16 CEST