Patchwork more robust debug_bb?

login
register
mail settings
Submitter Basile Starynkevitch
Date Nov. 22, 2010, 6:48 p.m.
Message ID <20101122194815.4ea4bc4a.basile@starynkevitch.net>
Download mbox | patch
Permalink /patch/72580/
State New
Headers show

Comments

Basile Starynkevitch - Nov. 22, 2010, 6:48 p.m.
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.
2010-11-22  Basile Starynkevitch  <basile@starynkevitch.net>
	* gimple-pretty-print.c (dump_bb_header): Added check on cfun.
################

Ok for trunk?

Cheers
Diego Novillo - Nov. 22, 2010, 6:53 p.m.
On Mon, Nov 22, 2010 at 13:48, Basile Starynkevitch
<basile@starynkevitch.net> wrote:

> 2010-11-22  Basile Starynkevitch  <basile@starynkevitch.net>
>        * gimple-pretty-print.c (dump_bb_header): Added check on cfun.

Blank line after date.
s/on/for/

OK with that change.


Diego.
Eric Botcazou - Nov. 22, 2010, 6:54 p.m.
> ################ gcc/ChangeLog entry
> 2010-11-22  Basile Starynkevitch  <basile@starynkevitch.net>
> 	* gimple-pretty-print.c (dump_bb_header): Added check on cfun.
> ################

2010-11-22  Basile Starynkevitch  <basile@starynkevitch.net>
	
	* gimple-pretty-print.c (dump_bb_header): Add check on cfun.


Present tense please.
Basile Starynkevitch - Nov. 22, 2010, 7:03 p.m.
On Mon, 22 Nov 2010 13:53:31 -0500
Diego Novillo <dnovillo@google.com> wrote:

> On Mon, Nov 22, 2010 at 13:48, Basile Starynkevitch
> <basile@starynkevitch.net> wrote:
> 
> > 2010-11-22  Basile Starynkevitch  <basile@starynkevitch.net>
> >        * gimple-pretty-print.c (dump_bb_header): Added check on cfun.
> 
> Blank line after date.
> s/on/for/
> 
> OK with that change.

Committed revision 167044.

The gcc/ChangeLog entry is

2010-11-22  Basile Starynkevitch  <basile@starynkevitch.net>

	* gimple-pretty-print.c (dump_bb_header): Add check for cfun.


Thanks
Richard Guenther - Nov. 23, 2010, 10:26 a.m.
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} ***
>

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