public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ian Lance Taylor <iant@google.com>
To: Matthew Plant <rookie.mp@gmail.com>
Cc: gcc-help@gcc.gnu.org
Subject: Re: Question regarding the values of labels
Date: Wed, 02 Nov 2011 00:56:00 -0000	[thread overview]
Message-ID: <mcrty6nny0e.fsf@dhcp-172-18-216-180.mtv.corp.google.com> (raw)
In-Reply-To: <CAOyYdLcnsSCqGznXuoMNZuPwy-U0WXdQ=y8iTnJShQG4Ma_6ag@mail.gmail.com>	(Matthew Plant's message of "Tue, 1 Nov 2011 16:52:17 -0700")

Matthew Plant <rookie.mp@gmail.com> writes:

> So my final question is this: what determines the addresses of labels?
> Can this problem be fixed with at least semi-readable code?

Speaking very roughly, gcc separates the code into basic blocks and
builds a control flow graph.  The blocks in the control flow graph are
sorted based on the predicted results of branches.  The blocks are then
output in the order.

Nothing like what you want to do is possible with gcc.  You are assuming
that there is a natural correspondence between your source code and
gcc's internal representation; that is a natural thing assumption, but
in actual fact no such correspondence exists.

Ian

  parent reply	other threads:[~2011-11-02  0:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-01 23:52 Matthew Plant
2011-11-02  0:56 ` Ian Lance Taylor
2011-11-02  0:56 ` Ian Lance Taylor [this message]
2011-11-02 10:04 ` Andrew Haley

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=mcrty6nny0e.fsf@dhcp-172-18-216-180.mtv.corp.google.com \
    --to=iant@google.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=rookie.mp@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).