Commit dfac187e by Bernd Schmidt Committed by Bernd Schmidt

Fix register elimination problem

From-SVN: r30134
parent b8c3c4f0
Fri Oct 22 23:46:50 1999 Bernd Schmidt <bernds@cygnus.co.uk>
* genoutput.c (struct operand_data): New elt eliminable.
(output_operand_data): Write it.
(scan_operands): Set it for MATCH_OPERAND, clear for other matchers.
(compare_operands): Take it into account.
* recog.h (struct insn_operand_data): New elt eliminable.
* reload1.c (check_eliminable_occurrences, elimination_effects): New
functions.
(old_asm_operands_vec, new_asm_operands_vec): Delete.
(eliminate_regs): Move code that detects changes to elimination
target regs into new function elimination_effects.
Delete one #if 0 block.
Abort for USE, CLOBBER, ASM_OPERANDS and SET.
(eliminate_regs_in_insn): Return immediately for USEs, CLOBBERs,
ADDR_VECs, ADDR_DIFF_VECs and ASM_INPUTs.
Only call eliminate_regs for real operands of the insn, not for parts
of its structure or parts matched by things like match_operator.
Use elimination_effects and check_eliminable_occurrences. Use
copy_insn to duplicate the pattern when not in the final pass.
Fri Oct 22 09:03:44 1999 Mark Mitchell <mark@codesourcery.com>
* i386.md: Add missing `y' modifiers to uses of fst, fstp, fld,
......
......@@ -65,6 +65,10 @@ Boston, MA 02111-1307, USA. */
e. `strict_low', is nonzero for operands contained in a STRICT_LOW_PART.
f. `eliminable', is nonzero for operands that are matched normally by
MATCH_OPERAND; it is zero for operands that should not be changed during
register elimination such as MATCH_OPERATORs.
The code number of an insn is simply its position in the machine
description; code numbers are assigned sequentially to entries in
the description, starting with code number 0.
......@@ -128,6 +132,7 @@ struct operand_data
unsigned char n_alternatives;
char address_p;
char strict_low;
char eliminable;
char seen;
};
......@@ -287,7 +292,9 @@ output_operand_data ()
printf (" %smode,\n", GET_MODE_NAME (d->mode));
printf (" %d\n", d->strict_low);
printf (" %d,\n", d->strict_low);
printf (" %d\n", d->eliminable);
printf(" },\n");
}
......@@ -436,6 +443,7 @@ scan_operands (d, part, this_address_p, this_strict_low)
d->operand[opno].n_alternatives
= n_occurrences (',', XSTR (part, 2)) + 1;
d->operand[opno].address_p = this_address_p;
d->operand[opno].eliminable = 1;
return;
case MATCH_SCRATCH:
......@@ -460,6 +468,7 @@ scan_operands (d, part, this_address_p, this_strict_low)
d->operand[opno].n_alternatives
= n_occurrences (',', XSTR (part, 1)) + 1;
d->operand[opno].address_p = 0;
d->operand[opno].eliminable = 0;
return;
case MATCH_OPERATOR:
......@@ -482,6 +491,7 @@ scan_operands (d, part, this_address_p, this_strict_low)
d->operand[opno].predicate = XSTR (part, 1);
d->operand[opno].constraint = 0;
d->operand[opno].address_p = 0;
d->operand[opno].eliminable = 0;
for (i = 0; i < XVECLEN (part, 2); i++)
scan_operands (d, XVECEXP (part, 2, i), 0, 0);
return;
......@@ -553,6 +563,9 @@ compare_operands (d0, d1)
if (d0->strict_low != d1->strict_low)
return 0;
if (d0->eliminable != d1->eliminable)
return 0;
return 1;
}
......
......@@ -209,6 +209,8 @@ struct insn_operand_data
enum machine_mode mode;
char strict_low;
char eliminable;
};
/* Legal values for insn_data.output_format. Indicate what type of data
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment