------- Comment #15 from jakub at gcc dot gnu dot org 2009-02-09 12:54 ------- And, even if decl_ultimate_origin checking is weakened and it actually looks for ultimate origin for RESULT_DECLs, I'm not sure the generated debug info is correct. The problem is that the tree NRV optimization is an optimization in the current function only, it shouldn't affect inlined copies of that function. When foo is inlined into bar, in bar there is some VAR_DECL with abstract origin in foo's RESULT_DECL. In foo, if tree NRV kicks in, RESULT_DECL has abstract origin some VAR_DECL. But that was a result of a local optimization of foo, it doesn't mean that the VAR_DECL in bar with foo's RESULT_DECL as abstract origin should have that other var in foo as origin. Perhaps we'd need to emit a virtual foo's info and then emit real out-of-line foo as "inlined instance" of that virtual foo or something to get proper debug info.
-- jakub at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jason at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39086