Add constraints for pat lab, as done in the m68020 table.

Always use 'kills ALL' when reaching a label, because our registers
and tokens have the wrong values if the program jumps to this label
from somewhere else.

When falling through a label, if the top element is in r3, then
require that the rest of the stack is in the real STACK, not in
registers or tokens.

I'm doing this to be certain that the missing constraints are not
causing bugs.  I did not find any such bug, perhaps because the labels
are usually near other instructions (like conditional branches and
function calls) that stack or kill tokens.
This commit is contained in:
George Koehler 2017-01-24 11:26:35 -05:00
parent bb67dbeb11
commit 188b23bade

View file

@ -1852,12 +1852,14 @@ PATTERNS
/* Other branching and labelling */ /* Other branching and labelling */
pat lab topeltsize($1)==4 && !fallthrough($1) pat lab topeltsize($1)==4 && !fallthrough($1)
kills ALL
gen gen
labeldef $1 labeldef $1
yields R3 yields R3
pat lab topeltsize($1)==4 && fallthrough($1) pat lab topeltsize($1)==4 && fallthrough($1)
with GPR3 with GPR3 STACK
kills ALL
gen gen
labeldef $1 labeldef $1
yields %1 yields %1