Code generation for condition of C branch statement

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

 



Hello all,

I would like to find some documentation and corresponding sources covering code generation for condition of branch statements.

In particular, I am interested in the patterns that control the usage of "reversed" conditions (with -O0 option specifed).

Example:
-----------------------------------
C source code:

               if (a != 0) { ... } else { ... }

and 2 different approaches to executable code generation:

               cmp   $0x0,-0x3(%rbp)
               jne     THEN
               ; else-branch
               ...
THEN :   ; then-branch
   
versus "reversed" condition:

               cmp   $0x0,-0x3(%rbp)
               je       ELSE
               ; then-branch
               ...
ELSE :   ; else-branch
-----------------------------------

Thanks in advance.
Leonid




[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