Abt RTL expression - Optimization

Rohit Arul Raj rohitarulraj@gmail.com
Fri Oct 27 05:02:00 GMT 2006


Hi all,

I am working with a GCC Cross compiler version 4.1.1.

This small bit of code worked fine with all optimization except Os.

unsigned int n = 30;
void x ()
{
 unsigned int h;
 h = n <= 30;           // Line 1
 if (h)
   p = 1;
 else
   p = 0;
}

when we tried to debug the emitted RTL instruction for Os, it was
found that RTL instruction for Line #1 (Compare and gtu) were not at
all emitted. i.e. there is no reference with respect to "h or n". For
the same optimization Os, if we declare the identifier "h" as global,
it generates the instructions properly.

I then took the dumps of all optimization passes of tree and RTL. All
the tree dumps were fine.

While checking the Dumps of RTL, the above mentioned code for "h, n"
was present in the file 20020611-1.c.25.cse2 but not in
20020611-1.c.26.life1.

1. Is the file 20020611-1.c.25.cse2  input to life1 optimization pass?

2. What does .life1 Life analysis pass do ?

3. What are the probable causes for the elimination of RTL code's
(Compare & gtu) between the above mentioned passes?

Thanking you in advance,
Rohit



More information about the Gcc mailing list