On Tue, Sep 01, 2015 at 12:09:48PM +0200, Richard Biener wrote: > > So I finally got around to dig into why some testcases I inspected for > early LTO debug (and some existing guality FAILs) happen. They happen > because we screw up locations of insns coming from TERed SSA defs > which end up using the TERed-into stmt location. So final re-building > the BLOCK tree ends up with no stmts in those BLOCKs and thus we > don't get any location annotations (even if the var location notes > are there). > > It looks like expand_expr_real_2 might have been designed to use > ops.location but in fact it only uses that when building other trees. For > singles we already adjust curr_insn_location, so the following does > that for all defs. > > This seems to explain the guality degradation over the years (we > just got better in coalescing / TERing...). > > In my dev tree this fixes all non-LTO, non-VLA guality FAILs, now > bootstrapping and testing on x86_64-unknown-linux-gnu. > > Note this patch can cause some extra jumping around between locations > in gdb - but that's expected I guess. It probably also causes some > debug-info growth. > > Ok for trunk if testing succeeds? Ok to backport?
I'd say ok for trunk, wait some time before backport. > 2015-09-01 Richard Biener <rguent...@suse.de> > > * expr.c (expand_expr_real_1): For expanding TERed defs > set the current location to that of the def if not UNKNOWN. Jakub