This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RTL insns set differences
- From: Umesh Kalappa <umesh dot kalappa0 at gmail dot com>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 30 Jan 2013 15:21:41 +0530
- Subject: RTL insns set differences
Dear Group,
Need a favour from you all ,Im very new to gcc framework such and
learning the same ,
I was looking at the RTL insns sets by dumping the c.144.exapnd dump
file before reload pass for the various target and I do see the
difference in the RTL insns set for two different targets for below
sample code
test.c
int func ()
{ int r =10;
int d =r ;
return r+d;
}
RTL Insns for Target -1(test.c.144.expand)
;; r_1 = 10;
(insn 5 4 6 (set (reg:SI 136)
(const_int 10 [0xa])) test7.c:3 -1
(nil))
(insn 6 5 0 (set (mem/c/i:SI (plus:SI (reg/f:SI 129 virtual-stack-vars)
(const_int -4 [0xfffffffffffffffc])) [0 r+0 S4 A32])
(reg:SI 136)) test7.c:3 -1
(nil))
;; d_2 = r_1;
(insn 7 6 8 (set (reg:SI 137)
(mem/c/i:SI (plus:SI (reg/f:SI 129 virtual-stack-vars)
(const_int -4 [0xfffffffffffffffc])) [0 r+0 S4 A32])) test7.c:4 -1
(nil))
(insn 8 7 0 (set (mem/c/i:SI (plus:SI (reg/f:SI 129 virtual-stack-vars)
(const_int -8 [0xfffffffffffffff8])) [0 d+0 S4 A32])
(reg:SI 137)) test7.c:4 -1
(nil))
;; D.1269_3 = r_1 + d_2;
(insn 9 8 10 (set (reg:SI 138)
(mem/c/i:SI (plus:SI (reg/f:SI 129 virtual-stack-vars)
(const_int -4 [0xfffffffffffffffc])) [0 r+0 S4 A32])) test7.c:5 -1
(nil))
(insn 10 9 11 (set (reg:SI 139)
(mem/c/i:SI (plus:SI (reg/f:SI 129 virtual-stack-vars)
(const_int -8 [0xfffffffffffffff8])) [0 d+0 S4 A32])) test7.c:5 -1
(nil))
(insn 11 10 0 (set (reg:SI 134 [ D.1269 ])
(plus:SI (reg:SI 138)
(reg:SI 139))) test7.c:5 -1
(nil))
;; return D.1269_3;
(insn 12 11 13 (set (reg:SI 135 [ <retval> ])
(reg:SI 134 [ D.1269 ])) test7.c:5 -1
(nil))
(jump_insn 13 12 14 (set (pc)
(label_ref 0)) test7.c:5 -1
(nil))
RTL insns for Target-2(test.c.144.expand)
;; r_1 = 20;
(insn 5 4 0 (set (mem/c/i:SI (reg/f:SI 17 virtual-stack-vars) [0 r+0 S4 A32])
(const_int 20 [0x14])) test.c:3 -1
(nil))
;; d_2 = r_1;
(insn 6 5 0 (set (mem/c/i:SI (plus:SI (reg/f:SI 17 virtual-stack-vars)
(const_int 4 [0x4])) [0 d+0 S4 A32])
(mem/c/i:SI (reg/f:SI 17 virtual-stack-vars) [0 r+0 S4 A32])) test.c:4 -1
(nil))
;; D.1199_3 = r_1 + d_2;
(insn 7 6 8 (set (reg:SI 24)
(mem/c/i:SI (reg/f:SI 17 virtual-stack-vars) [0 r+0 S4 A32])) test.c:5 -1
(nil))
(insn 8 7 9 (set (reg:SI 25)
(mem/c/i:SI (plus:SI (reg/f:SI 17 virtual-stack-vars)
(const_int 4 [0x4])) [0 d+0 S4 A32])) test.c:5 -1
(nil))
(insn 9 8 0 (set (reg:SI 22 [ D.1199 ])
(plus:SI (reg:SI 24)
(reg:SI 25))) test.c:5 -1
(nil))
;; return D.1199_3;
(insn 10 9 11 (set (reg:SI 23 [ <retval> ])
(reg:SI 22 [ D.1199 ])) test.c:5 -1
(nil))
(jump_insn 11 10 12 (set (pc)
(label_ref 0)) test.c:5 -1
(nil))
Have a some queries to the group ,like
First ,As per the gcc Gimple to RTL conversion ,the RTL insns set
should be same for the both target ...am i rite here ???...or do i
miss something here ???
Second,If @ first i'm wrong here ..i need to emit the RTL insns for
the target-2 as similiar to target-1..Please some one from the group
can guide me here to so same ????
Thanks in Advance
~Umesh