[hackers] [scc/qbe] [cc2-qbe] Fix OCONST in rhs() || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Wed, 17 Aug 2016 17:55:49 +0200 (CEST)

commit b675c815310c00aa864eba2628485e4992ea2831
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Wed Aug 17 17:47:48 2016 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Wed Aug 17 17:47:48 2016 +0200

    [cc2-qbe] Fix OCONST in rhs()
    
    When we have a constant we do not have to move it to a temporary,
    and of course we do not have to load from it.

diff --git a/cc2/arch/qbe/cgen.c b/cc2/arch/qbe/cgen.c
index 681e09b..6438396 100644
--- a/cc2/arch/qbe/cgen.c
+++ b/cc2/arch/qbe/cgen.c
_AT_@ -422,6 +422,8 @@ rhs(Node *np, Node *ret)
         case OEFUN:
                 return NULL;
         case OCONST:
+ *ret = *np;
+ return np;
         case OMEM:
         case OAUTO:
                 return load(np, ret);
Received on Wed Aug 17 2016 - 17:55:49 CEST

This archive was generated by hypermail 2.3.0 : Wed Aug 17 2016 - 18:00:28 CEST