From patchwork Tue Nov 29 10:46:08 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: 84552 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp1536254qgi; Tue, 29 Nov 2016 02:46:38 -0800 (PST) X-Received: by 10.84.164.106 with SMTP id m39mr59679546plg.97.1480416398400; Tue, 29 Nov 2016 02:46:38 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id 84si59252778pgg.198.2016.11.29.02.46.38 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Nov 2016 02:46:38 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-442873-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-442873-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-442873-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:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=QztkK9wIPq0aaOq6vyQx7LbaTiZbk+VhaYDSkUXaKYkimY2UAK ZRFo3FBC1LfwKVihCuM50oRvpUpaQkCDnfWGkmqFUD5iioaJlb6AwLTvszVpjhp/ wIMuA6mIWJmGTynkfaI3ictffYXGMuNJaccrNxPemJ0jSoUYWOcwAYR4o= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=XoLCVV6TBrNMREoHI9cTrKOsYBc=; b=nOjz6yxp/6iKkzLrsdK3 cP5jxMZriewHoQIZMTWVKtkV/xFMaBbs4BrAEATRQVVyyR1h/drQLIyM+GGcI7b3 AMHTmbxx5cErDTJAhHeKGkmrpD2b5Q6ailED3vR6oXsnU6pHdT8Wrg3UqhO7zEea KQTRq5HZwYWc9zkzdeyC4JI= Received: (qmail 75082 invoked by alias); 29 Nov 2016 10:46:21 -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 75070 invoked by uid 89); 29 Nov 2016 10:46:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00, SPF_PASS autolearn=ham version=3.3.2 spammy=clash 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; Tue, 29 Nov 2016 10:46:10 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 8B8CEABE7 for ; Tue, 29 Nov 2016 10:46:08 +0000 (UTC) To: GCC Patches From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Subject: [PATCH] Make one extra BB to prevent PHI argument clash (PR, gcov-profile/78582) Message-ID: <4afe80c2-3c93-985c-930e-0c237e5f3980@suse.cz> Date: Tue, 29 Nov 2016 11:46:08 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 X-IsSubscribed: yes Following ICE has been reduced from bash, where a new CFG does not properly fill a newly added PHI argument. Problem is solved by adding one extra BB that precedes the original BB with the PHI. Doing so, we do not add a new PHI argument. Tests have been running. Ready to be installed after it finishes? Thanks, Martin >From f3de44cbf026d3295d42c36e864d469f19fc56cc Mon Sep 17 00:00:00 2001 From: marxin Date: Tue, 29 Nov 2016 11:40:04 +0100 Subject: [PATCH] Make one extra BB to prevent PHI argument clash (PR gcov-profile/78582) gcc/testsuite/ChangeLog: 2016-11-29 Martin Liska PR gcov-profile/78582 * gcc.dg/pr78582.c: New test. gcc/ChangeLog: 2016-11-29 Martin Liska PR gcov-profile/78582 * tree-profile.c (gimple_gen_time_profiler): Make one extra BB to prevent PHI argument clash. --- gcc/testsuite/gcc.dg/pr78582.c | 18 ++++++++++++++++++ gcc/tree-profile.c | 6 +++--- 2 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/pr78582.c diff --git a/gcc/testsuite/gcc.dg/pr78582.c b/gcc/testsuite/gcc.dg/pr78582.c new file mode 100644 index 0000000..3084e3b --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr78582.c @@ -0,0 +1,18 @@ +/* PR target/78582. */ +/* { dg-options "-fprofile-generate" } */ +/* { dg-compile } */ + +#include + +void reader_loop () {} + +int +main (int argc, char argv, char env) +{ + int a; + sigsetjmp (0, 0); + argc = a = argc; + reader_loop (); + + return 0; +} diff --git a/gcc/tree-profile.c b/gcc/tree-profile.c index a4f9d11..77fb86e 100644 --- a/gcc/tree-profile.c +++ b/gcc/tree-profile.c @@ -461,10 +461,10 @@ void gimple_gen_time_profiler (unsigned tag, unsigned base) { tree type = get_gcov_type (); - basic_block cond_bb - = split_edge (single_succ_edge (ENTRY_BLOCK_PTR_FOR_FN (cfun))); - + basic_block entry = ENTRY_BLOCK_PTR_FOR_FN (cfun); + basic_block cond_bb = split_edge (single_succ_edge (entry)); basic_block update_bb = split_edge (single_succ_edge (cond_bb)); + split_edge (single_succ_edge (update_bb)); edge true_edge = single_succ_edge (cond_bb); true_edge->flags = EDGE_TRUE_VALUE; -- 2.10.2