This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Question regarding the values of labels
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