This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] A patch for PR 25115



+ 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]