From patchwork Thu Jun 4 13:20:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 480736 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 70D06140134 for ; Thu, 4 Jun 2015 23:20:47 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=YJ0PxYVZ; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; q=dns; s=default; b=MX4nnj5dk+HMa6Bvtkv5uOadibuUt5EbNnDAHNZGPBH wuJ6w+gCGa5H+CBF/iCvOwstjbKlr7R/LAz6wsslHm6w8ZoOerYUFLN51r/JBfCE 5y5vaC9R0bpNgmyPzySHYK0Esxpa5ypMT3C+/hia78IO/2g3eayjEnqIqYPu0sH4 = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; s=default; bh=uu35abHt/FvVWT/dxsamAZv6Oyc=; b=YJ0PxYVZ5OlJS0g/B YvuXgEjDYA8QfpvP+RNvizQbodg/clOwwtYBaRCLl+DacMzwJomPqlj8YECszgV2 owW3vnyyZ8CUIgHV+x7v1qX55b5W6/NZIKsVSBupmKf/3a5ieB+Z32y/S+XrvrbZ p6m5YFSomSrMfcvx6EMHoSzuL4= Received: (qmail 112953 invoked by alias); 4 Jun 2015 13:20:38 -0000 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 Received: (qmail 112931 invoked by uid 89); 4 Jun 2015 13:20:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: fencepost.gnu.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (208.118.235.10) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 04 Jun 2015 13:20:36 +0000 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37053) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1Z0V4U-0008Dh-7v for gcc-patches@gnu.org; Thu, 04 Jun 2015 09:20:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z0V4Q-0003qd-8C for gcc-patches@gnu.org; Thu, 04 Jun 2015 09:20:33 -0400 Received: from relay1.mentorg.com ([192.94.38.131]:56704) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0V4Q-0003ms-1J for gcc-patches@gnu.org; Thu, 04 Jun 2015 09:20:30 -0400 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1Z0V4I-0004UX-Cp from Tom_deVries@mentor.com ; Thu, 04 Jun 2015 06:20:22 -0700 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.3.224.2; Thu, 4 Jun 2015 14:20:20 +0100 Message-ID: <55705090.1000705@mentor.com> Date: Thu, 4 Jun 2015 15:20:16 +0200 From: Tom de Vries User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Richard Biener CC: Subject: [PATCH] Add debug msg to dump_file in add_new_function X-detected-operating-system: by eggs.gnu.org: Windows NT kernel [generic] [fuzzy] X-Received-From: 192.94.38.131 Hi, [ posted earlier as part of "Don't dump low gimple functions in gimple dump", https://gcc.gnu.org/ml/gcc-patches/2014-05/msg01586.html, currently discussed at: https://gcc.gnu.org/ml/gcc-patches/2015-05/msg02076.html ] This patch adds a debug msg to dump_file in cgraph_node::add_new_function. OK for trunk (after retesting)? Thanks, - Tom Add debug msg to dump_file in add_new_function 2014-06-04 Tom de Vries * cgraphunit.c (cgraph_node::add_new_function): Dump message on new function. * gcc.dg/gomp/notify-new-function-2.c: New test. * gcc.dg/gomp/notify-new-function.c: Same. --- gcc/cgraphunit.c | 14 ++++++++++++++ gcc/testsuite/gcc.dg/gomp/notify-new-function-2.c | 20 ++++++++++++++++++++ gcc/testsuite/gcc.dg/gomp/notify-new-function.c | 17 +++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/gomp/notify-new-function-2.c create mode 100644 gcc/testsuite/gcc.dg/gomp/notify-new-function.c diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index 8d97163..388c032 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -503,6 +503,20 @@ cgraph_node::add_new_function (tree fndecl, bool lowered) { gcc::pass_manager *passes = g->get_passes (); cgraph_node *node; + + if (dump_file) + { + const char *function_type = ((gimple_has_body_p (fndecl)) + ? (lowered + ? "low gimple" + : "high gimple") + : "to-be-gimplified"); + fprintf (dump_file, + "Added new %s function %s to callgraph\n", + function_type, + fndecl_name (fndecl)); + } + switch (symtab->state) { case PARSING: diff --git a/gcc/testsuite/gcc.dg/gomp/notify-new-function-2.c b/gcc/testsuite/gcc.dg/gomp/notify-new-function-2.c new file mode 100644 index 0000000..b852261 --- /dev/null +++ b/gcc/testsuite/gcc.dg/gomp/notify-new-function-2.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fopenmp -fdump-tree-omplower" } */ + +void __attribute__((noinline)) +baz (int *p) +{ +} + +void +foo (void) +{ + int p[2]; + p[0] = 1; + p[1] = 3; + #pragma omp task firstprivate (p) + baz (p); +} + +/* Check for new function notification in omplower dump. */ +/* { dg-final { scan-tree-dump-times "Added new high gimple function foo._omp_cpyfn.1 to callgraph" 1 "omplower" } } */ diff --git a/gcc/testsuite/gcc.dg/gomp/notify-new-function.c b/gcc/testsuite/gcc.dg/gomp/notify-new-function.c new file mode 100644 index 0000000..4cf4dd3 --- /dev/null +++ b/gcc/testsuite/gcc.dg/gomp/notify-new-function.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fopenmp -fdump-tree-ompexp" } */ + +int +main (void) +{ +#pragma omp parallel + { + extern void foo (void); + foo (); + } + return 0; +} + + +/* Check for new function notification in ompexp dump. */ +/* { dg-final { scan-tree-dump-times "Added new low gimple function main._omp_fn.0 to callgraph" 1 "ompexp" } } */ -- 1.9.1