This is the mail archive of the gcc-help@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]
Other format: [Raw text]

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


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