Hello,

it it possible to get a kind of diagnostics if the variable
is totally optimized away?  For example, in:

void foo (struct some_type *obj) {
  ... some code where 'obj' is not used ...
  bar (obj->some_member);
  ... some code where 'obj' is not used again ...
  baz (obj->some_member);
}

'obj' is likely to be optimized away so only 'obj->some_member' really
exists (in a register or stack location).  Getting diagnostics
or preserving 'obj' may be important if there is a GC which scans
C stack and registers conservatively - if there is no direct reference
to 'obj', it's likely to be reclaimed and so 'obj->some_member'
becomes garbage.

Dmitry

Reply via email to