Re: "human readable" optimized code

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

 



Diego Novillo wrote:
On Mon, Oct 13, 2008 at 14:25, Reza Roboubi <reza@xxxxxxxxxx> wrote:

Can we get a better view of what the optimizer is doing, such as some hint
of which data values represent which variables inside the original C-code?

Try using -fdump-tree-all in GCC versions starting with 4.0.

Here is a simple function, calling itself in 2 places.
----------------------------------
extern int xx();
extern float yy();
extern float zz();

inline
float mm(float i, int simple)
{
    float j;
    if(simple > 99) return zz(i);
    else {
        if(i<33) j= mm(yy((int) i), xx(20));
        else j=mm(yy((int) i), xx(11));
        return j/4.7;
    }
}
-----------------------------------------------

when we do
gcc -Wall -fdump-tree-all -Os -S test.c

test.s contains a single call to mm(), instead of two distinct calls (correctly optimized.)

However, none of the intermediate optimization steps (such as test.c.t93.optimized) reflects this optimization. Why?

Reza.

[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