public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Kaveh R. GHAZI" <ghazi@caip.rutgers.edu>
To: Janis Johnson <janis187@us.ibm.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH TESTSUITE]: Fix ipa-cp-1 when -fpic by creating new   dg-add-options "bind-pic-locally"
Date: Fri, 16 Oct 2009 15:55:00 -0000	[thread overview]
Message-ID: <Pine.GSO.4.58.0910161147510.1792@caipclassic.rutgers.edu> (raw)
In-Reply-To: <1255626481.5998.0.camel@janis-laptop>

On Thu, 15 Oct 2009, Janis Johnson wrote:

> OK.
>
> Janis
>
> > 2009-10-15  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
> >
> > 	* lib/target-supports.exp (add_options_for_bind_pic_locally): New.
> > 	* gcc.dg/tree-ssa/ipa-cp-1.c: Bind pic locally.

Thanks Janis.  Here's the patch to retrofit existing tests with the new
dg-add-options command.  I also found a few that were doing dg-skip for
-fpic/-fPIC instead of adding -fpie and fixed those as well.

Tested on x86_64-unknown-linux-gnu with -fpic/-fPIC/regular passes, no
regressions.  I also visually inspected the .log files and ensured that
-fpie/-fPIE was passed to the appropriate tests.

Okay for mainline?

		Thanks,
		--Kaveh


2009-10-16  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* g++.dg/ipa/iinline-1.C: Use dg-add-options bind_pic_locally.
	* g++.dg/other/first-global.C: Likewise.
	* g++.dg/parse/attr-externally-visible-1.C: Likewise.
	* g++.dg/torture/pr40323.C: Likewise.
	* g++.dg/tree-ssa/nothrow-1.C: Likewise.
	* gcc.dg/inline-33.c: Likewise.
	* gcc.dg/ipa/ipa-1.c: Likewise.
	* gcc.dg/ipa/ipa-2.c: Likewise.
	* gcc.dg/ipa/ipa-3.c: Likewise.
	* gcc.dg/ipa/ipa-4.c: Likewise.
	* gcc.dg/ipa/ipa-5.c: Likewise.
	* gcc.dg/ipa/ipa-7.c: Likewise.
	* gcc.dg/ipa/ipacost-2.c: Likewise.
	* gcc.dg/tree-ssa/inline-3.c: Likewise.
	* gcc.dg/tree-ssa/local-pure-const.c: Likewise.
	* gfortran.dg/whole_file_5.f90: Likewise.
	* gfortran.dg/whole_file_6.f90: Likewise.

diff -rup orig/egcc-SVN20091015/gcc/testsuite/g++.dg/ipa/iinline-1.C egcc-SVN20091015/gcc/testsuite/g++.dg/ipa/iinline-1.C
--- orig/egcc-SVN20091015/gcc/testsuite/g++.dg/ipa/iinline-1.C	2009-09-04 02:00:48.000000000 +0200
+++ egcc-SVN20091015/gcc/testsuite/g++.dg/ipa/iinline-1.C	2009-10-15 20:20:38.000000000 +0200
@@ -2,7 +2,7 @@
    inlining..  */
 /* { dg-do compile } */
 /* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining"  } */
-/* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fpie" { target { ! nonpic } } } */
+/* { dg-add-options bind_pic_locally } */

 extern void non_existent (const char *, int);

diff -rup orig/egcc-SVN20091015/gcc/testsuite/g++.dg/other/first-global.C egcc-SVN20091015/gcc/testsuite/g++.dg/other/first-global.C
--- orig/egcc-SVN20091015/gcc/testsuite/g++.dg/other/first-global.C	2008-03-14 00:38:17.000000000 +0100
+++ egcc-SVN20091015/gcc/testsuite/g++.dg/other/first-global.C	2009-10-15 20:22:25.000000000 +0200
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-fpie" { target { ! nonpic } } } */
+/* { dg-add-options bind_pic_locally } */
 /* { dg-final { scan-assembler "_GLOBAL__I(_|_65535_0_)foobar" } } */

 struct foo { foo (); };
