Re: liveness analysis with stack slots

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

 




On Jul 6, 2007, at 9:39 PM, Daniel Berlin wrote:

On 7/6/07, Maurizio Vitale <maurizio.vitale@xxxxxxxxxxxxxxxxxxxxxx> wrote:

On Jul 6, 2007, at 6:09 PM, Daniel Berlin wrote:

>> building of the expression. At least at the C++ source level
>> everything in there is dead.
>>
>
> Are you playing with global variables inside this code?
> If so, that is why it is not removed.
>
I'm not sure I understand what you mean. The objects that make my
expressions are either local (things like sc_int) or global (things
like left). So in something like meta_eval(left(_1), i4+i32,i32) used
as it was used in the code I've posted there would be global
"constants" like left and _1 which are grabbed by reference for
building expressions and local objects like i4 and i32.

Uh, because unless they are static, they may be referenced by other
modules we cannot see, so we cannot remove them.


Oh I see what you mean. Then no, this is not the issue. What is happening is something like this:

Tag1 tag1;
Tag2 tag2;

template<typename T, typename U>
struct plus {
const T& e0;
const U& e1;
};

f() {
 plus<Tag1,Tag2> p = {tag1,tag2};
}

I'm not asking for tag1 nor tag2 to be eliminated (nor their construction), What I'd like to see is the elimination of the construction of p (e.g. taking
two addresses and storing them in stack slots) when p is not used.

Now in a case like the above GCC eliminates dead expressions just fine. As I said I know now where the problematic code comes from and I'm trying to put together a simple example.

Thanks again,

		Maurizio



[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