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.
Can you explain some more 'that is why it is not removed'? You might
be on the right track for why the initiailzation of local objects is
not removed, and elaborating some more might enlighten me.
For the other part, I know now where the code GCC doesn't remove
comes from: it is the creation of a dynamic evaluation context that
is used when values are not known at compile time (which brings in
two expressions to provide values for _1 and _2). I've been able to
insulate that part further with template layers so that
in some cases the code generated is ok. But those expressions are
very dead and would be nice to understand why both GCC and the Intel
compiler think otherwise.
I'm still working on a reduced example that still shows what I'm
observing.
Thanks a lot,
Maurizio