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]

Re: Clear out /s field when deleting label


On Mon, May 29, 2000 at 08:51:07AM +0900, NIIBE Yutaka wrote:
> Before using code_label, I've taken the approach like above.  It almost
> works.  However, when expand_inline_function is used with that constucts, 
> it results duplicated labels (say, .LPLT45 is emitted twice or more).
> 
> So, I thought that we need some constructs which is generated on copy_rtx.
> 
> Is there any rather than code_label?  Or another approach?

The easiest solution is to delay associating magic number with the call
before inlining.  The easiest way to do this is to use a splitter.  At
minimum the insn will be split by shorten_branches, just before we 
construct literal tables in sh.c:machine_dependent_reorg.

Perhaps something like

(define_insn_and_split ""
  [(call (mem:QI (match_operand:SI 1 "symbol_ref_operand" ""))
	 (match_operand 2 "" ""))
   (use (reg:SI 48))
   (clobber (reg:SI 17))
   (clobber (match_scratch:SI 0 "=r"))]
  ""
  ;; This must have been split before literal table layout.
  "* abort ();"
  "! no_new_pseudos || reload_completed"
  [(parallel [(call (mem:QI (match_dup 0))
		    (match_dup 2))
	      (use (reg:SI 48))
	      (clobber (reg:SI 17))
	      (use (match_dup 3))])]
  "
{
  extern int sh_pic_call_counter;
  if (! no_new_pseudos)
    operands[0] = gen_reg_rtx (SImode);
  operands[3] = GEN_INT (++sh_pic_call_counter);
  emit_insn (gen_movsi (operands[0], operands[1]));
}")



r~

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