Compile time of GiNaC tests increased a lot (to about 10 minutes) since 4.4 variable tracking : 315.80 (96%) usr 0.27 (36%) sys 316.16 (96%) wall 54301 kB (15%) ggc
Created attachment 21020 [details] testcase
Confirmed. At -O2 -g we get for 4.4.x variable tracking : 0.26 ( 1%) usr 0.00 ( 0%) sys 0.24 ( 1%) wall 1870 kB ( 1%) ggc TOTAL : 26.74 1.19 29.62 282737 kB while for the current 4.5 branch we have variable tracking : 392.60 (96%) usr 2.69 (73%) sys 397.72 (96%) wall 30099 kB (11%) ggc TOTAL : 409.66 3.69 415.97 279266 kB
Created attachment 21023 [details] unincluded testcase
Seems the problem here is extremely long loc_chain lists (the longest one in insert_into_intersection has 3740 entries), so e.g. insert_into_intersection is extremely time consuming. Most of the locations in the long lists are of the form (plus:DI (value:DI ...) (const_int ...)) with different values and offsets.
The extremely long location lists are caused mainly by reverse_op created equivalences. Wonder whether we shouldn't on RHS replace sp and sp + const_int with framep and framep + const_int even outside of memory addresses and of course not do reverse_op if the register is framep - the framep is always computable, so it isn't useful to reverse it.
Created attachment 21035 [details] gcc46-pr44694.patch With this patchlet the compile time on ginac.ii went down from more than 3 minutes to 16 seconds. The same number of DIEs as before have DW_AT_location, just .debug_loc got bigger, so need to investigate whether it is because the debug info is more completely, or if it is worse or just less compact.
readelf -wo ginac.o1 | grep 'End of' | wc -l; readelf -wo ginac.o2 | grep 'End of' | wc -l; readelf -wo ginac.o1 | wc -l; readelf -wo ginac.o2 | wc -l; readelf -wo ginac.o1 | grep fbreg | wc -l; readelf -wo ginac.o2 | grep fbreg | wc -l 11850 11796 351354 462546 8117 341790 As the number of DW_AT_location (and DW_AT_const_value) attributes in .debug_info is identical, the above means that with the patch 54 vars no longer use .debug_loc (which means they cover the whole function while before they didn't). For the tiny bit fewer location lists the patched version has more entries in many of them (which can still mean either that the coverage is better, or worse (there could be more holes)) and that DW_OP_fbreg is now used much more often than before (that is quite expected with this patch).
Created attachment 21039 [details] gcc46-pr44694.patch Updated patch that actually passed bootstrap/regtested on x86_64-linux and i686-linux. When (frame) is present outside of MEM addresses, some tweaks to cselib are needed, otherwise it ICEs quite often.
Subject: Bug 44694 Author: jakub Date: Wed Jun 30 06:12:22 2010 New Revision: 161587 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=161587 Log: PR debug/44694 * cselib.h (cselib_preserve_cfa_base_value): Add regno argument. * cselib.c (cfa_base_preserved_regno): New static variable. (cselib_reset_table): Don't reset cfa_base_preserved_regno instead of REGNO (cfa_base_preserved_val->locs->loc). (cselib_preserve_cfa_base_value): Add regno argument, set cfa_base_preserved_regno to it. (cselib_invalidate_regno): Allow removal of registers other than cfa_base_preserved_regno from cfa_base_preserved_val. (cselib_finish): Set cfa_base_preserved_regno to INVALID_REGNUM. * var-tracking.c (adjust_mems): Replace sp or hfp even outside of MEM addresses, if not on LHS. (reverse_op): Don't add reverse ops for cfa_base_rtx. (vt_init_cfa_base): Adjust cselib_preserve_cfa_base_value caller. Modified: trunk/gcc/ChangeLog trunk/gcc/cselib.c trunk/gcc/cselib.h trunk/gcc/var-tracking.c
Fixed on the trunk so far.
Subject: Bug 44694 Author: jakub Date: Wed Jun 30 15:40:53 2010 New Revision: 161610 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=161610 Log: Backport from mainline 2010-06-30 Jakub Jelinek <jakub@redhat.com> PR debug/44694 * cselib.h (cselib_preserve_cfa_base_value): Add regno argument. * cselib.c (cfa_base_preserved_regno): New static variable. (cselib_reset_table): Don't reset cfa_base_preserved_regno instead of REGNO (cfa_base_preserved_val->locs->loc). (cselib_preserve_cfa_base_value): Add regno argument, set cfa_base_preserved_regno to it. (cselib_invalidate_regno): Allow removal of registers other than cfa_base_preserved_regno from cfa_base_preserved_val. (cselib_finish): Set cfa_base_preserved_regno to INVALID_REGNUM. * var-tracking.c (adjust_mems): Replace sp or hfp even outside of MEM addresses, if not on LHS. (reverse_op): Don't add reverse ops for cfa_base_rtx. (vt_init_cfa_base): Adjust cselib_preserve_cfa_base_value caller. Modified: branches/gcc-4_5-branch/gcc/ChangeLog branches/gcc-4_5-branch/gcc/cselib.c branches/gcc-4_5-branch/gcc/cselib.h branches/gcc-4_5-branch/gcc/var-tracking.c
(In reply to comment #9) > Subject: Bug 44694 > > Author: jakub > Date: Wed Jun 30 06:12:22 2010 > New Revision: 161587 > > URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=161587 > Log: > PR debug/44694 > This patch causes a build failure on arm-eabi when building libstdc++. The compiler ends up passing the internal version of the frame pointer register (which has to be eliminated into either SP of FP) to arm_dbx_register_number().
Created attachment 21048 [details] testcase for introduced regression compiler options in first line of testcase.
Created attachment 21050 [details] testcase for introduced regression compiler options in first line of testcase.
Created attachment 21052 [details] gcc46-pr44694-arm.patch Untested fix for this issue.
Created attachment 21053 [details] gcc46-pr44694-arm.patch Actually that was wrong, we need to emit DW_OP_fbreg offset DW_OP_stack_value in that case instead.
Subject: Bug 44694 Author: jakub Date: Thu Jul 1 11:11:46 2010 New Revision: 161662 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=161662 Log: PR debug/44694 * dwarf2out.c (reg_loc_descriptor): For eliminated arg_pointer_rtx or frame_pointer_rtx use DW_OP_fbreg offset DW_OP_stack_value. Modified: trunk/gcc/ChangeLog trunk/gcc/dwarf2out.c
Subject: Bug 44694 Author: jakub Date: Thu Jul 1 11:12:24 2010 New Revision: 161663 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=161663 Log: PR debug/44694 * dwarf2out.c (reg_loc_descriptor): For eliminated arg_pointer_rtx or frame_pointer_rtx use DW_OP_fbreg offset DW_OP_stack_value. Modified: branches/gcc-4_5-branch/gcc/ChangeLog branches/gcc-4_5-branch/gcc/dwarf2out.c
Fixed.