Help in GIMPLE to RTL transformation

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

 



Hi,

I am looking at some part of GCC source code which does the translation from GIMPLE to RTL. I created an example, having two consecutive instructions, one with "div" and other with "mod".

Example:
int a, b, c, d;
a = b / c;
d = b % c;

The first-cut RTL code corresponding to these two instructions is a PARALLEL INSN, with two SET INSNs, one with "div" and other with "mod".
(insn 22 21 23 1 (parallel [
            (set (reg:SI 70)
                (div:SI (reg:SI 72)
                    (mem/i:SI (plus:SI (reg/f:SI 54 virtual-stack-vars)
                            (const_int -8 [0xfffffff8])) [0 c+0 S4 A32])))
            (set (reg:SI 71)
                (mod:SI (reg:SI 72)
                    (mem/i:SI (plus:SI (reg/f:SI 54 virtual-stack-vars)
                            (const_int -8 [0xfffffff8])) [0 c+0 S4 A32])))
)

I am unable to understand how a single INSN gets generated for these two instructions. The GIMPLE code has two different tree nodes for the two instructions, namely "trunc_div_expr" and "trunc_mod_expr". So there should be two different INSNs. My guess is, some pass, like "combine", must be combining two INSNs into one. I looked at functions in file "combine.c", but no function in that file is called!

Can anybody suggest something? I am really stuck at this point And can't proceed any further.

Regards,

Amruta Gokhale
Graduate Student
IIT Bombay,
Mumbai.

[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