summaryrefslogtreecommitdiff
path: root/src/cmd/5c/txt.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/5c/txt.c')
-rw-r--r--src/cmd/5c/txt.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/cmd/5c/txt.c b/src/cmd/5c/txt.c
index 1a189e3af..b8675fe60 100644
--- a/src/cmd/5c/txt.c
+++ b/src/cmd/5c/txt.c
@@ -1176,17 +1176,15 @@ patch(Prog *op, int32 pc)
void
gpseudo(int a, Sym *s, Node *n)
{
-
nextpc();
p->as = a;
p->from.type = D_OREG;
p->from.sym = s;
p->from.name = D_EXTERN;
- if(a == ATEXT) {
+ if(a == ATEXT || a == AGLOBL) {
p->reg = textflag;
textflag = 0;
- } else if(a == AGLOBL)
- p->reg = 0;
+ }
if(s->class == CSTATIC)
p->from.name = D_STATIC;
naddr(n, &p->to);
@@ -1194,6 +1192,18 @@ gpseudo(int a, Sym *s, Node *n)
pc--;
}
+void
+gprefetch(Node *n)
+{
+ Node n1;
+
+ regalloc(&n1, n, Z);
+ gmove(n, &n1);
+ n1.op = OINDREG;
+ gins(APLD, &n1, Z);
+ regfree(&n1);
+}
+
int
sconst(Node *n)
{