[LTO] free_language_specifics crashes C++ pretty-printer
Richard Guenther
richard.guenther@gmail.com
Thu Oct 9 08:32:00 GMT 2008
On Thu, Oct 9, 2008 at 10:24 AM, Doug Kwan (關振德) <dougkwan@google.com> wrote:
> The error happens during output of a qualified typename. Do we store
> strings of fully qualified type names
No, but I don't see how this matters here. announce_function
is a debugging thing, and in the end we shouldn't emit new
diagnostics from the link-time run of LTO.
Richard.
> -Doug
>
> 2008/10/9 Richard Guenther <richard.guenther@gmail.com>:
>> 2008/10/9 Doug Kwan (關振德) <dougkwan@google.com>:
>>> Without -quiet, cc1plus prints out declaration of functions inside
>>> cgraph_expand_function.
>>
>> Ah, I see. I think it would be better to dump the mangled
>> name in this case, DECL_ASSEMBLER_NAME. So maybe
>> just add a flag to announce_function whether the mangled
>> or unmangled name is to be printed.
>>
>> Richard.
>>
>>> -Doug
>>>
>>> in cgraphunit.c ...
>>>
>>> static void
>>> cgraph_expand_function (struct cgraph_node *node)
>>> {
>>> tree decl = node->decl;
>>>
>>> /* We ought to not compile any inline clones. */
>>> gcc_assert (!node->global.inlined_to);
>>>
>>> announce_function (decl);
>>> ^^^^^^^^^^^^^^^^^^^^^^^^
>>>
>>> ... in toplev.c
>>>
>>> /* Called when the start of a function definition is parsed,
>>> this function prints on stderr the name of the function. */
>>> void
>>> announce_function (tree decl)
>>> {
>>> if (!quiet_flag)
>>> {
>>> if (rtl_dump_and_exit)
>>> fprintf (stderr, "%s ", IDENTIFIER_POINTER (DECL_NAME (decl)));
>>> else
>>> fprintf (stderr, " %s", lang_hooks.decl_printable_name (decl, 2));
>>> fflush (stderr);
>>> pp_needs_newline (global_dc->printer) = true;
>>> diagnostic_set_last_function (global_dc, (diagnostic_info *) NULL);
>>> }
>>> }
>>>
>>>
>>> 2008/10/9 Richard Guenther <richard.guenther@gmail.com>:
>>>> On Thu, Oct 9, 2008 at 8:35 AM, Doug Kwan (關振德) <dougkwan@google.com> wrote:
>>>>> I am working on a bug where free_language_specifics caused the C++
>>>>> pretty-printer crash because it clears all TYPE_CONTEXT. I can add a
>>>>> band-aid in dump_typename but that does not look like the right fix to
>>>>> me. Is there a better solution?
>>>>
>>>> How do we end up calling the pretty-printer?
>>>>
>>>> Richard.
>>>>
>>>>>
>>>>> -Doug
>>>>>
>>>>
>>>
>>
>
More information about the Gcc-patches
mailing list