shithub: scc

Download patch

ref: 3332d6ca81b8731a34a70671a2b37aa05a193935
parent: b00dde9f13a5a2754d65bbb6ea6f2cca7123e491
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Wed Aug 17 13:47:48 EDT 2016

[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.

--- a/cc2/arch/qbe/cgen.c
+++ b/cc2/arch/qbe/cgen.c
@@ -422,6 +422,8 @@
 	case OEFUN:
 		return NULL;
 	case OCONST:
+		*ret = *np;
+		return np;
 	case OMEM:
 	case OAUTO:
 		return load(np, ret);