[PATCH] Add debug support for merging identical functions (aka ICF)

Cary Coutant ccoutant@google.com
Wed Sep 23 16:10:00 GMT 2009


Ping^2...

-cary


On Fri, Aug 28, 2009 at 9:02 AM, Cary Coutant <ccoutant@google.com> wrote:
> Ping...
>
> -cary
>
>
> On Sat, Aug 15, 2009 at 5:05 PM, Cary Coutant<ccoutant@google.com> wrote:
>>> http://gcc.gnu.org/ml/gcc-patches/2009-07/msg01702.html
>>
>> Here's a refresh of this patch, with a small change I added to the
>> direct call table to record a pointer to the caller's debug info,
>> which I found is necessary to handle a recursive case where a pair of
>> routines C and D get folded together, thus enabling a second pair of
>> routines A and B to be folded, where A calls C and B calls D.
>>
>> -cary
>>
>>
>> gcc/ChangeLog:
>>        Add support for debugging with ICF (Identical Code Folding).
>>        * calls.c (debug.h): New #include.
>>        (emit_call_1): Call virtual_call_token debug hook.
>>        * common.opt (-fenable-icf-debug): New option.
>>        * dwarf2out.c (dwarf2_debug_hooks): Add entries for new hooks (two
>>        locations in the source).
>>        (poc_label_num): New variable.
>>        (dcall_entry, vcall_entry): New typedefs.
>>        (dcall_table, vcall_table): New variables.
>>        (struct vcall_insn): New type.
>>        (vcall_insn_table): New variable.
>>        (DEBUG_DCALL_SECTION, DEBUG_VCALL_SECTION): New macros.
>>        (size_of_dcall_table): New function.
>>        (output_dcall_table): New function.
>>        (size_of_vcall_table): New function.
>>        (output_vcall_table): New function.
>>        (dwarf2out_direct_call): New function.
>>        (vcall_insn_table_hash): New function.
>>        (vcall_insn_table_eq): New function.
>>        (dwarf2out_virtual_call_token): New function.
>>        (dwarf2out_virtual_call): New function.
>>        (dwarf2out_init): Allocate new tables and sections.
>>        (prune_unused_types): Mark DIEs referenced from direct call table.
>>        (dwarf2out_finish): Output direct and virtual call tables.
>>        * final.c (final_scan_insn): Call direct_call and virtual_call
>>        debug hooks.
>>        * debug.h (struct gcc_debug_hooks): Add direct_call,
>>        virtual_call_token, virtual_call hooks.
>>        (debug_nothing_uid): New function.
>>        * debug.c (do_nothing_debug_hooks): Add dummy entries for new hooks.
>>        (debug_nothing_uid): New function.
>>        * dbxout.c (dbx_debug_hooks): Add dummy entries for new hooks.
>>        * sdbout.c (sdb_debug_hooks): Likewise.
>>        * vmsdbgout.c (vmsdbg_debug_hooks): Likewise.
>>        * doc/invoke.texi (-fenable-icf-debug): New option.
>>
>> gcc/testsuite/ChangeLog:
>>        Add support for debugging with ICF (Identical Code Folding).
>>        * g++.dg/debug/dwarf2/icf.C: New test.
>>
>



More information about the Gcc-patches mailing list