This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: more robust debug_bb?


On Mon, Nov 22, 2010 at 7:48 PM, Basile Starynkevitch
<basile@starynkevitch.net> wrote:
> On Mon, 22 Nov 2010 12:38:04 -0500
> Diego Novillo <dnovillo@google.com> wrote:
>
>> On Mon, Nov 22, 2010 at 12:31, Ian Lance Taylor <iant@google.com> wrote:
>> > Basile Starynkevitch <basile@starynkevitch.net> writes:
>> >
>> >> or at least replacing the last
>> >> ? ? ?check_bb_profile (bb, buffer->buffer->stream);
>> >> in function dump_bb_header of gimple-pretty-print.c with
>> >> ? ? ?if (cfun)
>> >> ? ? ? ? ? ? ?check_bb_profile (bb, buffer->buffer->stream);
>> >
>> > I think something like this is the way to go. ?The debugging code should
>> > be as robust as possible.
>>
>> Agreed.
>
> So here is the trivial patch.
> Index: gcc/gimple-pretty-print.c
> ===================================================================
> --- gcc/gimple-pretty-print.c ? (revision 167043)
> +++ gcc/gimple-pretty-print.c ? (working copy)
> @@ -1898,7 +1898,8 @@ dump_bb_header (pretty_printer *buffer, basic_bloc
> ? ? ? ?}
> ? ? }
> ? pp_write_text_to_stream (buffer);
> - ?check_bb_profile (bb, buffer->buffer->stream);
> + ?if (cfun)
> + ? ?check_bb_profile (bb, buffer->buffer->stream);
> ?}
>
> ################ gcc/ChangeLog entry
> 2010-11-22 ?Basile Starynkevitch ?<basile@starynkevitch.net>
> ? ? ? ?* gimple-pretty-print.c (dump_bb_header): Added check on cfun.
> ################
>
> Ok for trunk?

FYI, making the debug_* routines more robust in the actual debug
routines is fine with me (just not making them more robust by
patching general routines).

Richard.

> Cheers
>
> --
> Basile STARYNKEVITCH ? ? ? ? http://starynkevitch.net/Basile/
> email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
> 8, rue de la Faiencerie, 92340 Bourg La Reine, France
> *** opinions {are only mine, sont seulement les miennes} ***
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]