From patchwork Thu Jun 10 10:41:27 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jambor X-Patchwork-Id: 55198 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 AD43F1007D1 for ; Thu, 10 Jun 2010 20:41:40 +1000 (EST) Received: (qmail 4425 invoked by alias); 10 Jun 2010 10:41:36 -0000 Received: (qmail 4411 invoked by uid 22791); 10 Jun 2010 10:41:35 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, TW_DB X-Spam-Check-By: sourceware.org Received: from cantor.suse.de (HELO mx1.suse.de) (195.135.220.2) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 10 Jun 2010 10:41:30 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id 26F8294033 for ; Thu, 10 Jun 2010 12:41:28 +0200 (CEST) Date: Thu, 10 Jun 2010 12:41:27 +0200 From: Martin Jambor To: GCC Patches Cc: Richard Guenther Subject: [PATCH] Use a debug counter in SRA Message-ID: <20100610104127.GB29266@virgil.suse.cz> Mail-Followup-To: GCC Patches , Richard Guenther MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.17 (2007-11-01) 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 Hi, the patch below adds a debug counter check to the gate of the SRAs for better debugging and even bi-secting problems by users. Bootstrapped and tested on x86_64-linux. OK for trunk? Thanks, Martin 2010-06-10 Martin Jambor * Makefile.in (tree-sra.o): Add DBGCNT_H to dependencies. * dbgcnt.def (tree_sra): New counter. * tree-sra.c: Include dbgcnt.h. (gate_intra_sra): Check tree_sra debug counter. Index: mine/gcc/Makefile.in =================================================================== --- mine.orig/gcc/Makefile.in +++ mine/gcc/Makefile.in @@ -3112,7 +3112,7 @@ tree-ssa-ccp.o : tree-ssa-ccp.c $(TREE_F tree-sra.o : tree-sra.c $(CONFIG_H) $(SYSTEM_H) coretypes.h alloc-pool.h \ $(TM_H) $(TREE_H) $(GIMPLE_H) $(CGRAPH_H) $(TREE_FLOW_H) $(IPA_PROP_H) \ $(DIAGNOSTIC_H) statistics.h $(TREE_DUMP_H) $(TIMEVAR_H) $(PARAMS_H) \ - $(TARGET_H) $(FLAGS_H) $(EXPR_H) tree-pretty-print.h + $(TARGET_H) $(FLAGS_H) $(EXPR_H) tree-pretty-print.h $(DBGCNT_H) tree-switch-conversion.o : tree-switch-conversion.c $(CONFIG_H) $(SYSTEM_H) \ $(TREE_H) $(TM_P_H) $(TREE_FLOW_H) $(DIAGNOSTIC_H) $(TREE_INLINE_H) \ $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) $(GIMPLE_H) \ Index: mine/gcc/dbgcnt.def =================================================================== --- mine.orig/gcc/dbgcnt.def +++ mine/gcc/dbgcnt.def @@ -167,6 +167,7 @@ DEBUG_COUNTER (postreload_cse) DEBUG_COUNTER (pre) DEBUG_COUNTER (pre_insn) DEBUG_COUNTER (treepre_insert) +DEBUG_COUNTER (tree_sra) DEBUG_COUNTER (sched2_func) DEBUG_COUNTER (sched_block) DEBUG_COUNTER (sched_func) Index: mine/gcc/tree-sra.c =================================================================== --- mine.orig/gcc/tree-sra.c +++ mine/gcc/tree-sra.c @@ -88,6 +88,7 @@ along with GCC; see the file COPYING3. #include "params.h" #include "target.h" #include "flags.h" +#include "dbgcnt.h" /* Enumeration of all aggregate reductions we can do. */ enum sra_mode { SRA_MODE_EARLY_IPA, /* early call regularization */ @@ -2936,7 +2937,7 @@ late_intra_sra (void) static bool gate_intra_sra (void) { - return flag_tree_sra != 0; + return flag_tree_sra != 0 && dbg_cnt (tree_sra); }