This is the mail archive of the gcc@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: List-Files with GNU


On Oct 18, 2004 11:21 AM, Kukuk Barbara <barbara.kukuk@siemens.com> wrote:

> Hi,
> 
> I'd like to generate a file from a C source file where you
> can find the C code and the corresponding assembler statements.
> Is this possible with GNU?

I donÂt think you can.

But even if you could, it would never be a very reliable dump if
you compile with optimizations enabled, because the optimizers are
free to completely reorder the code, hence the resulting assembly
may not even remotely resemble the original C source. Instructions
generated for one line of C may be scattered over several lines of
assembly output, intermixed with instructions for other statements
in your C source.

Ah, the fun of looking at assembly after scheduling and block
reordering!  Been there, done that, no T-shirt.  

With some effort, you may be able to match the line numbers of the
original C source with the assembly output, if you can read DWARF
and ELF :-)

Gr.
Steven



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