When LTO inlines functions compiled with -g into functions compiled
-gmlt, certain assumptions don't hold any more.
Fixes PR31437.
Differential D29310
Fix DwarfDebug assertions with LTO mixing -g and -gmlt probinson on Jan 30 2017, 3:23 PM. Authored by
Details When LTO inlines functions compiled with -g into functions compiled Fixes PR31437.
Diff Detail
Event TimelineComment Actions Given the complexity of the test cases, this might be easier as two separate reviews. The test cases should be simplified a fair bit further, I think - especially removing user defined types should be helpful in reducing the amount of debug info metadata and possibly making things clearer. (also, in the second test it mentions the possibility of removing the (non-inlined) definition of 'foo' - mark 'foo' as inline in the source and this should happen automatically. If possible, use attribute((always_inline)) to ensure the test case is fairly optimization independent, but I guess since it needs to optimize away the parameter alloca it won't be doable at -O0 anyway, so maybe that's not important)
Comment Actions I was wondering whether it might be too much for one review. Easy enough to break it up. I've already spent a bunch of time trying to reduce the test cases, but I'll have another go at it.
Comment Actions Reduce patch to just the DbgValues.empty() assertion; the other will become a new review. I've just deleted the assertion, because we call DebugHandlerBase::endFunction() shortly after this, which will clear DbgValues for us. |