Hi,

On Thu, 8 Nov 2007, Alexandre Oliva wrote:

> > If you want to be really sure no arguments disappear (necessary for 
> > instance for meaningful use of systemtap) you also need to inhibit 
> > some transformations,
> 
> I'm not aware of any situations in which we must force an argument not 
> to disappear.  All of the problems I'm aware of are those in which the 
> argument is there, we're just missing debug information for it.  If you 
> have information about needs for preserving arguments that are actually 
> dead, please send it my way.

------------------------------------
static inline int foo(int i)
{
  return i-1;
}

int foobar(int j)
{
  return foo(j+2);
}

int main(int argc, char **argv)
{
  return foobar(argc);
}
------------------------------------

And similar examples.  Depending on circumstances the formal argument 'i' 
of "foo" might be optimized away.  If you want to use systemtap to show 
the actual arguments for all calls to foo, even the inlined ones, then you 
somehow have to make sure that the value of 'i' itself is not optimized 
away.  Again, in this specific case, due to the simplicity of the involved 
expression, it would theoretically be possible to express this with just 
DWARF expressions (relating to the formal argument 'j' of foobar).  In 
more complicated situtation that's not possible anymore, at which point 
you have to force the value of 'i' being live, if you want to be sure that 
systemtap works in all cases.

> > during the next months, i.e. improve code quality at -O0 at least to a 
> > point it was in the 3.x line of GCC.
> 
> Aah, I guess the problem here is all the gimple-introduced temps,
> right?  That our current -O0 is more like -O-1? :-)

Indeed :)  Perhaps also doing a simple DCE and local regalloc, none of 
which inhibits debugging.


Ciao,
Michael.

Reply via email to