Hello All,

I  am trying to understand rtl generation. For the following testcase
I have dumped the rtl... (version: gcc-4.3.3, target: AVR32  not
upstreamed yet)

int main() {
        volatile int a, b;
        if(a>b) return 1;
        else return 2;

}

Expand  pass shows that "le"operator  is chosen.

(jump_insn 9 8 10 3 gt_int.c:4 (set (pc)
        (if_then_else (le:CC (cc0)
                (const_int 0 [0x0]))
            (label_ref 14)
            (pc))) -1 (nil))


If I modify the same testcase to use 'float' datatype instead of
'int', "gt" operator is picked up.

(jump_insn 9 8 34 3 gt.c:4 (set (pc)
        (if_then_else (gt:CC (cc0)
                (const_int 0 [0x0]))
            (label_ref 12)
            (pc))) -1 (nil))


I would like to know what prompts gcc to decide if "le" can be used in
the expand pass rather than "gt" operator. Or more precisely why it
differs incase of float.

I am not sure how much of this is target dependent, but the port being
used is for avr32 which is not upstream yet.  It will be great if I
can get some pointers on the above.


Regards
Anitha

Reply via email to