From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10827 invoked by alias); 11 Feb 2015 14:04:54 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 10809 invoked by uid 89); 11 Feb 2015 14:04:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KAM_FROM_URIBL_PCCC,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-oi0-f50.google.com Received: from mail-oi0-f50.google.com (HELO mail-oi0-f50.google.com) (209.85.218.50) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 11 Feb 2015 14:04:52 +0000 Received: by mail-oi0-f50.google.com with SMTP id v1so18610668oia.9 for ; Wed, 11 Feb 2015 06:04:50 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.60.133.70 with SMTP id pa6mr869691oeb.13.1423663490402; Wed, 11 Feb 2015 06:04:50 -0800 (PST) Received: by 10.76.134.102 with HTTP; Wed, 11 Feb 2015 06:04:50 -0800 (PST) In-Reply-To: References: <20150111235837.GA26961@gmail.com> <54B42880.2040800@redhat.com> <2219602.BYtQkL3Scp@laptop1.gw.ume.nu> <54B444E4.1080700@redhat.com> <20150113125201.GA18558@gmail.com> <54B570D5.4040008@redhat.com> Date: Wed, 11 Feb 2015 14:04:00 -0000 Message-ID: Subject: Re: [testsuite] PATCH: Add check_effective_target_pie From: "H.J. Lu" To: Rainer Orth Cc: Jeff Law , Magnus Granberg , GCC Patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-02/txt/msg00704.txt.bz2 On Tue, Feb 10, 2015 at 3:11 PM, Rainer Orth wrote: > Jeff Law writes: > >>> Subject: [PATCH 1/5] Add check_effective_target_pie >>> >>> Hi, >>> >>> This patch adds check_effective_target_pie to check if the current >>> multilib generates PIE by default. >>> >>> Thanks. >>> >>> H.J. >>> --- >>> 2015-01-11 H.J. Lu >>> >>> * gcc.target/i386/pie.c: New test. >>> >>> * lib/target-supports.exp (check_effective_target_pie): New. >> OK. > > The new proc is bogus, unfortunately: there's already an existing > check_effective_target_pie that checks if a target can support PIE. The > new one just overrides the previous one. On targets supporting PIE > (like Darwin), but not defaulting to it, the PIE tests suddenly turn out > UNSUPPORTED. > > You should rename the new one to > e.g. check_effective_target_pie_default, update the single user, and > document it in sourcebuild.texi. I checked in this as an obvious fix. Thanks. -- H.J. --- Index: ChangeLog =================================================================== --- ChangeLog (revision 220617) +++ ChangeLog (working copy) @@ -1,3 +1,7 @@ +2015-02-11 H.J. Lu + + * doc/sourcebuild.texi (pie_enabled): Document. + 2015-02-11 Martin Liska PR ipa/64813 Index: testsuite/lib/target-supports.exp =================================================================== --- testsuite/lib/target-supports.exp (revision 220617) +++ testsuite/lib/target-supports.exp (working copy) @@ -1100,8 +1100,8 @@ # Return 1 if the current multilib generates PIE by default. -proc check_effective_target_pie { } { - return [check_no_compiler_messages pie assembly { +proc check_effective_target_pie_enabled { } { + return [check_no_compiler_messages pie_enabled assembly { #ifndef __PIE__ #error unsupported #endif Index: testsuite/gcc.dg/tree-ssa/ssa-store-ccp-3.c =================================================================== --- testsuite/gcc.dg/tree-ssa/ssa-store-ccp-3.c (revision 220617) +++ testsuite/gcc.dg/tree-ssa/ssa-store-ccp-3.c (working copy) @@ -13,6 +13,6 @@ /* There should be no reference for nonpic targets to conststaticvariable as we should have inlined the 0. */ -/* { dg-final { scan-tree-dump-times "conststaticvariable" 0 "optimized" { target { pie || nonpic } } } } */ -/* { dg-final { scan-tree-dump-times "conststaticvariable" 1 "optimized" { target { { ! pie } && { ! nonpic } } } } } */ +/* { dg-final { scan-tree-dump-times "conststaticvariable" 0 "optimized" { target { pie_enabled || nonpic } } } } */ +/* { dg-final { scan-tree-dump-times "conststaticvariable" 1 "optimized" { target { { ! pie_enabled } && { ! nonpic } } } } } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ Index: testsuite/ChangeLog =================================================================== --- testsuite/ChangeLog (revision 220617) +++ testsuite/ChangeLog (working copy) @@ -1,3 +1,11 @@ +2015-02-11 H.J. Lu + + * lib/target-supports.exp (check_effective_target_pie): Renamed + to ... + (check_effective_target_pie_enabled): This. + * gcc.dg/tree-ssa/ssa-store-ccp-3.c: Replace pie with pie_enabled. + * gcc.target/i386/pie.c: Likewise. + 2015-02-11 Andrew Pinski PR target/64893 Index: testsuite/gcc.target/i386/pie.c =================================================================== --- testsuite/gcc.target/i386/pie.c (revision 220617) +++ testsuite/gcc.target/i386/pie.c (working copy) @@ -1,4 +1,4 @@ -/* { dg-do compile { target pie } } */ +/* { dg-do compile { target pie_enabled } } */ /* { dg-options "-O2" } */ int foo (void); Index: doc/sourcebuild.texi =================================================================== --- doc/sourcebuild.texi (revision 220617) +++ doc/sourcebuild.texi (working copy) @@ -1884,6 +1884,9 @@ @item nonpic Target does not generate PIC by default. +@item pie_enabled +Target generates PIE by default. + @item pcc_bitfield_type_matters Target defines @code{PCC_BITFIELD_TYPE_MATTERS}.