Re: Comments in assember output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fabian Cenedese writes:
 > At 12:02 30.11.2006 -0500, Tony Wetmore wrote:
 > >Artur,
 > >
 > >I just tried playing around with this, and it appears the the "-S" flag is interfering.  Perhaps by stopping the compilation process in that way, it prevents the generation of the "listing file".
 > >
 > >I tried compiling your example function as follows:
 > >
 > >  gcc -c -g -O3 -Wa,-adhls=func.list func.c
 > >
 > >And got the following output (in func.list):
 > >
 > >   1                            .file   "func.c"
 > >   4                            .text
 > >   5                    Ltext0:
 > >  28                            .p2align 4,,15
 > >  32                    .globl _func
 > >  34                    _func:
 > >   1:func.c        **** float func( float a, float b )
 > >   2:func.c        **** {
 > >  36                    LM1:
 > >  37 0000 55                    pushl   %ebp
 > >  38 0001 89E5                  movl    %esp, %ebp
 > >  40                    LM2:
 > >  41 0003 D9450C                flds    12(%ebp)
 > >   3:func.c        ****   return a * b;
 > >  43                    LM3:
 > >  44 0006 D84D08                fmuls   8(%ebp)
 > >   4:func.c        **** }
 > >  46                    LM4:
 > >  47 0009 5D                    popl    %ebp
 > >  48 000a C3                    ret
 > >  50                    Lscope0:
 > >  52                            .text
 > >  54 000b 90909090      Letext:
 > >  54      90
 > >
 > >This appears to be the sort of output you are looking for, right?
 > 
 > That sounds usefull, I could use that as well. But when I tried it
 > it didn't mix the lines, I just got (almost) all lines from the cpp
 > source file and after that the assembler code. There are several
 > functions in the cpp file, so at least those should be separatable
 > in the assembler code. I compiled without optimization so the
 > functions should not be intermingled. I tried the various -a flags
 > but it didn't work so far.

That's the way that gcc works.  The optimizers rearrange the functions
and output them in dependency order.  "-fno-unit-at-a-time" might
help.

Andrew.


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux