Summary: | Early inlining causes suboptimal debug info | ||
---|---|---|---|
Product: | gcc | Reporter: | Jakub Jelinek <jakub> |
Component: | debug | Assignee: | Jakub Jelinek <jakub> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | aoliva, gcc-bugs, hubicka, mark |
Priority: | P3 | Keywords: | wrong-debug |
Version: | 4.5.0 | ||
Target Milestone: | --- | ||
Host: | Target: | x86_64-linux | |
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | ||
Attachments: |
rh572260.ii
gcc45-pr43329.patch gcc45-pr43329.patch |
Description
Jakub Jelinek
2010-03-10 23:28:20 UTC
Created attachment 20078 [details]
rh572260.ii
Testcase.
The problem is that with early inlining, method (&inst, 24) call is inlined into call function, then at the end of einline during arrg3 and min vars in call are removed as unused locals by remove_unused_locals (the inline asm uses 24 directly, so arrg3 is only referenced in DEBUG stmts, not sure why min didn't have any DEBUG stmts even generated). Then when in the normal inliner call is inlined into main, both arrg3 and min are non-localized because their var_ann is NULL. And for non-localized vars dwarf2out isn't able to find the dwarf2out_var_location tracked values. Wonder why we do 548 VEC_safe_push (tree, gc, *nonlocalized_list, origin_var); instead of 548 VEC_safe_push (tree, gc, *nonlocalized_list, old_var); The latter perhaps would need some adjustments in dwarf2out.c, but would allow it to find the location. Created attachment 20081 [details] gcc45-pr43329.patch This patch worked on this testcase. Note that the missing min (and this) DEBUG stmts are caused by remove_forwarder_block nuking it. Looking into that... Created attachment 20084 [details] gcc45-pr43329.patch Updated patch that also fixes remove_forwarder_block and adds a testcase. Subject: Bug 43329 Author: jakub Date: Fri Mar 12 13:04:37 2010 New Revision: 157402 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=157402 Log: PR debug/43329 * tree-inline.c (remap_decls): Put old_var rather than origin_var into *nonlocalized_list vector. * dwarf2out.c (gen_formal_parameter_die): Call decl_ultimate_origin even if origin is non-NULL. (gen_variable_die): Likewise. (process_scope_var): Don't change origin. (gen_decl_die): Likewise. * tree-cfgcleanup.c (remove_forwarder_block): Check single_pred_p before adding new edges instead of after it, fix moving over debug stmts. * gcc.dg/guality/pr43329-1.c: New test. Added: trunk/gcc/testsuite/gcc.dg/guality/pr43329-1.c Modified: trunk/gcc/ChangeLog trunk/gcc/dwarf2out.c trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-cfgcleanup.c trunk/gcc/tree-inline.c Fixed. |