public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ian Lance Taylor <iant@google.com>
To: "PRC" <panruochen@gmail.com>
Cc: "gcc-help" <gcc-help@gcc.gnu.org>
Subject: Re: Why does gcc produce an unnecessary `nop' instruction?
Date: Sat, 26 Jan 2008 04:48:00 -0000	[thread overview]
Message-ID: <m3ve5i53vx.fsf@localhost.localdomain> (raw)
In-Reply-To: <200801251719424202892@gmail.com>

"PRC" <panruochen@gmail.com> writes:

> >It's probably caused by requested alignment of the next function.
> >Note that nop is just the value 0.
> >
> >To see whether gcc is actually generating the nop, use the
> >--save-temps option when you compile, and look at the .s file.  If you
> >don't see the nop there, it's coming from something other than gcc.
> 
> I look at the `objdump'ed assembly file again and I find that all functions
> start at the address which is 8-byte aligned. 
> Is there a particular good reason for 8-byte alignment, even if the target ARCH
> is 32-bit rather than 64-bit and aligment is quite a little waste of storage and 
> runtime memory?

Assuming you haven't used the -falign-functions option, then they are
probably being aligned so that they start on cache line boundaries.  I
don't see any code in the ARC backend to do this, so I'm not sure
where it is coming from.

Ian

  parent reply	other threads:[~2008-01-25 15:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-25 19:41 PRC
2008-01-25 22:55 ` Ian Lance Taylor
2008-01-25 22:55   ` PRC
2008-01-26  2:33     ` John Love-Jensen
2008-01-26  4:48     ` Ian Lance Taylor [this message]
2008-01-28  3:12   ` Darryl Miles
2008-01-28 12:12     ` Ian Lance Taylor

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=m3ve5i53vx.fsf@localhost.localdomain \
    --to=iant@google.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=panruochen@gmail.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).