This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: RTL help needed
Puneet Goyal <puneet_iitian@yahoo.com> writes:
> I am facing some problem in understanding rtl
> representation. Please help
Questions about gcc's IR, whether it be rtl, gimple, or what have you,
should be directed to gcc at gcc.gnu.org .
>
> Ques:
> What should i do to know which insn has plus or minus
> or... in it, and how to address the operands of
> operator like plus/minus/left shift/.......
>
>
> This is my program:
> int foo(int x, int y) {
> return x+y;
> }
> main() {
> int a=10;
> int b=1;
> int c=10;
> int e[4];
> a=a+10;
> e[0] = 5;
> int d=foo(a,b)+c;
> e[1] = 6;
>
> **********************************
> On analyzing its rtl representation and following its
> insn chain i.e.
> for (insn = get_insns (); insn; insn = NEXT_INSN
> (insn))
> {
> print insn id
> print defs(the web ids(DEFID)) and some related things
> print use (webid for corresponding use and see its
> register reference structure)
>
> }
>
> i printed following output:
> *******
> insn id=48 code=48 class=5
>
> *******
> insn id=5 code=43 class=7
>
> *******
> insn id=6 code=43 class=7
> DEFID=2 refid=2 regno==60 insnid=6code=72 class=8
>
> *******
> insn id=7 code=43 class=7
> DEFID=3 refid=4 regno==61 insnid=7code=72 class=8
> USE**=2 refid=1 regno==60 insnid=7code=72 class=8
>
> *******
> insn id=8 code=43 class=7
> DEFID=4 refid=6 regno==62 insnid=8code=72 class=8
> USE**=3 refid=2 regno==61 insnid=8code=72 class=8
>
> *******
> insn id=9 code=43 class=7
> DEFID=5 refid=8 regno==63 insnid=9code=72 class=8
> USE**=4 refid=3 regno==62 insnid=9code=72 class=8
>
> *******
> insn id=10 code=43 class=7
> DEFID=6 refid=9 regno==64 insnid=10code=72 class=8
> USE**=5 refid=4 regno==63 insnid=10code=72 class=8
>
> <blah blah blah>
>
>
> *******
> insn id=34 code=43 class=7
> USE**=10 refid=19 regno==72 insnid=34code=72 class=8
>
> *******
> insn id=35 code=45 class=7
> DEFID=21 refid=30 regno==15 insnid=35code=72 class=8
> DEFID=20 refid=29 regno==14 insnid=35code=72 class=8
> DEFID=19 refid=28 regno==13 insnid=35code=72 class=8
> DEFID=18 refid=27 regno==12 insnid=35code=72 class=8
> DEFID=17 refid=26 regno==11 insnid=35code=72 class=8
> DEFID=16 refid=25 regno==10 insnid=35code=72 class=8
> DEFID=15 refid=24 regno==9 insnid=35code=72 class=8
> DEFID=14 refid=23 regno==8 insnid=35code=72 class=8
> DEFID=13 refid=22 regno==2 insnid=35code=72 class=8
> DEFID=12 refid=21 regno==1 insnid=35code=72 class=8
> DEFID=11 refid=20 regno==0 insnid=35code=72 class=8
> DEFID=11 refid=19 regno==0 insnid=35code=72 class=8
>
> *******
> insn id=36 code=43 class=7
> DEFID=56 refid=66 regno==58 insnid=36code=72 class=8
> USE**=11 refid=22 regno==0 insnid=36code=72 class=8
>
>
> <blah blah blah>
> **************************************************
> **************************************************
> **************************************************
> **************************************************
> **************************************************
>
> What should i do to know which insn has plus or minus
> or... in it, and how to address the operands of
> operator like plus/minus/left shift/
>
> I am in need of this If you can please help please
> help.
> Please reply asap
>
> Dr. Puneet
> IIT DELHI
> INDIA
>
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail is new and improved - Check it out!
> http://promotions.yahoo.com/new_mail