public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: Rainer Orth <ro@cebitec.uni-bielefeld.de>
Cc: Jeff Law <law@redhat.com>, Magnus Granberg <zorry@gentoo.org>,
		GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [testsuite] PATCH: Add check_effective_target_pie
Date: Wed, 11 Feb 2015 14:04:00 -0000	[thread overview]
Message-ID: <CAMe9rOqXyp6rLQhGgsxhxWr21j-e-xAfGXATi8Z1C+cp9tW=mA@mail.gmail.com> (raw)
In-Reply-To: <yddk2zp1hx7.fsf@CeBiTec.Uni-Bielefeld.DE>

On Tue, Feb 10, 2015 at 3:11 PM, Rainer Orth
<ro@cebitec.uni-bielefeld.de> wrote:
> Jeff Law <law@redhat.com> 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  <hongjiu.lu@intel.com>
>>>
>>>      * 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  <hongjiu.lu@intel.com>
+
+ * doc/sourcebuild.texi (pie_enabled): Document.
+
 2015-02-11  Martin Liska  <mliska@suse.cz>

  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  <hongjiu.lu@intel.com>
+
+ * 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  <apinski@cavium.com>

  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}.

  reply	other threads:[~2015-02-11 14:04 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-12  0:25 H.J. Lu
2015-01-12 18:28 ` Jeff Law
2015-01-12 19:58   ` H.J. Lu
2015-01-12 19:59     ` Jeff Law
     [not found]       ` <CAMe9rOp1R-FewC1D9fODCe3ia82Ve8YxvfzHPBCaSa9zn4xi+Q@mail.gmail.com>
     [not found]         ` <54B42880.2040800@redhat.com>
2015-01-12 20:16           ` H.J. Lu
2015-01-12 22:01             ` Magnus Granberg
2015-01-12 22:12               ` Jeff Law
2015-01-13 13:03                 ` H.J. Lu
2015-01-13 19:45                   ` Jeff Law
2015-02-10 23:11                     ` Rainer Orth
2015-02-11 14:04                       ` H.J. Lu [this message]
2015-02-11 14:11                         ` Rainer Orth
2015-02-11 14:20                           ` H.J. Lu
2015-02-11 15:19                             ` Rainer Orth
2015-02-11 15:45                               ` H.J. Lu
2015-02-11 16:16                                 ` Rainer Orth
2015-02-11 16:45                                   ` H.J. Lu
2015-01-13 13:04                 ` [testsuite] PATCH: Check if -pg available H.J. Lu
2015-01-13 13:15                   ` H.J. Lu
2015-01-13 19:49                   ` Jeff Law
2015-01-13 20:47                     ` H.J. Lu
2015-01-13 21:14                       ` Jeff Law
2015-01-13 14:56                 ` [testsuite] PATCH: Add check_effective_target_pie H.J. Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMe9rOqXyp6rLQhGgsxhxWr21j-e-xAfGXATi8Z1C+cp9tW=mA@mail.gmail.com' \
    --to=hjl.tools@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=law@redhat.com \
    --cc=ro@cebitec.uni-bielefeld.de \
    --cc=zorry@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).