From patchwork Thu Dec 8 11:04:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierre-Marie de Rodat X-Patchwork-Id: 87228 Delivered-To: patch@linaro.org Received: by 10.182.112.6 with SMTP id im6csp806462obb; Thu, 8 Dec 2016 03:04:53 -0800 (PST) X-Received: by 10.84.208.227 with SMTP id c32mr156009069plj.144.1481195093229; Thu, 08 Dec 2016 03:04:53 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id y26si28395050pfk.69.2016.12.08.03.04.52 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Dec 2016 03:04:53 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-443772-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-443772-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-443772-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=EWFkx5aOCFEtK+QTq CLpgnBwq2OayezLGxCA2fkrNkTkZt+MtTkyqisNmCWfJUfU8sDVYQRARdX8zf13d dZ9gUK6uIi+SLgutfCpMOJYF28BMJYcK8HtIwImDIDuRq0/RoccRvnIcYl2r7o0/ RpPhLgZbmezeCC6ao7yO1Y7CPs= 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=xS3ma2eVtG8dyaAS6UfLjKa +tEU=; b=gFmz645ft8iASBBj0phFmnM+LplyAgTcsDZdPnB+XoS+YhbYNE2nSTN rYxi3/y66vLKu5AuY9LPu9tmAzxOFd5tdBHbn8X33XxFZFGd8zt0TpAsUNeGetU0 korJLtquLxR0bjL7yvbrISt6vpe5SSYTejAAiCFafDMtfWf0PEAQ= Received: (qmail 59162 invoked by alias); 8 Dec 2016 11:04:36 -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 59142 invoked by uid 89); 8 Dec 2016 11:04:35 -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, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=eliminated, ick, violated X-HELO: smtp.eu.adacore.com Received: from mel.act-europe.fr (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 08 Dec 2016 11:04:25 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 8C1DF814DB; Thu, 8 Dec 2016 12:04:23 +0100 (CET) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hoOGzIJL7cr7; Thu, 8 Dec 2016 12:04:23 +0100 (CET) Received: from [IPv6:2a02:2ab8:224:1:f21f:afff:fe4c:b838] (cacatoes.act-europe.fr [IPv6:2a02:2ab8:224:1:f21f:afff:fe4c:b838]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id 5B8A281451; Thu, 8 Dec 2016 12:04:23 +0100 (CET) Subject: Re: [PATCH] [PR78112] Remove the g++.dg/pr78112.C testcase To: Mike Stump References: <20161130130430.17219-1-derodat@adacore.com> <8F1ED975-4ED4-4193-9481-8EA2FD1A0EBC@comcast.net> Cc: gcc-patches@gcc.gnu.org From: Pierre-Marie de Rodat Message-ID: Date: Thu, 8 Dec 2016 12:04:23 +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: <8F1ED975-4ED4-4193-9481-8EA2FD1A0EBC@comcast.net> X-IsSubscribed: yes Hello Mike, On 11/30/2016 09:12 PM, Mike Stump wrote: > So, I noticed this and didn't see who you wanted to review it so, > since it was C++, I thought I'd take a look at it. Ick. Complex > issue. I did not have anyone special in mind actually, so thank you for having had a look. :-) > One way to test this would be to have a internal check in the > compiler for the thing you don't want to happen as an assert, and > then have the unpatched compiler abort when given the test case > before the work that cause fixed the original PR. The test case then > shows the failure, and should anyone break it, the internal check > will catch the problem and abort, thus causing the test case to then > fail (again). I guess the internal check of relevance here would be “check that when adding an attribute to a DIE, existing attributes on this DIE don’t have the same DW_AT_* kind”. Unfortunately, we know this invariant is still violated (and was before my first changes affecting this), so I don’t think this is possible right now unless someone spends more time investigating why there are duplicate attributes and how to fix them. > Then, you only need to compile the test case and expect a non-zero > output from the compilation. On darwin, the excess message from > dsymutil should be findable by dejagnu and should also be able to > fail the test case on darwin. That being said, I’m still wondering why dsymutil produces no error even though there are still duplicate attributes (less of them, but still some). Maybe because DW_AT_object_pointer is not emitted on Darwin (which uses -gdwarf-2 by default) and because the DW_AT_inline duplicate does not appear there as well? Anyway… > If you like that design (and a dwarf maintainer likes that design), > then you can fix this test case by removing: > >> -/* { dg-final { scan-assembler-times DW_AT_inline 6 { xfail *-*-aix* } } } */ >> -/* { dg-final { scan-assembler-times DW_AT_object_pointer 37 { xfail *-*-aix* } } } */ > > alone and otherwise keep the full test case. I’m fine with keeping this testcase and updating it as you said. It will be useful only for Darwin users, though, but I guess that’s better than nothing as it will clearly relate the regression to this whole discussion when there is a failure on this platform. > When looking at the test case, I wonder just how reduced it really > was. The last possible option would be to reduce the test case > further and see if the problem can be eliminated that way. Again, > I'll pre-approve the test suite part of any of those solutions you > like best. I already tried to reduce it as much as possible: see . On my x86_64-linux box, I tried to build several cross-compilers (x86_64-apple-darwin16.3.0 and arm-none-eabi) in order to see how this reduced reproducer behaves: it looks like we have a consistent number of DW_AT_object_pointer attributes for it as long as we force -gdwarf-4 (the default is -gdwarf-2 on Darwin), which is: 18 times. So here is an updated patch that removes the trouble some check in pr78112.C and that adds the reduced testcase as pr78112-2.C. Thank you for the pre-approval: I’ve just pushed this fix. For the record, I’ve checked it runs fine on x86_64-linux and x86_64-apple-darwin-16.3.0 and I’ve checked manually we have the correct number of attributes with a partial arm-none-abi compiler (i.e. just cc1plus). -- Pierre-Marie de Rodat >From fa8d7ca05a8711e261b5c4cfeec885c3ecede508 Mon Sep 17 00:00:00 2001 From: Pierre-Marie de Rodat Date: Wed, 30 Nov 2016 13:57:34 +0100 Subject: [PATCH] [PR78112] Remove platform-dependent checks in g++.dg/pr78112.C ... as there checks failed on many platforms. As a replacement, this commit also adds a new testcase from source reduction. The hope is that this new testcase will get a consistent output across all platforms. gcc/testsuite/ PR debug/78112 * g++.dg/pr78112.C: Remove platform-dependent checks. * g++.dg/pr78112-2.C: New testcase. --- gcc/testsuite/g++.dg/pr78112-2.C | 13 +++++++++++++ gcc/testsuite/g++.dg/pr78112.C | 2 -- 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/g++.dg/pr78112-2.C diff --git a/gcc/testsuite/g++.dg/pr78112-2.C b/gcc/testsuite/g++.dg/pr78112-2.C new file mode 100644 index 0000000..d9d18ff --- /dev/null +++ b/gcc/testsuite/g++.dg/pr78112-2.C @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-g -dA -gdwarf-4 -std=gnu++11" } */ +/* { dg-options "-g -dA -std=gnu++11 -gdwarf-4" } */ +/* { dg-final { scan-assembler-times DW_AT_object_pointer 18 } } */ + +void run (int *int_p, void(*func)(int *)) { func (int_p); } +namespace foo { + struct Foo { + int a; + Foo() { run (&a, [](int *int_p) { *int_p = 0; }); } + }; +} +int main (void) { foo::Foo f; } diff --git a/gcc/testsuite/g++.dg/pr78112.C b/gcc/testsuite/g++.dg/pr78112.C index 986171d..8312292 100644 --- a/gcc/testsuite/g++.dg/pr78112.C +++ b/gcc/testsuite/g++.dg/pr78112.C @@ -1,7 +1,5 @@ /* { dg-do compile } */ /* { dg-options "-g -dA -std=gnu++11" } */ -/* { dg-final { scan-assembler-times DW_AT_inline 6 { xfail *-*-aix* } } } */ -/* { dg-final { scan-assembler-times DW_AT_object_pointer 37 { xfail *-*-aix* } } } */ namespace std { template struct integral_constant -- 2.10.2