This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: more robust debug_bb?
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Basile Starynkevitch <basile at starynkevitch dot net>
- Cc: Diego Novillo <dnovillo at google dot com>, Ian Lance Taylor <iant at google dot com>, gcc-patches at gcc dot gnu dot org
- Date: Tue, 23 Nov 2010 11:26:53 +0100
- Subject: Re: more robust debug_bb?
- References: <20101122154349.GA17671@ours.starynkevitch.net> <AANLkTikH8UKdmxK7T=WT8MEgMRVyRtZS-KwkQ=aqt_Gd@mail.gmail.com> <20101122182312.84b7c88c.basile@starynkevitch.net> <mcreiadxo1d.fsf@google.com> <AANLkTin1WrmQTC1tM0aOZ_toi3s8jVenTwX6m=rRPnEY@mail.gmail.com> <20101122194815.4ea4bc4a.basile@starynkevitch.net>
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} ***
>