Generating Assembly Files Using GCC

Ángel González
Wed Jan 8 23:18:00 GMT 2014

On 06/01/14 12:42, rajkrishna wrote:
> We are using powerpc-motorola-elf-as.exe to generate assembly file from a
> "*cpp*" file. If there is an if condition for eg *if(x==0)* , and when we
> generate the assembly code for the condition ,"*bne*" and "*beq*" are
> generated whereas only *beq *(branch equal) is the only code what we are
> expecting as per the source code. Is there are any gcc switches which can be
> used to customize the assembly code generation?
You should provide a bigger example. Make a toy program with the if, 
show the
original code, the generated assembly (only relevant lines needed, of 
and the expected one.

What optimization level (-O<n>) are you using? That's the most important 
changing the code generation (there are also switches to enable/disable 
optimizations, but -On works with groups of them). Please provide the 
you are using to generate the assembly.

More information about the Gcc-help mailing list