This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch] Potential fix for PR55033


Hello Alan,

maybe it is better to use a require effective target instead of the

{ target powerpc*-*-eabi* powerpc*-*-elf* powerpc*-*-linux* }

patterns scattered around in the testsuite? One problem with this is that test cases for one of these will likely also work with powerpc*-*-rtems*. I want to look at the remaining 104 test cases which are marked as UNSUPPORTED for RTEMS some time in the future. Please have a look at the attached patches.

On 10/31/2012 01:12 AM, Alan Modra wrote:
On Tue, Oct 30, 2012 at 02:45:40PM +0100, Sebastian Huber wrote:
On 10/26/2012 02:22 PM, Sebastian Huber wrote:
Hello,

here is a test case for PR55033.


Is there something wrong with this test case? It compiles well with Alan's patch.

It looks OK to me if you replace your "gd-do compile" line with the following two lines to avoid failures on powerpc targets that don't support -meabi -msdata.

/* { dg-do compile { target powerpc*-*-eabi* powerpc*-*-elf* powerpc*-*-linux* } } */
/* { dg-require-effective-target ilp32 } */




--
Sebastian Huber, embedded brains GmbH

Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany
Phone   : +49 89 18 90 80 79-6
Fax     : +49 89 18 90 80 79-9
E-Mail  : sebastian.huber@embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.


>From a57f179c89b5ac1bb6bf8ecfa8fa47a6e8e7c6c0 Mon Sep 17 00:00:00 2001
From: Sebastian Huber <sebastian.huber@embedded-brains.de>
Date: Wed, 31 Oct 2012 10:36:49 +0100
Subject: [PATCH 1/2] PowerPC testsuite clean up

2012-10-31  Sebastian Huber  <sebastian.huber@embedded-brains.de>

	* lib/target-supports.exp
	(check_effective_target_powerpc_canonical): New.
	(check_effective_target_powerpc_eabi_ok): New.
	* gcc.target/powerpc/ppc-eabi.c: Use require effective target
	powerpc_eabi_ok.
	* gcc.target/powerpc/ppc-sdata-1.c: Likewise.
	* gcc.target/powerpc/spe-small-data-2.c: Likewise.
	* gcc.target/powerpc/ppc-sdata-2.c: Use require effective target
	powerpc_canonical and ilp32.
	* gcc.target/powerpc/pr51623.c: Likewise.
	* gcc.target/powerpc/ppc-stackalign-1.c: Use require effective target
	powerpc_canonical.
	* gcc.target/powerpc/ppc-ldstruct.c: Run for powerpc*-*-rtems*.
	* gcc.target/powerpc/spe-small-data-2.c: Do not run, compile only.
---
 gcc/testsuite/gcc.target/powerpc/ppc-eabi.c        |    3 +-
 gcc/testsuite/gcc.target/powerpc/ppc-ldstruct.c    |    2 +-
 gcc/testsuite/gcc.target/powerpc/ppc-sdata-1.c     |    3 +-
 gcc/testsuite/gcc.target/powerpc/ppc-sdata-2.c     |    4 ++-
 .../gcc.target/powerpc/ppc-stackalign-1.c          |    3 +-
 gcc/testsuite/gcc.target/powerpc/pr51623.c         |    4 ++-
 .../gcc.target/powerpc/spe-small-data-2.c          |    3 +-
 gcc/testsuite/lib/target-supports.exp              |   23 ++++++++++++++++++++
 8 files changed, 38 insertions(+), 7 deletions(-)

diff --git a/gcc/testsuite/gcc.target/powerpc/ppc-eabi.c b/gcc/testsuite/gcc.target/powerpc/ppc-eabi.c
index 47ba1a7..cd15586 100644
--- a/gcc/testsuite/gcc.target/powerpc/ppc-eabi.c
+++ b/gcc/testsuite/gcc.target/powerpc/ppc-eabi.c
@@ -1,4 +1,5 @@
 /* PR target/16952 */
-/* { dg-do compile { target { powerpc*-*-linux* && ilp32 } } } */
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_eabi_ok } */
 /* { dg-options "-meabi -mrelocatable" } */
 char *s = "boo";
diff --git a/gcc/testsuite/gcc.target/powerpc/ppc-ldstruct.c b/gcc/testsuite/gcc.target/powerpc/ppc-ldstruct.c
index da6001f..ffb4264 100644
--- a/gcc/testsuite/gcc.target/powerpc/ppc-ldstruct.c
+++ b/gcc/testsuite/gcc.target/powerpc/ppc-ldstruct.c
@@ -1,4 +1,4 @@
-/* { dg-do run { target powerpc*-*-eabi* powerpc*-*-elf* powerpc*-*-linux* } } */
+/* { dg-do run { target powerpc*-*-eabi* powerpc*-*-elf* powerpc*-*-linux* powerpc*-*-rtems* } } */
 /* { dg-options "-O -mlong-double-128" } */
 
 #include <stdlib.h>
diff --git a/gcc/testsuite/gcc.target/powerpc/ppc-sdata-1.c b/gcc/testsuite/gcc.target/powerpc/ppc-sdata-1.c
index 5f39d86..efd5a5e 100644
--- a/gcc/testsuite/gcc.target/powerpc/ppc-sdata-1.c
+++ b/gcc/testsuite/gcc.target/powerpc/ppc-sdata-1.c
@@ -1,5 +1,6 @@
-/* { dg-do compile { target { { powerpc*-*-linux* && ilp32 } || { powerpc-*-eabi* } } } } */
+/* { dg-do compile } */
 /* { dg-options "-O2 -fno-common -G 8 -meabi -msdata=eabi" } */
