This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [google/gcc-4_9] Minor changes to -ftwo-level-line-tables
- From: Cary Coutant <ccoutant at google dot com>
- To: Dehao Chen <dehao at google dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 3 Mar 2015 12:26:59 -0800
- Subject: Re: [google/gcc-4_9] Minor changes to -ftwo-level-line-tables
- Authentication-results: sourceware.org; auth=none
- References: <20150303192507 dot A4818160C68 at ccoutant dot mtv dot corp dot google dot com> <CAO2gOZVcbBAXkKFqEewW6Y4_80SeiYWrbyXGXuK9dLYt1kxq_A at mail dot gmail dot com>
>> @@ -21817,22 +21823,39 @@ out_subprog_directive (subprog_entry *su
>> {
>> tree decl = subprog->decl;
>> tree decl_name = DECL_NAME (decl);
>> - const char *name;
>> + tree origin;
>
> Explicitly initialize origin to NULL_TREE;
Done.
>> + /* For inlined subroutines, use the linkage name.
>> + If -ftwo-level-all-subprogs is set, use the linkage name
>> + for all subroutines. */
>> + if (subprog->is_inlined || flag_two_level_all_subprogs)
>> {
>> - name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
>> - if (name[0] == '*')
>> - name++;
>> + if (DECL_ASSEMBLER_NAME (origin))
>> + {
>> + name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (origin));
>> + if (name[0] == '*')
>> + name++;
>> + }
>> + else
>> + name = dwarf2_name (origin, 0);
>> }
>> else
>> - name = dwarf2_name (decl, 0);
>> + {
>> + /* To save space, we don't emit the name for non-inlined
>> + subroutines, whose linkage names are available from the
>> + object file's symbol table. */
>
> flag_two_level_all_subprogs will be 1 by default. This mean "else"
> branch is not the default behavior?
No, I changed the default in common.opt:
ftwo-level-all-subprogs
-Common Report Var(flag_two_level_all_subprogs) Init(1)
+Common Report Var(flag_two_level_all_subprogs) Init(0)
When generating two-level line tables in DWARF (experimental),
-generate subprogram table entries for all functions.
+add linkage names for all functions (not just inlined functions).
-cary