Remove the "invalid" stacking rule.

When ncg fell back on this rule, it did emit the string "invalid" in
the assembly code and caused a syntax error in the assembler.

Adjust the stacking rules so we can stack LOCAL, CONST, and LABEL
without falling back on the "invalid" rule, and so we can stack them
when we have no free register except the scratch register.
This commit is contained in:
George Koehler 2016-09-27 16:46:11 -04:00
parent 865ef629dd
commit 1e3dde915a

View file

@ -233,7 +233,6 @@ TOKENS
SETS
TOKEN = LABEL + CONST + LOCAL.
GPRI = GPR + GPRE.
SUM_ALL = SUM_RC + SUM_RR.
@ -349,7 +348,6 @@ INSTRUCTIONS
gpr_wo_gprindirect GPRI:wo, GPRINDIRECT:ro.
gpr_wo_gpr_gpr GPRI:wo, GPRI:ro, GPRI:ro.
invalid "invalid".
comment "!" LABEL+LABELI:ro.
@ -754,24 +752,27 @@ TESTS
STACKINGRULES
from LOCAL to STACK
gen
COMMENT("stack LOCAL")
stwu {GPRE, regvar(%1.off)}, {GPRINDIRECT, SP, 0-4}
from GPR to STACK
gen
COMMENT("stack GPR")
stwu %1, {GPRINDIRECT, SP, 0-4}
from CONST to STACK
uses REG
gen
COMMENT("stack CONST")
move %1, %a
stwu %a, {GPRINDIRECT, SP, 0-4}
move %1, SCRATCH
stwu SCRATCH, {GPRINDIRECT, SP, 0-4}
from LABEL to STACK
uses REG
gen
COMMENT("stack LABEL")
move %1, {GPRE, %a}
stwu %a, {GPRINDIRECT, SP, 0-4}
move %1, SCRATCH
stwu SCRATCH, {GPRINDIRECT, SP, 0-4}
from SEX_B to STACK
gen
@ -810,10 +811,6 @@ STACKINGRULES
COMMENT("stack FSREG")
stfsu %1, {GPRINDIRECT, SP, 0-4}
from TOKEN to STACK
gen
invalid.
COERCIONS