Compile C++ code into assembly and then de-assemble
Does anyone know how convert C++ code to assembly code and then do the reverse?
The forward way is very easy:

    g++ -S

I want to analyze the output and see if it has been compiled correctly (Just for curiosity now, but it can have some applications). However, my knowledge of assembly is very limited and the output is hard to understand (This is especially true if I use optimizations (-O) or compile with debug info (-g) ).

Is there a de-assembler for C++ (GCC) to produce C++ code? If not, is there any intermediate representation that I can compile C++ code into and then back from it?

There seems to be some ways for converting C++ to C [here][1]. Does GCC have anything for this?


  [1]: http://stackoverflow.com/questions/5050349/is-there-a-way-to-compile-c-to-c-code
Compile C++ code into assembly and then de-assemble
===

Does anyone know how convert C++ code to assembly code and then do the reverse?
The forward way is very easy:

    g++ -S

I want to analyze the output and see if it has been compiled correctly (Just for curiosity now, but it can have some applications). However, my knowledge of assembly is very limited and the output is hard to understand (This is especially true if I use optimizations (-O) or compile with debug info (-g) ).

Is there a de-assembler for C++ (GCC) to produce C++ code? If not, is there any intermediate representation that I can compile C++ code into and then back from it?

There seems to be some ways for converting C++ to C [here][1]. Does GCC have anything for this?


  [1]: http://stackoverflow.com/questions/5050349/is-there-a-way-to-compile-c-to-c-code