+/* { dg-require-effective-target powerpc_eabi_ok } */
 /* { dg-require-effective-target nonpic } */
 /* { dg-final { scan-assembler "\\.section\[ \t\]\\.sdata," } } */
 /* { dg-final { scan-assembler "\\.section\[ \t\]\\.sdata2," } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/ppc-sdata-2.c b/gcc/testsuite/gcc.target/powerpc/ppc-sdata-2.c
index f102b1d..fdc4030 100644
--- a/gcc/testsuite/gcc.target/powerpc/ppc-sdata-2.c
+++ b/gcc/testsuite/gcc.target/powerpc/ppc-sdata-2.c
@@ -1,5 +1,7 @@
-/* { dg-do compile { target { { powerpc*-*-linux* && ilp32 } || { powerpc-*-eabi* } } } } */
+/* { dg-do compile } */
 /* { dg-options "-O2 -fno-common -G 8 -msdata=sysv" } */
+/* { dg-require-effective-target powerpc_canonical } */
+/* { dg-require-effective-target ilp32 } */
 /* { dg-require-effective-target nonpic } */
 /* { dg-final { scan-assembler "\\.section\[ \t\]\\.sdata," } } */
 /* { dg-final { scan-assembler-not "\\.section\[ \t\]\\.sdata2," } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/ppc-stackalign-1.c b/gcc/testsuite/gcc.target/powerpc/ppc-stackalign-1.c
index 465fc41..034ebc1 100644
--- a/gcc/testsuite/gcc.target/powerpc/ppc-stackalign-1.c
+++ b/gcc/testsuite/gcc.target/powerpc/ppc-stackalign-1.c
@@ -1,4 +1,5 @@
-/* { dg-do run { target powerpc*-*-linux* powerpc*-*-eabi* } } */
+/* { dg-do run } */
+/* { dg-require-effective-target powerpc_canonical } */
 /* { dg-options {} } */
 
 /* Test stack pointer alignment against variable alloca.  */
diff --git a/gcc/testsuite/gcc.target/powerpc/pr51623.c b/gcc/testsuite/gcc.target/powerpc/pr51623.c
index 37b7d65..948c81f 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr51623.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr51623.c
@@ -1,5 +1,7 @@
 /* PR target/51623 */
-/* { dg-do compile { target { { powerpc*-*-linux* && ilp32 } || { powerpc-*-eabi* } } } } */
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_canonical } */
+/* { dg-require-effective-target ilp32 } */
 /* { dg-options "-mrelocatable -ffreestanding" } */
 
 /* This generated an error, since the compiler was calling
diff --git a/gcc/testsuite/gcc.target/powerpc/spe-small-data-2.c b/gcc/testsuite/gcc.target/powerpc/spe-small-data-2.c
index 2a466e3..5354e49 100644
--- a/gcc/testsuite/gcc.target/powerpc/spe-small-data-2.c
+++ b/gcc/testsuite/gcc.target/powerpc/spe-small-data-2.c
@@ -1,5 +1,6 @@
 /* Verify that we don't ICE trying to put float data in .sdata2.  */
-/* { dg-do run { target { powerpc*-*-linux* && powerpc_spe } } } */
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_eabi_ok } */
 /* { dg-options "-msdata=eabi -mcall-eabi -G 8" } */
 
 double x;
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 8520c8f..6ed5f52 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -2494,6 +2494,29 @@ proc check_effective_target_arm_prefer_ldrd_strd { } {
     }  "-O2 -mthumb" ]
 }
 
+# Return 1 if this is a canonical PowerPC target.
+
+proc check_effective_target_powerpc_canonical { } {
+    if { [istarget powerpc*-*-linux*] || [istarget powerpc-*-eabi*]
+	 || [istarget powerpc-*-rtems*] } {
+	return 1;
+    } else {
+	return 0
+    }
+}
+
+# Return 1 if this is a PowerPC target supporting -meabi.
+
+proc check_effective_target_powerpc_eabi_ok { } {
+    if { [istarget powerpc*-*-*] } {
+	return [check_no_compiler_messages powerpc_eabi_ok object {
+	    int dummy;
+	} "-meabi"]
+    } else {
+	return 0
+    }
+}
+
 # Return 1 if this is a PowerPC target with floating-point registers.
 
 proc check_effective_target_powerpc_fprs { } {
-- 
1.7.7

>From 0a8c10e6f41339c16557a76dd11a4de08244acdf Mon Sep 17 00:00:00 2001
From: Sebastian Huber <sebastian.huber@embedded-brains.de>
Date: Tue, 23 Oct 2012 12:27:05 +0200
Subject: [PATCH 2/2] Test case for PR55033

2012-10-31  Sebastian Huber  <sebastian.huber@embedded-brains.de>

	PR target/55033
	* gcc.target/powerpc/pr55033.c: New.
---
 gcc/testsuite/gcc.target/powerpc/pr55033.c |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)
 create mode 100644 gcc/testsuite/gcc.target/powerpc/pr55033.c

diff --git a/gcc/testsuite/gcc.target/powerpc/pr55033.c b/gcc/testsuite/gcc.target/powerpc/pr55033.c
new file mode 100644
index 0000000..cd8abcb
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr55033.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_eabi_ok } */
+/* { dg-options "-mcpu=8540 -msoft-float -msdata=eabi -G 8 -fno-common" } */
+
+void f(void);
+
+struct s {
+  int *p;
+  int *q;
+};
+
+extern int a;
+
+extern const struct s c;
+
+const struct s c = { &a, 0 };
+
+void f(void)
+{
+  char buf[4] = { 0, 1, 2, 3 };
+}
-- 
1.7.7


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]