From patchwork Tue Aug 19 12:10:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Wielaard X-Patchwork-Id: 381339 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 2BA1F140085 for ; Tue, 19 Aug 2014 22:11:16 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:subject:from:to:cc:date:in-reply-to:references :content-type:content-transfer-encoding:mime-version; q=dns; s= default; b=ne8guI76PJbaWqNxN1veQRgY/ZQdrT+pbocuYQSrQEE7IwlsXnWZf sCBM5u5/uTF1ZyW+9I+JFaRy0SeY2E3cG43KqV01RgdJ1qYFf8YF3yfh6lULDySH 0h2uLTA1S8qaXh/ubTyQFdffAqf2Y+ezpfZRYr54Iyczu9k5pEx1kQ= 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 :message-id:subject:from:to:cc:date:in-reply-to:references :content-type:content-transfer-encoding:mime-version; s=default; bh=fqg6ee4u3fTAv8/R2FkFcI/WJ00=; b=hmhHNy9k5b2xv1HRDV51BqFCDxtY g/eGeGCkcySZswZhT6FYP0c7AIKzKevFAirgG3reAsgoPnE9Z8a1Mwhiti1tqoOP O9MMQN9LI0pn89ui92JFSFoaQ8izOUaFHM7Zfyen3MJDxBx+dEUzgMQNPT5a5AFw cvHYnfAp14pcyXA= Received: (qmail 15687 invoked by alias); 19 Aug 2014 12:10:46 -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 15676 invoked by uid 89); 19 Aug 2014 12:10:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.0 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 19 Aug 2014 12:10:44 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s7JCAfMI008634 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 19 Aug 2014 08:10:42 -0400 Received: from bordewijk.wildebeest.org (ovpn-116-30.ams2.redhat.com [10.36.116.30]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s7JCAdKV018019 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 19 Aug 2014 08:10:41 -0400 Received: by bordewijk.wildebeest.org (Postfix, from userid 1000) id F36998188002; Tue, 19 Aug 2014 14:10:38 +0200 (CEST) Message-ID: <1408450238.3370.14.camel@bordewijk.wildebeest.org> Subject: Re: [PATCH] Add guality [p]type test. From: Mark Wielaard To: Richard Biener Cc: GCC Patches , Jason Merrill , Cary Coutant , Alexandre Oliva , Jakub Jelinek Date: Tue, 19 Aug 2014 14:10:38 +0200 In-Reply-To: References: <1403265071.6147.5.camel@bordewijk.wildebeest.org> <1404381209-11280-1-git-send-email-mjw@redhat.com> <1408446359.3370.12.camel@bordewijk.wildebeest.org> Mime-Version: 1.0 On Tue, 2014-08-19 at 13:22 +0200, Richard Biener wrote: > On Tue, Aug 19, 2014 at 1:05 PM, Mark Wielaard wrote: > > On Mon, 2014-07-07 at 11:57 +0200, Richard Biener wrote: > >> Btw, why doesn't it succeed with LTO? I suspect it's because > >> we drop the unused variables - try adding __attribute__((used)) to > >> them. > > > > You are right, this makes the whole new test PASS also with LTO: > > > > 2014-08-19 Mark Wielaard > > > > * gcc.dg/guality/const-volatile.c: Add `used' attribute to pi. > > > > OK to commit? > > Ok. Here is the same for the new restrict.c testcase. gcc/testsuite/ChangeLog 2014-08-19 Mark Wielaard * gcc.dg/guality/restrict.c: Add `used' attribute to all variables. (cpy): Change type of last argument to int. That last change is necessary to succeed with LTO. Otherwise the type of the function: static __attribute__((noclone, noinline)) void * cpy (void * restrict s1, const void * restrict s2, unsigned int n) comes out as: void *(void * restrict, const void * restrict, __unknown__) That seems a genuine bug. Should I commit the cpy function type change to make the test PASS with LTO? Or leave it as is so it FAILs and someone else can look into it? Thanks, Mark diff --git a/gcc/testsuite/gcc.dg/guality/restrict.c b/gcc/testsuite/gcc.dg/guality/restrict.c index e31224b..43a4ede 100644 --- a/gcc/testsuite/gcc.dg/guality/restrict.c +++ b/gcc/testsuite/gcc.dg/guality/restrict.c @@ -2,19 +2,19 @@ /* { dg-do run } */ /* { dg-options "-std=c99 -gdwarf-3" } */ -int *ip; -const int *cip; -int * restrict irp; -int * const icp; -const int * restrict cirp; -int * const restrict icrp; -const int * const restrict cicrp; +int *ip __attribute__((used)); +const int *cip __attribute__((used)); +int * restrict irp __attribute__((used)); +int * const icp __attribute__((used)); +const int * restrict cirp __attribute__((used)); +int * const restrict icrp __attribute__((used)); +const int * const restrict cicrp __attribute__((used)); -int * const volatile restrict cvirp; -const volatile int * restrict pcvir; +int * const volatile restrict cvirp __attribute__((used)); +const volatile int * restrict pcvir __attribute__((used)); static __attribute__((noclone, noinline)) void * -cpy (void * restrict s1, const void * restrict s2, unsigned int n) +cpy (void * restrict s1, const void * restrict s2, int n) { char *t1 = s1; const char *t2 = s2; @@ -45,4 +45,4 @@ main (int argc, char **argv) /* { dg-final { gdb-test 30 "type:pcvir" "const volatile int * restrict" } } */ /* { dg-final { gdb-test 30 "type:main" "int (int, char **)" } } */ -/* { dg-final { gdb-test 30 "type:cpy" "void *(void * restrict, const void * restrict, unsigned int)" } } */ +/* { dg-final { gdb-test 30 "type:cpy" "void *(void * restrict, const void * restrict, int)" } } */