From patchwork Thu Dec 1 16:10:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jambor X-Patchwork-Id: 701579 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 3tV2Md4Q5Fz9t1B for ; Fri, 2 Dec 2016 03:11:08 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="t3B7oNv1"; 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:date :from:to:subject:message-id:references:mime-version:content-type :in-reply-to; q=dns; s=default; b=F2mlzXJQS0Ke8/wAn25mPdLTRM34MK 78M6W9hZAti4AFCVWjqbP/dSoWvLkMtl1w1MBJZsFO72XArE94otcBf2E0E6OSid g+aMDYH4q8sX5LQklyhzEBlY+BDmByzhx60MeycYDlWOVRKGM1i6Co1y/kK9U2GI h2asHlPj+PvUE= 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:date :from:to:subject:message-id:references:mime-version:content-type :in-reply-to; s=default; bh=FlWLzb9NN+7RK0UkiMJvZ3I1ArY=; b=t3B7 oNv1D1lgfXZdK9UpxgGDzq7ZsIgRryNyXjzWLHtsNJilXUNhLhD/VVFLPBUC0i9b vFCRUUhkKga3WaDVNkzhH22Apsv4i0lt/iOFZ9H8UGvWXdUEPfqE0XuOSWFivM8g 4LWpazxHQsRtc/v+nXGCE5kKMv2YCsVmqd2fYIY= Received: (qmail 56959 invoked by alias); 1 Dec 2016 16:10:58 -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 56946 invoked by uid 89); 1 Dec 2016 16:10:57 -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= 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; Thu, 01 Dec 2016 16:10:47 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 5F3EFAABE; Thu, 1 Dec 2016 16:10:45 +0000 (UTC) Date: Thu, 1 Dec 2016 17:10:44 +0100 From: Martin Jambor To: Jeff Law , Richard Biener , GCC Patches Subject: Re: [RFC] Assert DECL_ABSTRACT_ORIGIN is different from the decl itself Message-ID: <20161201161044.5qpd72jppqravv4l@virgil.suse.cz> Mail-Followup-To: Jeff Law , Richard Biener , GCC Patches References: <20161128142720.fjw72dtpd2mekftv@virgil.suse.cz> <9ac68ea2-8b91-76a5-01c2-e2fcdf482f1b@redhat.com> <20161128172813.zkf57hxrtvaxqitk@virgil.suse.cz> <040f66b4-e86c-1ab3-964d-0a5cba95fab5@redhat.com> <20161130130918.n4e2rcvqnvzdwo2x@virgil.suse.cz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20161130130918.n4e2rcvqnvzdwo2x@virgil.suse.cz> User-Agent: Mutt/1.6.2 (2016-07-01) X-IsSubscribed: yes Hello, On Wed, Nov 30, 2016 at 02:09:19PM +0100, Martin Jambor wrote: > On Tue, Nov 29, 2016 at 10:17:02AM -0700, Jeff Law wrote: > > > > ... > > > > So it seems that rather than an assert that we should just not walk down a > > self-referencing DECL_ABSTRACT_ORIGIN. > > > > ... > > So I wonder what the options are... perhaps it seems that we can call > dump_function_name which starts with code handling > !DECL_LANG_SPECIFIC(t) cases, even instead of the weird > thing? The following patch does that, it works as expected on my small testcases, brings g++ in line with what gcc does with clones when it comes to OpenMP outline functions and obviously prevents the infinite recursion. It passes bootstrap and testing on x86_64-linux. OK for trunk? Thanks, 2016-11-30 Martin Jambor PR c++/78589 * error.c (dump_decl): Use dump_function_name to dump !DECL_LANG_SPECIFIC function decls with no or self-referencing abstract origin. --- gcc/cp/error.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 7bf07c3..5f8fb2a 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -1216,10 +1216,11 @@ dump_decl (cxx_pretty_printer *pp, tree t, int flags) case FUNCTION_DECL: if (! DECL_LANG_SPECIFIC (t)) { - if (DECL_ABSTRACT_ORIGIN (t)) + if (DECL_ABSTRACT_ORIGIN (t) + && DECL_ABSTRACT_ORIGIN (t) != t) dump_decl (pp, DECL_ABSTRACT_ORIGIN (t), flags); else - pp_string (pp, M_("")); + dump_function_name (pp, t, flags); } else if (DECL_GLOBAL_CTOR_P (t) || DECL_GLOBAL_DTOR_P (t)) dump_global_iord (pp, t);