public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jamie Prescott <jpresss@yahoo.com>
To: Ian Lance Taylor <iant@google.com>
Cc: gcc@gcc.gnu.org
Subject: Re: nops
Date: Thu, 21 May 2009 15:47:00 -0000	[thread overview]
Message-ID: <633817.47788.qm@web111611.mail.gq1.yahoo.com> (raw)
In-Reply-To: <m3zld7xdn9.fsf@google.com>


----- Original Message ----

> From: Ian Lance Taylor <iant@google.com>
> To: Jamie Prescott <jpresss@yahoo.com>
> Cc: gcc@gcc.gnu.org
> Sent: Wednesday, May 20, 2009 9:50:50 PM
> Subject: Re: nops
> 
> Jamie Prescott writes:
> 
> > Under which conditions GCC generates nops?
> 
> It depends entirely on the target.  For many targets, gcc will never
> generate a nop instruction, except as a byproduct of alignment.

My target does not have anything special WRT alignment. I even set the function
alignment to 8, and it still issues gen_nop().
This seem to happen only with -O0, or at least I noticed it only under such condition
so far.


> > I noticed that with 4.4.0, gen_nop() is required, thing that wasn't with 
> 4.3.3.
> > Can I just define an empty insn for nop, of GCC requires a one-byte insn for 
> its
> > own alignment purposes?
> 
> Normally gcc does alignment by issuing an assembler directive, and the
> assembler is responsible for generating nop instructions when necessary.

Did a quick grep and the one you mention (ASM_OUTPUT_ALIGN_WITH_NOP) is
not defined in my backend. And such directive does not even have a default.
So, in theory, I should not see any nops.
The problem is different. The error is at link-time, if gen_nop() is not defined, so it
means that the insn is generated programmatically.
Grepping the source, I noticed a few files that issue gen_nop() directly, thing that
was not happening with 4.3.3.
So my questions are. Is there a way to disable it? If not, can I define an empty-issue
instruction for 'nop'?


- Jamie


      

  reply	other threads:[~2009-05-21 15:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-21  4:52 nops Jamie Prescott
2009-05-21  9:16 ` nops Ian Lance Taylor
2009-05-21 15:47   ` Jamie Prescott [this message]
2009-05-21 16:12     ` nops Andrew Pinski
2009-05-21 17:29       ` nops Jamie Prescott

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=633817.47788.qm@web111611.mail.gq1.yahoo.com \
    --to=jpresss@yahoo.com \
    --cc=gcc@gcc.gnu.org \
    --cc=iant@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).