From patchwork Fri Nov 4 10:14:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 80800 Delivered-To: patch@linaro.org Received: by 10.80.170.210 with SMTP id r18csp1053880edc; Fri, 4 Nov 2016 03:15:18 -0700 (PDT) X-Received: by 10.99.3.202 with SMTP id 193mr21129828pgd.157.1478254518228; Fri, 04 Nov 2016 03:15:18 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id v4si15517112pgo.267.2016.11.04.03.15.17 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Nov 2016 03:15:18 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-440413-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-440413-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-440413-patch=linaro.org@gcc.gnu.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; q=dns; s=default; b=tBynbbgd7gXDR1RyA ENt/6qYFXEH9ux/FSAhB6T6y1p7KYdzAWDJTG5khPgXAlhLha7tZvGECFTbdi24J sbURwjv0ZpCCEszdquR1wfiLd81L8w1DhS39dXCxvpVLpCscenoNPs6fhp6B40C0 GscJePIFGhvzpvGAdS5BUoWe3A= 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 :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; s=default; bh=6fYiF2ijDFMhckNtf6+BbmL +kdc=; b=CChXDa6MupatXbMwtcdr99dz2rL8iLxfi4D4FxA7J7cQw8XX/vfwqXi bzNh6u6CLhJUg9LqXGq+4BCS+SEkl2MEY9WMDNqHIIIvuW9eIP1wUeaniGktK9iR 5KUm/h63Kx7xvvmAkhLMPaNoNm9aP6e+AKzpol7Yq8gsQXkg1xec= Received: (qmail 28017 invoked by alias); 4 Nov 2016 10:14:16 -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 27940 invoked by uid 89); 4 Nov 2016 10:14:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=2.8 required=5.0 tests=BAYES_50, SPF_PASS, UNSUBSCRIBE_BODY autolearn=no version=3.3.2 spammy=coding, treeprofilec, value-prof.h, profile.c X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 04 Nov 2016 10:14:05 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 3C3B7ABE7; Fri, 4 Nov 2016 10:14:03 +0000 (UTC) Subject: Re: [PATCH] Make direct emission of time profiler counter To: Christophe Lyon , Jan Hubicka References: <20161103151127.GB43829@kam.mff.cuni.cz> Cc: GCC Patches From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Message-ID: Date: Fri, 4 Nov 2016 11:14:02 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: X-IsSubscribed: yes On 11/04/2016 10:18 AM, Christophe Lyon wrote: > On 3 November 2016 at 16:11, Jan Hubicka wrote: >>> >>> 2016-10-31 Martin Liska >>> >>> * libgcov-profiler.c (__gcov_time_profiler): Remove. >>> (__gcov_time_profiler_atomic): Likewise. >>> >>> gcc/ChangeLog: >>> >>> 2016-10-31 Martin Liska >>> >>> * profile.c (instrument_values): Fix coding style. >>> (branch_prob): Use renamed function. >>> * tree-profile.c (init_ic_make_global_vars): Likewise. >>> (gimple_init_edge_profiler): Rename to >>> gimple_init_gcov_profiler. >>> tree_time_profiler_counter variable declaration. >>> (gimple_gen_time_profiler): Rewrite to do a direct gimple code >>> emission. >>> * value-prof.h: Remove an argument. >>> >>> gcc/testsuite/ChangeLog: >>> >>> 2016-11-03 Martin Liska >>> >>> * gcc.dg/no_profile_instrument_function-attr-1.c: Update scanned >>> output. >>> * gcc.dg/tree-prof/time-profiler-3.c: New test. >> >> OK, >> Thanks! >> Honza > > Hi, > > It seems this patch causes an ICE when compiling > gcc.dg/gomp/pr27573.c > for instance on arm-linux-gnueabi --wtih-cpu=cortex-a9 Hello. Sorry for the breakage, I'm attaching untested patch which fixes that. I'm going to trigger regression tests. Martin > > The backtrace is: > /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/gomp/pr27573.c: > In function 'main._omp_fn.0': > /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/testsuite/gcc.dg/gomp/pr27573.c:12:9: > internal compiler error: in convert_memory_address_addr_sp > ace_1, at explow.c:284 > 0x79b19e convert_memory_address_addr_space_1(machine_mode, rtx_def*, > unsigned char, bool, bool) > /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/explow.c:284 > 0x670903 get_builtin_sync_mem > /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/builtins.c:4933 > 0x671fef expand_builtin_atomic_fetch_op > /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/builtins.c:5452 > 0x674aa4 expand_builtin(tree_node*, rtx_def*, rtx_def*, machine_mode, int) > /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/builtins.c:6859 > 0x7b729a expand_expr_real_1(tree_node*, rtx_def*, machine_mode, > expand_modifier, rtx_def**, bool) > /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/expr.c:10773 > 0x7c1460 store_expr_with_bounds(tree_node*, rtx_def*, int, bool, bool, > tree_node*) > /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/expr.c:5551 > 0x7c7451 expand_assignment(tree_node*, tree_node*, bool) > /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/expr.c:5317 > 0x69a0de expand_call_stmt > /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/cfgexpand.c:2666 > 0x69b264 expand_gimple_stmt_1 > /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/cfgexpand.c:3581 > 0x69b264 expand_gimple_stmt > /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/cfgexpand.c:3747 > 0x69cc8a expand_gimple_basic_block > /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/cfgexpand.c:5754 > 0x69fefe execute > /aci-gcc-fsf/sources/gcc-fsf/gccsrc/gcc/cfgexpand.c:6368 > Please submit a full bug report, > > Christophe > >From 531392d44eb195bd39cb49a169047f5bd898242f Mon Sep 17 00:00:00 2001 From: marxin Date: Fri, 4 Nov 2016 11:12:06 +0100 Subject: [PATCH] time_profiler: Set proper type to time_profiler_counter_ptr. gcc/ChangeLog: 2016-11-04 Martin Liska * tree-profile.c (gimple_gen_time_profiler): Set proper type to time_profiler_counter_ptr. --- gcc/tree-profile.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gcc/tree-profile.c b/gcc/tree-profile.c index 09a702f..d18b954 100644 --- a/gcc/tree-profile.c +++ b/gcc/tree-profile.c @@ -489,8 +489,9 @@ gimple_gen_time_profiler (unsigned tag, unsigned base) /* Emit: counters[0] = ++__gcov_time_profiler_counter. */ if (flag_profile_update == PROFILE_UPDATE_ATOMIC) { - tree ptr = make_temp_ssa_name (type, NULL, "time_profiler_counter_ptr"); - tree addr = build1 (ADDR_EXPR, build_pointer_type (type), + tree ptr = make_temp_ssa_name (build_pointer_type (type), NULL, + "time_profiler_counter_ptr"); + tree addr = build1 (ADDR_EXPR, TREE_TYPE (ptr), tree_time_profiler_counter); gassign *assign = gimple_build_assign (ptr, NOP_EXPR, addr); gsi_insert_before (&gsi, assign, GSI_NEW_STMT); -- 2.10.1