[Bug debug/54519] [4.6/4.7/4.8 Regression] Debug info quality regression due to (pointless) partial inlining
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54519 Richard Guenther changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed||2012-09-10 CC||rguenth at gcc dot gnu.org Target Milestone|--- |4.6.4 Ever Confirmed|0 |1 --- Comment #1 from Richard Guenther 2012-09-10 11:02:10 UTC --- I wonder whether we can make the split function pieces "virtual clones", thus drive all this from IPA inlining instead. So in case we do not inline the header keep the call to the unsplit function. That would have been a better overall design IMHO (not giving any early optimization benefits of course). But even with the current design we might be able to simply fold back to calling the original function at some point (we'd of course have to outline both the header and the tail in this case to keep the original body).
[Bug debug/54519] [4.6/4.7/4.8 Regression] Debug info quality regression due to (pointless) partial inlining
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54519 --- Comment #2 from Jakub Jelinek 2012-09-10 16:21:54 UTC --- Created attachment 28161 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28161 gcc48-pr54519.patch Untested WIP patch which tries to handle at least the case where the fn.part.N isn't inlined back. Will need to do something at the inlining side too, to change the source binds back to normal binds of the corresponding vars. And of course, this doesn't handle non-gimple-reg arguments at all, so for the case where we inline back the fn.part.N (either into original function or into some function into which fn has been inlined already) it would still be nice to special case that inlining.
[Bug debug/54519] [4.6/4.7/4.8 Regression] Debug info quality regression due to (pointless) partial inlining
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54519 Jakub Jelinek changed: What|Removed |Added Status|NEW |ASSIGNED AssignedTo|unassigned at gcc dot |jakub at gcc dot gnu.org |gnu.org | --- Comment #3 from Jakub Jelinek 2012-09-11 13:26:54 UTC --- Created attachment 28171 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28171 gcc48-pr54519.patch Generic solution patch. This doesn't attempt to special case inlining of FN.part.N back into FN or FN inlined into BAR (which is going to be harder than I've initially thought, because both the (possibly inlined) FN and FN.part.N have originally full copy of the BLOCK tree of FN, after some optimizations in between fnsplit and inlining some of the BLOCKs or BLOCK_VARS in either or both of them might be removed though. So, expand_call_inline would probably need to avoid attaching remap_blocks as children of new BLOCK it creates, instead it should somehow merge the two BLOCK trees back into one (it could use BLOCK_ABSTRACT_ORIGIN to find the matching blocks, and for the blocks that already exist in FN just insert_decl_map from FN.part.N's BLOCK to corresponding FN BLOCK). Similarly BLOCK_VARS need to be handled by preferring to remap to vars in the caller FN BLOCK_VARS (just insert_decl_map those), and just re-add the rest that was dropped on the floor in the mean time. And it would need to drop some of the debug bind and debug source bind stmts for parameters that this patch adds. Several of the tests fail sometimes, I'm going to file a separate PR for that because the problem is during the first df_analyze.
[Bug debug/54519] [4.6/4.7/4.8 Regression] Debug info quality regression due to (pointless) partial inlining
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54519 --- Comment #4 from Jakub Jelinek 2012-10-05 19:24:41 UTC --- Author: jakub Date: Fri Oct 5 19:24:38 2012 New Revision: 192139 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=192139 Log: PR debug/54519 * ipa-split.c (split_function): Add debug args and debug source and normal stmts for args_to_skip which are gimple regs. * tree-inline.c (copy_debug_stmt): When inlining, adjust source debug bind stmts to debug binds of corresponding DEBUG_EXPR_DECL. * gcc.dg/guality/pr54519-1.c: New test. * gcc.dg/guality/pr54519-2.c: New test. * gcc.dg/guality/pr54519-3.c: New test. * gcc.dg/guality/pr54519-4.c: New test. * gcc.dg/guality/pr54519-5.c: New test. * gcc.dg/guality/pr54519-6.c: New test. Added: trunk/gcc/testsuite/gcc.dg/guality/pr54519-1.c trunk/gcc/testsuite/gcc.dg/guality/pr54519-2.c trunk/gcc/testsuite/gcc.dg/guality/pr54519-3.c trunk/gcc/testsuite/gcc.dg/guality/pr54519-4.c trunk/gcc/testsuite/gcc.dg/guality/pr54519-5.c trunk/gcc/testsuite/gcc.dg/guality/pr54519-6.c Modified: trunk/gcc/ChangeLog trunk/gcc/ipa-split.c trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-inline.c