This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFA] A patch for PR 25115
- From: Paolo Bonzini <paolo dot bonzini at lu dot unisi dot ch>
- To: Ulrich Weigand <uweigand at de dot ibm dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 12 Dec 2005 13:09:10 +0100
- Subject: Re: [RFA] A patch for PR 25115
- References: <200512121114.jBCBEaLb014440@53v30g15.boeblingen.de.ibm.com>
+ if (!set)
+ {
+ rtx note = find_reg_equal_equiv_note (insn);
+ gcc_assert (note);
+ new_insn = gen_move_insn (reg, XEXP (note, 0));
+ new_insn = emit_insn_after (new_insn, insn);
+
+ /* Keep register set table up to date. */
+ record_one_set (regno, new_insn);
+ }
I don't understand how this is supposed to work in the general case.
The expression in the note may very well be of a form that *cannot*
be re-computed by a simple gen_move_insn -- there may not be any
single pattern that does the computation, or the pattern may require
additional CLOBBERs etc.
The note's argument is entered in the hash table only if
can_assign_to_reg_p returns true, and this checks whether it is a
general_operand tries to recognize the instruction if it is not a
general_operand (which covers most interesting cases, including
SYMBOL_REF expressions), or if a pattern exists that matches the insn.
In particular, clobbers of pseudos are taken care of in emit_move_insn_1
(which is called by gen_move_insn) when it expands a define_expand), and
clobbers of hard registers are excluded by can_assign_to_reg_p, because
it does
return ((icode = recog (PATTERN (test_insn), test_insn,
&num_clobbers)) >= 0
&& (num_clobbers == 0 || ! added_clobbers_hard_reg_p (icode)));
Paolo