This is the mail archive of the gcc@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: Calling gen_nop.


  In message <200004061525.QAA16250@cam-mail2.cambridge.arm.com>you write:
  > The code in question is in compile_file() and reads:
  > 
  >   if (profile_flag || profile_block_flag)
  >     {
  >       /* It's best if we can write a nop here since some
  >          assemblers don't tolerate zeros in the text section.  */
  >       output_asm_insn (get_insn_template (CODE_FOR_nop, NULL), NULL_PTR);
  >     }
  > 
  > Is it safe to call gen_nop() here to create a real insn?  If so, what, if 
  > anything, will I need to reset after emitting the insn?  Is there a better 
  > way of solving this?
Ugh.  Gross. 

Anyway, you can probably deal with this with something like

(define_insn "nop"
  [(clobber (const_int 0))]
  ""
  "*
{
  if (TARGET_ARM)
    return "mov%?\\t%|r0, %|r0\\t%@ nop";
  else
    return "mov\\tr8, r8";
})

I'd consider it a band-aid since we'd really like a better way to deal with
this problem.

jeff


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