Patchwork Potential fix for PR55033

login
register
mail settings
Submitter Sebastian Huber
Date Oct. 26, 2012, 12:22 p.m.
Message ID <508A808B.1020807@embedded-brains.de>
Download mbox | patch
Permalink /patch/194464/
State New
Headers show

Comments

Sebastian Huber - Oct. 26, 2012, 12:22 p.m.
Hello,

here is a test case for PR55033.
Sebastian Huber - Oct. 30, 2012, 1:45 p.m.
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.
Alan Modra - Oct. 31, 2012, 12:12 a.m.
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 } */

Patch

From bc2020280660d5b133d907543e6d666d6c9e05e5 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] Test case for PR55033

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

        * gcc.target/powerpc/pr55033.c: New.
---
 gcc/testsuite/gcc.target/powerpc/pr55033.c |   20 ++++++++++++++++++++
 1 files changed, 20 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..6b27039
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr55033.c
@@ -0,0 +1,20 @@ 
+/* { dg-do compile } */
+/* { dg-options "-mcpu=8540 -msoft-float -meabi -msdata" } */
+
+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