diff -rup orig/egcc-SVN20091015/gcc/testsuite/g++.dg/parse/attr-externally-visible-1.C egcc-SVN20091015/gcc/testsuite/g++.dg/parse/attr-externally-visible-1.C
--- orig/egcc-SVN20091015/gcc/testsuite/g++.dg/parse/attr-externally-visible-1.C	2008-03-14 00:38:15.000000000 +0100
+++ egcc-SVN20091015/gcc/testsuite/g++.dg/parse/attr-externally-visible-1.C	2009-10-15 20:21:41.000000000 +0200
@@ -1,6 +1,6 @@
 // { dg-do compile }
 // { dg-options "-O3 -fwhole-program" }
-// { dg-options "-O3 -fwhole-program -fpie" { target { ! nonpic } } }
+// { dg-add-options bind_pic_locally }
 // { dg-final { scan-assembler "foo1" } }
 // { dg-final { scan-assembler "foo2" } }
 // { dg-final { scan-assembler "foo3" } }
diff -rup orig/egcc-SVN20091015/gcc/testsuite/g++.dg/torture/pr40323.C egcc-SVN20091015/gcc/testsuite/g++.dg/torture/pr40323.C
--- orig/egcc-SVN20091015/gcc/testsuite/g++.dg/torture/pr40323.C	2009-06-04 02:00:48.000000000 +0200
+++ egcc-SVN20091015/gcc/testsuite/g++.dg/torture/pr40323.C	2009-10-15 20:19:42.000000000 +0200
@@ -1,7 +1,7 @@
 /* Testcase for PR 40323.  */
 /* { dg-do compile } */
 /* { dg-options "-fno-early-inlining"  } */
-/* { dg-options "-fno-early-inlining -fpie" { target { ! nonpic } } } */
+/* { dg-add-options bind_pic_locally } */

 extern void do_something (const char *, int);

