https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58479
--- Comment #14 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Even with LVUs if I try the #c0 testcase with outer 3 loops commented out (so only 8x8 unrolling) and with a single dimension array rather than 3 dimensional one, i.e.: int d, e, f; int main () { for (d = 0; d < 8; d++) for (e = 0; e < 8; e++) { int t[9] = { f, f, f, f, f, f, f, f, f}; } return 0; } we still don't emit any location info for t, even when it is in *.final dump: (note 735 734 807 2 pr58479-4.c:12 NOTE_INSN_BEGIN_STMT) (note 807 735 808 2 (var_location t$0 (mem/c:SI (symbol_ref:DI ("f") [flags 0x2] <var_decl 0x7fffefd9e120 f>) [1 f+0 S4 A32])) NOTE_INSN_VAR_LOCATION) (note 808 807 809 2 (var_location t$1 (mem/c:SI (symbol_ref:DI ("f") [flags 0x2] <var_decl 0x7fffefd9e120 f>) [1 f+0 S4 A32])) NOTE_INSN_VAR_LOCATION) (note 809 808 810 2 (var_location t$2 (mem/c:SI (symbol_ref:DI ("f") [flags 0x2] <var_decl 0x7fffefd9e120 f>) [1 f+0 S4 A32])) NOTE_INSN_VAR_LOCATION) (note 810 809 811 2 (var_location t$3 (mem/c:SI (symbol_ref:DI ("f") [flags 0x2] <var_decl 0x7fffefd9e120 f>) [1 f+0 S4 A32])) NOTE_INSN_VAR_LOCATION) (note 811 810 812 2 (var_location t$4 (mem/c:SI (symbol_ref:DI ("f") [flags 0x2] <var_decl 0x7fffefd9e120 f>) [1 f+0 S4 A32])) NOTE_INSN_VAR_LOCATION) (note 812 811 813 2 (var_location t$5 (mem/c:SI (symbol_ref:DI ("f") [flags 0x2] <var_decl 0x7fffefd9e120 f>) [1 f+0 S4 A32])) NOTE_INSN_VAR_LOCATION) (note 813 812 814 2 (var_location t$6 (mem/c:SI (symbol_ref:DI ("f") [flags 0x2] <var_decl 0x7fffefd9e120 f>) [1 f+0 S4 A32])) NOTE_INSN_VAR_LOCATION) (note 814 813 736 2 (var_location t$7 (mem/c:SI (symbol_ref:DI ("f") [flags 0x2] <var_decl 0x7fffefd9e120 f>) [1 f+0 S4 A32])) NOTE_INSN_VAR_LOCATION) So unless that changes, not really sure if it is actually worth preserving the debug stmts at all. I guess we don't do that because there is no real instruction that is in the scope where the variable is defined and the NOTE_INSN_BEGIN_STMTs don't really count (but shouldn't they?). Alex, can you please have a look?