From patchwork Mon Nov 22 18:48:15 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Basile Starynkevitch X-Patchwork-Id: 72580 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id C1F48B70DA for ; Tue, 23 Nov 2010 05:48:13 +1100 (EST) Received: (qmail 7130 invoked by alias); 22 Nov 2010 18:48:09 -0000 Received: (qmail 7100 invoked by uid 22791); 22 Nov 2010 18:48:07 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from smtp-151-monday.nerim.net (HELO maiev.nerim.net) (194.79.134.151) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 22 Nov 2010 18:48:02 +0000 Received: from hector.lesours (ours.starynkevitch.net [213.41.244.95]) by maiev.nerim.net (Postfix) with ESMTPS id CDAD32E011; Mon, 22 Nov 2010 19:47:59 +0100 (CET) Received: from glinka.lesours ([192.168.0.1]) by hector.lesours with smtp (Exim 4.72) (envelope-from ) id 1PKbQl-0006Na-7b; Mon, 22 Nov 2010 19:47:59 +0100 Date: Mon, 22 Nov 2010 19:48:15 +0100 From: Basile Starynkevitch To: Diego Novillo Cc: Ian Lance Taylor , Richard Guenther , gcc-patches@gcc.gnu.org Subject: Re: more robust debug_bb? Message-Id: <20101122194815.4ea4bc4a.basile@starynkevitch.net> In-Reply-To: References: <20101122154349.GA17671@ours.starynkevitch.net> <20101122182312.84b7c88c.basile@starynkevitch.net> Mime-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On Mon, 22 Nov 2010 12:38:04 -0500 Diego Novillo wrote: > On Mon, Nov 22, 2010 at 12:31, Ian Lance Taylor wrote: > > Basile Starynkevitch 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 * gimple-pretty-print.c (dump_bb_header): Added check on cfun. ################ Ok for trunk? Cheers 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