On Fri, Mar 4, 2011 at 2:56 PM, Richard Sandiford <richard.sandif...@linaro.org> wrote: > Suppose we have a function F that is inlined several times. Suppose too > that F has a local variable X, and that no "real" (as opposed to debug) > references to X remain after pre-inlining optimisations. In this case, > we will add X to BLOCK_NONLOCALIZED_VARS rather than duplicate it each > time F is inlined. Location notes for each inlining of F will then > refer to the same non-localised X decl. This in turn means that each > inlining of F has the same location list for X, with the list specifying > the location of X for all inlinings of F. > > Jakub confirms that this indeed the intended behaviour, and I haven't > seen any problem with the output.
Hm, but isn't it incorrect debug info? I would have expected this non-localized var to be the abstract origin of a copy for location list purposes. Well, for static inline int foo (int p) { int q = p; return q; } int bar1 (int i) { return foo (i); } int bar2 (int j) { return foo (j); } I don't even see location lists for q, but maybe I'm blind ;) Richard.