Fix reglap for procedures that use both sizes of reg_float.
authorGeorge Koehler <xkernigh@netscape.net>
Sun, 15 Oct 2017 17:15:03 +0000 (13:15 -0400)
committerGeorge Koehler <xkernigh@netscape.net>
Sun, 15 Oct 2017 17:15:03 +0000 (13:15 -0400)
commitaa876ff4c20c8c30173057cd05ab8dc210dc1894
tree2e159a4d0006f1739a68063068ee36a76a8bfc81
parentb342b83d28a086526136bae10d52f52c0c3de826
Fix reglap for procedures that use both sizes of reg_float.

After the RA phase of ego, a procedure may put single-word and
double-word values in the same reg_float.  Then ncg will use both
LOCAL and DLOCAL tokens at the same offset.

I add isregvar_size() to ncg.  It receives the size of the LOCAL or
DLOCAL token, and picks the register of the correct size.  This fixes
a problem where ncg got the wrong-size register and corrupted the
stack.  This problem caused one of my test programs to segfault from
stack underflow.

Also adjust how fixregvars() handles both sizes.
mach/proto/ncg/regvar.c
mach/proto/ncg/regvar.h
mach/proto/ncg/subr.c