GCC option to get assembly code AND C code

This is a discussion on GCC option to get assembly code AND C code within the C Programming forums, part of the General Programming Boards category; Hello, I am working on a C project. I would like to see the assembly code generate with GCC. The ...

  1. #1
    Registered User
    Join Date
    Apr 2010
    Location
    France
    Posts
    1

    GCC option to get assembly code AND C code

    Hello,
    I am working on a C project.
    I would like to see the assembly code generate with GCC.

    The option is "-S". But when I do so, I get a long file with assembly instructions code, really difficult to read.

    What is the option to get both the assembly code AND the corresponding C code, in the same file, to see what C instruction generate assembly code instructions.

    Thx
    Antoine

  2. #2

  3. #3
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,235
    The --fverbose-asm options to gcc is also helpful.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

Popular pages Recent additions subscribe to a feed

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21