diff -rup orig/egcc-SVN20091015/gcc/testsuite/g++.dg/tree-ssa/nothrow-1.C egcc-SVN20091015/gcc/testsuite/g++.dg/tree-ssa/nothrow-1.C
--- orig/egcc-SVN20091015/gcc/testsuite/g++.dg/tree-ssa/nothrow-1.C	2008-03-14 00:38:14.000000000 +0100
+++ egcc-SVN20091015/gcc/testsuite/g++.dg/tree-ssa/nothrow-1.C	2009-10-15 20:38:50.000000000 +0200
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O1 -fdump-tree-cfg" } */
-/* { dg-skip-if "" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */
+/* { dg-add-options bind_pic_locally } */
+
 double a;
 void t()
 {
diff -rup orig/egcc-SVN20091015/gcc/testsuite/gcc.dg/inline-33.c egcc-SVN20091015/gcc/testsuite/gcc.dg/inline-33.c
--- orig/egcc-SVN20091015/gcc/testsuite/gcc.dg/inline-33.c	2009-03-26 07:14:11.000000000 +0100
+++ egcc-SVN20091015/gcc/testsuite/gcc.dg/inline-33.c	2009-10-15 20:25:06.000000000 +0200
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-O3 -fdump-tree-optimized"  } */
-/* { dg-options "-O3 -fdump-tree-optimized -fpie" { target { ! nonpic } } } */
+/* { dg-add-options bind_pic_locally } */

 int i;

diff -rup orig/egcc-SVN20091015/gcc/testsuite/gcc.dg/ipa/ipa-1.c egcc-SVN20091015/gcc/testsuite/gcc.dg/ipa/ipa-1.c
--- orig/egcc-SVN20091015/gcc/testsuite/gcc.dg/ipa/ipa-1.c	2008-08-30 02:00:12.000000000 +0200
+++ egcc-SVN20091015/gcc/testsuite/gcc.dg/ipa/ipa-1.c	2009-10-15 20:33:44.000000000 +0200
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining"  } */
-/* { dg-skip-if "PR 25442" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */
+/* { dg-add-options bind_pic_locally } */

 #include <stdio.h>
 int g (int b, int c)
diff -rup orig/egcc-SVN20091015/gcc/testsuite/gcc.dg/ipa/ipa-2.c egcc-SVN20091015/gcc/testsuite/gcc.dg/ipa/ipa-2.c
--- orig/egcc-SVN20091015/gcc/testsuite/gcc.dg/ipa/ipa-2.c	2008-08-30 02:00:12.000000000 +0200
+++ egcc-SVN20091015/gcc/testsuite/gcc.dg/ipa/ipa-2.c	2009-10-15 20:33:58.000000000 +0200
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining"  } */
-/* { dg-skip-if "PR 25442" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */
+/* { dg-add-options bind_pic_locally } */

 #include <stdio.h>
 int g (int b, int c)
diff -rup orig/egcc-SVN20091015/gcc/testsuite/gcc.dg/ipa/ipa-3.c egcc-SVN20091015/gcc/testsuite/gcc.dg/ipa/ipa-3.c
--- orig/egcc-SVN20091015/gcc/testsuite/gcc.dg/ipa/ipa-3.c	2009-03-30 02:00:46.000000000 +0200
+++ egcc-SVN20091015/gcc/testsuite/gcc.dg/ipa/ipa-3.c	2009-10-15 20:34:06.000000000 +0200
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining"  } */
-/* { dg-skip-if "PR 25442" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */
+/* { dg-add-options bind_pic_locally } */


 /* Double constants.  */
diff -rup orig/egcc-SVN20091015/gcc/testsuite/gcc.dg/ipa/ipa-4.c egcc-SVN20091015/gcc/testsuite/gcc.dg/ipa/ipa-4.c
--- orig/egcc-SVN20091015/gcc/testsuite/gcc.dg/ipa/ipa-4.c	2009-05-16 02:01:01.000000000 +0200
+++ egcc-SVN20091015/gcc/testsuite/gcc.dg/ipa/ipa-4.c	2009-10-15 20:34:22.000000000 +0200
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining"  } */
-/* { dg-skip-if "PR 25442" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */
+/* { dg-add-options bind_pic_locally } */

 #include <stdio.h>
 int g (int b, int c)
diff -rup orig/egcc-SVN20091015/gcc/testsuite/gcc.dg/ipa/ipa-5.c egcc-SVN20091015/gcc/testsuite/gcc.dg/ipa/ipa-5.c
--- orig/egcc-SVN20091015/gcc/testsuite/gcc.dg/ipa/ipa-5.c	2009-03-30 02:00:46.000000000 +0200
+++ egcc-SVN20091015/gcc/testsuite/gcc.dg/ipa/ipa-5.c	2009-10-15 20:34:32.000000000 +0200
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining"  } */
-/* { dg-skip-if "PR 25442" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */
+/* { dg-add-options bind_pic_locally } */

 /* Float & short constants.  */

diff -rup orig/egcc-SVN20091015/gcc/testsuite/gcc.dg/ipa/ipa-7.c egcc-SVN20091015/gcc/testsuite/gcc.dg/ipa/ipa-7.c
--- orig/egcc-SVN20091015/gcc/testsuite/gcc.dg/ipa/ipa-7.c	2008-08-30 02:00:12.000000000 +0200
+++ egcc-SVN20091015/gcc/testsuite/gcc.dg/ipa/ipa-7.c	2009-10-15 20:35:06.000000000 +0200
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining"  } */
-/* { dg-skip-if "PR 25442" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */
+/* { dg-add-options bind_pic_locally } */

 #include <stdio.h>
 void send_addr (int *);
diff -rup orig/egcc-SVN20091015/gcc/testsuite/gcc.dg/ipa/ipacost-2.c egcc-SVN20091015/gcc/testsuite/gcc.dg/ipa/ipacost-2.c
--- orig/egcc-SVN20091015/gcc/testsuite/gcc.dg/ipa/ipacost-2.c	2009-05-13 02:00:57.000000000 +0200
+++ egcc-SVN20091015/gcc/testsuite/gcc.dg/ipa/ipacost-2.c	2009-10-15 20:23:35.000000000 +0200
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining -fdump-tree-optimized"  } */
-/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining -fdump-tree-optimized -fpie" { target { ! nonpic } } } */
+/* { dg-add-options bind_pic_locally } */

 int array[100];

diff -rup orig/egcc-SVN20091015/gcc/testsuite/gcc.dg/tree-ssa/inline-3.c egcc-SVN20091015/gcc/testsuite/gcc.dg/tree-ssa/inline-3.c
--- orig/egcc-SVN20091015/gcc/testsuite/gcc.dg/tree-ssa/inline-3.c	2009-09-02 20:08:49.000000000 +0200
+++ egcc-SVN20091015/gcc/testsuite/gcc.dg/tree-ssa/inline-3.c	2009-10-15 20:24:40.000000000 +0200
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fdump-tree-einline2" } */
-/* { dg-options "-O2 -fdump-tree-einline2 -fpie" { target { ! nonpic } } } */
+/* { dg-add-options bind_pic_locally } */
+
 extern void inlined ();
 void inline_me_too (void);
 void inline_through_me (void (*ptr)(void));
diff -rup orig/egcc-SVN20091015/gcc/testsuite/gcc.dg/tree-ssa/local-pure-const.c egcc-SVN20091015/gcc/testsuite/gcc.dg/tree-ssa/local-pure-const.c
--- orig/egcc-SVN20091015/gcc/testsuite/gcc.dg/tree-ssa/local-pure-const.c	2009-09-02 20:08:49.000000000 +0200
+++ egcc-SVN20091015/gcc/testsuite/gcc.dg/tree-ssa/local-pure-const.c	2009-10-15 20:24:14.000000000 +0200
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O1 -fdump-tree-local-pure-const1" } */
-/* { dg-options "-O1 -fdump-tree-local-pure-const1 -fpie" { target { ! nonpic } } } */
+/* { dg-add-options bind_pic_locally } */
+
 t(int a, int b, int c)
 {
   int *p;
diff -rup orig/egcc-SVN20091015/gcc/testsuite/gfortran.dg/whole_file_5.f90 egcc-SVN20091015/gcc/testsuite/gfortran.dg/whole_file_5.f90
--- orig/egcc-SVN20091015/gcc/testsuite/gfortran.dg/whole_file_5.f90	2009-08-30 02:00:37.000000000 +0200
+++ egcc-SVN20091015/gcc/testsuite/gfortran.dg/whole_file_5.f90	2009-10-15 20:25:30.000000000 +0200
@@ -1,6 +1,6 @@
 ! { dg-do "compile" }
 ! { dg-options "-O3 -fwhole-file -fdump-tree-optimized" }
-! { dg-options "-O3 -fwhole-file -fdump-tree-optimized -fpie" { target { ! nonpic } } }
+! { dg-add-options bind_pic_locally }
 !
 ! Check that inlining of functions declared BEFORE usage works.
 ! If yes, then the dump does not contain a call to F().
diff -rup orig/egcc-SVN20091015/gcc/testsuite/gfortran.dg/whole_file_6.f90 egcc-SVN20091015/gcc/testsuite/gfortran.dg/whole_file_6.f90
--- orig/egcc-SVN20091015/gcc/testsuite/gfortran.dg/whole_file_6.f90	2009-08-30 02:00:37.000000000 +0200
+++ egcc-SVN20091015/gcc/testsuite/gfortran.dg/whole_file_6.f90	2009-10-15 20:25:55.000000000 +0200
@@ -1,6 +1,6 @@
 ! { dg-do "compile" }
 ! { dg-options "-O3 -fwhole-file -fdump-tree-optimized" }
-! { dg-options "-O3 -fwhole-file -fdump-tree-optimized -fpie" { target { ! nonpic } } }
+! { dg-add-options bind_pic_locally }
 !
 ! Check that inlining of functions declared AFTER usage works.
 ! If yes, then the dump does not contain a call to F().

  reply	other threads:[~2009-10-16 15:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-15 15:44 Kaveh R. GHAZI
2009-10-15 17:29 ` Janis Johnson
2009-10-16 15:55   ` Kaveh R. GHAZI [this message]
2009-10-16 16:52     ` Janis Johnson

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=Pine.GSO.4.58.0910161147510.1792@caipclassic.rutgers.edu \
    --to=ghazi@caip.rutgers.edu \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=janis187@us.ibm.com \
    /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).