From patchwork Mon May 29 09:03:30 2017 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: 768082 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 3wbrQ36VSWz9s65 for ; Mon, 29 May 2017 19:03:55 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="x+OdHs8c"; 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:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=uKaq/P1ciqpTPBzOOM32jb7ikT+CU9hSY9uORZO5PxAdcl8/lm ooDgYA/UGa4i/Bl9vzL5Ir2EGyVZ4MfH0vvn9rZKteAGEst5pZIppzVpcW3M6hY2 XEhg7Qcwt0+hAEFMQ7AohKCSp+uY20oXxlOp8W1HRdQP5a1r5K9VH2T7M= 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=NoUQ0PgROV2jpdBhTTZQwuX77PM=; b=x+OdHs8cz+UiNWZyY95X mvuICc9ylm/T7utp3fG1TZdYzMppI3QC/ghvmzToSPhAPb8xcZTRCqsP8fIkz7rt o5oFHB5CTlJiIivSO37jEmTE+540WjbID664BEzODwQN8aTxG2MlVo1Uz7lgBvTu bSMijxBsPbv5AF9YQ8LdjQA= Received: (qmail 82545 invoked by alias); 29 May 2017 09:03:39 -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 75791 invoked by uid 89); 29 May 2017 09:03:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LOTSOFHASH, SPF_PASS autolearn=ham version=3.3.2 spammy=ship, Usage, mar, 5146 X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 29 May 2017 09:03:33 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 53F12AC29 for ; Mon, 29 May 2017 09:03:34 +0000 (UTC) To: GCC Patches From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Subject: Backport to GCC5 Message-ID: Date: Mon, 29 May 2017 11:03:30 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 X-IsSubscribed: yes Hello. There's a series of patches that I installed to GCC6 and majority of there are also related to GCC 5 branch. I'm going to install the patches. Martin From df314687531986d3a06b309e226a1e5fc7cdfc01 Mon Sep 17 00:00:00 2001 From: marxin Date: Mon, 24 Apr 2017 13:16:34 +0000 Subject: [PATCH 12/12] Backport r247097 gcc/ChangeLog: 2017-04-24 Jan Hubicka PR middle-end/79931 * ipa-devirt.c (dump_possible_polymorphic_call_targets): Fix ICE. gcc/testsuite/ChangeLog: 2017-04-24 Martin Liska PR middle-end/79931 * g++.dg/ipa/pr79931.C: New test. --- gcc/ipa-devirt.c | 8 +++++++- gcc/testsuite/g++.dg/ipa/pr79931.C | 24 ++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/ipa/pr79931.C diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c index c165bceb16b..08cfa8033f0 100644 --- a/gcc/ipa-devirt.c +++ b/gcc/ipa-devirt.c @@ -3211,7 +3211,13 @@ dump_possible_polymorphic_call_targets (FILE *f, fprintf (f, " Speculative targets:"); dump_targets (f, targets); } - gcc_assert (targets.length () <= len); + /* Ugly: during callgraph construction the target cache may get populated + before all targets are found. While this is harmless (because all local + types are discovered and only in those case we devirtualize fully and we + don't do speculative devirtualization before IPA stage) it triggers + assert here when dumping at that stage also populates the case with + speculative targets. Quietly ignore this. */ + gcc_assert (symtab->state < IPA_SSA || targets.length () <= len); fprintf (f, "\n"); } diff --git a/gcc/testsuite/g++.dg/ipa/pr79931.C b/gcc/testsuite/g++.dg/ipa/pr79931.C new file mode 100644 index 00000000000..78f6e03c458 --- /dev/null +++ b/gcc/testsuite/g++.dg/ipa/pr79931.C @@ -0,0 +1,24 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-ipa-all" } */ + +class DocumentImpl; +struct NodeImpl +{ + virtual DocumentImpl * getOwnerDocument(); + virtual NodeImpl * getParentNode(); + virtual NodeImpl * removeChild(NodeImpl *oldChild); +}; +struct AttrImpl : NodeImpl +{ + NodeImpl *insertBefore(NodeImpl *newChild, NodeImpl *refChild); +}; +struct DocumentImpl : NodeImpl +{ + virtual NodeImpl *removeChild(NodeImpl *oldChild); + virtual int* getRanges(); +}; +NodeImpl *AttrImpl::insertBefore(NodeImpl *newChild, NodeImpl *refChild) { + NodeImpl *oldparent = newChild->getParentNode(); + oldparent->removeChild(newChild); + this->getOwnerDocument()->getRanges(); +} -- 2.12.2