[Bug debug/43479] Missing DW_TAG_lexical_block+DW_TAG_variable
--- Comment #5 from jakub at gcc dot gnu dot org 2010-03-24 08:49 --- Created an attachment (id=20181) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20181action=view) gcc45-pr43479.patch So far only lightly tested fix. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43479
[Bug debug/43479] Missing DW_TAG_lexical_block+DW_TAG_variable
--- Comment #6 from jakub at gcc dot gnu dot org 2010-03-24 13:41 --- Subject: Bug 43479 Author: jakub Date: Wed Mar 24 13:41:30 2010 New Revision: 157693 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=157693 Log: PR debug/19192 PR debug/43479 * cfgexpand.c (gimple_assign_rhs_to_tree): Also set TREE_BLOCK from gimple_block. * expr.c (expand_expr_real): Restore previous curr_insn_source_location and curr_insn_block after expand_expr_real_1 call. (expand_expr_real_1) case SSA_NAME: Call expand_expr_real instead of expand_expr_real_1. * gcc.dg/guality/pr43479.c: New test. * gcc.dg/debug/dwarf2/inline2.c (third): Make a a global var and add volatile keyword. Added: trunk/gcc/testsuite/gcc.dg/guality/pr43479.c Modified: trunk/gcc/ChangeLog trunk/gcc/cfgexpand.c trunk/gcc/expr.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gcc.dg/debug/dwarf2/inline2.c -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43479
[Bug debug/43479] Missing DW_TAG_lexical_block+DW_TAG_variable
--- Comment #7 from jakub at gcc dot gnu dot org 2010-03-24 16:50 --- Subject: Bug 43479 Author: jakub Date: Wed Mar 24 16:50:11 2010 New Revision: 157702 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=157702 Log: PR debug/43479 * ira.c (adjust_cleared_regs): New function. (update_equiv_regs): Adjust cleared_regs in DEBUG_INSNs. Modified: trunk/gcc/ChangeLog trunk/gcc/ira.c -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43479
[Bug debug/43479] Missing DW_TAG_lexical_block+DW_TAG_variable
--- Comment #8 from jakub at gcc dot gnu dot org 2010-03-24 16:55 --- Testcase from #c1 fixed, for #c0 I don't consider it a bug -- jakub at gcc dot gnu dot org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43479
[Bug debug/43479] Missing DW_TAG_lexical_block+DW_TAG_variable
--- Comment #3 from jakub at gcc dot gnu dot org 2010-03-23 17:24 --- Created an attachment (id=20173) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20173action=view) gcc45-pr43479-test.patch This testcase is fixed on x86_64-linux by the PR19192 proposed patch (second or third). Unfortunately it still fails on i686-linux. DEBUG_INSNs look sane in *.asmcons: (debug_insn 9 6 10 2 pr43479.c:8 (var_location:SI l (plus:SI (reg/v:SI 62 [ l ]) (const_int 1 [0x1]))) -1 (nil)) (debug_insn 10 9 11 2 pr43479.c:10 (var_location:SI h (reg/v:SI 64 [ n ])) -1 (nil)) (debug_insn 11 10 12 2 pr43479.c:12 (var_location:SI i (reg/v:SI 61 [ k ])) -1 (nil)) (debug_insn 12 11 13 2 pr43479.c:13 (var_location:SI k (plus:SI (reg/v:SI 61 [ k ]) (const_int 1 [0x1]))) -1 (nil)) (debug_insn 13 12 14 2 pr43479.c:17 (var_location:SI j (reg/v:SI 63 [ m ])) -1 (nil)) (debug_insn 14 13 15 2 pr43479.c:18 (var_location:SI m (plus:SI (reg/v:SI 63 [ m ]) (const_int 1 [0x1]))) -1 (nil)) where all the pseudos are initialized like: (insn 3 2 4 2 pr43479.c:7 (set (reg/v:SI 62 [ l ]) (mem/c/i:SI (plus:SI (reg/f:SI 16 argp) (const_int 4 [0x4])) [0 l+0 S4 A32])) 47 {*movsi_1} (expr_list:REG_EQUIV (mem/c/i:SI (plus:SI (reg/f:SI 16 argp) (const_int 4 [0x4])) [0 l+0 S4 A32]) (nil))) But in *.ira dump all 4 debug_insns are clobber (const_int 0), likely reload doesn't figure out that it could use REG_EQUIV... -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43479
[Bug debug/43479] Missing DW_TAG_lexical_block+DW_TAG_variable
--- Comment #4 from jakub at gcc dot gnu dot org 2010-03-23 17:54 --- It is update_equiv_regs that does this. Will look into it tomorrow. -- jakub at gcc dot gnu dot org changed: What|Removed |Added AssignedTo|unassigned at gcc dot gnu |jakub at gcc dot gnu dot org |dot org | Status|UNCONFIRMED |ASSIGNED Ever Confirmed|0 |1 Last reconfirmed|-00-00 00:00:00 |2010-03-23 17:54:34 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43479
[Bug debug/43479] Missing DW_TAG_lexical_block+DW_TAG_variable
--- Comment #1 from jakub at gcc dot gnu dot org 2010-03-22 18:01 --- Well, in this particular case I believe it is correct. In *.optimized we have: f () { bb 2: # DEBUG y = 1 # DEBUG x = 1 return 1; } where return 1, the only actual statement left, has the function body lexical block as opposed to the nested lexical block, and as no insn is in the scope of that block, it doesn't make any sense to emit it. I have a different testcase though: void foo (int k, int l, int m, int n) { l++; { int h = n; { int i = k; k++; } { int j = m; m++; } } asm volatile ( : : r (k), r (l), r (m)); } and the generated code on x86_64 has 3 addl $1, reg insns, and still optimizing away the nested lexical blocks. In this case I believe two of them should be said to be in the inner scope. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43479
[Bug debug/43479] Missing DW_TAG_lexical_block+DW_TAG_variable
--- Comment #2 from jakub at gcc dot gnu dot org 2010-03-22 18:22 --- In the second testcase it is actually TER that breaks this (both on the trunk and 4.4-RH). In *.nrv we still have: [d.c : 4:4] l_2 = l_1(D) + 1; [d.c : 4:4] # DEBUG l = l_2 [d.c : 6:9] # DEBUG h = n_3(D) [d.c : 7:11] # DEBUG i = k_5(D) [d.c : 7:19] k_7 = k_5(D) + 1; [d.c : 7:19] # DEBUG k = k_7 [d.c : 8:11] # DEBUG j = m_8(D) [d.c : 8:19] m_10 = m_8(D) + 1; [d.c : 8:19] # DEBUG m = m_10 [d.c : 10:3] __asm__ __volatile__( : : r k_7, r l_2, r m_10); [d.c : 11:1] return; and the right block. Not sure why we do TER for r constraint, but even if we do and it turns that some of the generated insns match what has been TERed, it would be good to adjust locus and block of the insns. -- jakub at gcc dot gnu dot org changed: What|Removed |Added CC||matz at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43479