On Fri, Jan 12, 2018 at 09:53:28AM +0100, Richard Biener wrote: > This fixes PR83157 (well, not the guality fail...) and avoids creating > references to abstract instances that actually end up refering to > the concrete instance thereby eventually picking up invalid location > attributes (and whatever else there may be). > > As said in the PR a simple testcase > > int foo (int i) > { > volatile int boring = 1; > return boring + i; > } > > int bar() > { > int tem = 1; > return tem + foo (0); > }
I'm worried that we call dwarf2out_function_decl multiple times for the same instance of the function and that undoing it means we won't find the DIEs we've created before and we'll create them once again. Isn't that the case of e.g. non-LTO early vs. late dwarf? Jakub