This is the mail archive of the 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: TMSC320C6x port: return label is being deleted


Graham Stott wrote:

You only need a label to appear in the generated .s file so your call
pattern can take care of making one up when the time comes to output your
call fragment.


can I somehow attach the label to the call insn, so that the output function can get the label number and print it?
I tried:
insn = gen_rtx_CALL (VOIDmode, mem, const0_rtx);
REG_NOTES (insn) = gen_rtx_INSN_LIST (REG_LABEL, ret_label, REG_NOTES(insn));

which results in RTL:
(insn 17 15 18 2 (set (mem:SI (pre_dec:SI (reg/f:SI 47 b15)) [0 S4 A32])
       (label_ref:SI 19)) -1 (nil)
   (insn_list:REG_LABEL 19 (nil)))

(call_insn 18 17 19 2 (call (mem:QI (symbol_ref:SI ("nop") [flags 0x3] <function_decl 0x401d45e4 nop>) [0 S1 A8])
(const_int 0 [0x0])) -1 (nil)
(expr_list:REG_EH_REGION (const_int 0 [0x0])

(code_label 19 18 34 3 5 "" [1 uses])

It seems I have to emit the label to get the REFs right.
However, I miss the the "REG_LABEL  19" in the insn list of the call insn.

Another approach would be to walk the dependency list at the time of output, but I'd rather prefer the first one.


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