As reported by Richard in int a; int foo() { int tmp = a; int tmp2 = a; int tmp3; int res; a = 0; tmp3 = tmp2; res = tmp - tmp2 + 1; return res; } results in wrong-debug with -O2 -g. Having # DEBUG tmp3 => a after a = 0 is wrong certainly already at gimple levels, while # DEBUG tmp1 => a and # DEBUG tmp2 => a could be in theory handled only at the var-tracking level, but even there var-tracking fails to notice that the a = 0 store can clobber the memory (i.e. that the VALUE should be clobbered, and in theory e.g. most calls should be considered to clobber non-stack MEMs etc., as usually) and add notes that tmp1/tmp2 don't have known values anymore.
-- Summary: Wrong debug with VTA on temporaries initialized from memory variable Product: gcc Version: 4.5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: debug AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: jakub at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41447