This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[4.1] s390 legitimize_address (was Re: [PATCH] Fix i386/x86_64 legitimize_pic_address (PR target/29198))
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Ulrich Weigand <Ulrich dot Weigand at de dot ibm dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 2 Oct 2006 03:12:46 -0400
- Subject: [4.1] s390 legitimize_address (was Re: [PATCH] Fix i386/x86_64 legitimize_pic_address (PR target/29198))
- References: <20060929124100.GT20982@devserv.devel.redhat.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Sep 29, 2006 at 08:41:00AM -0400, Jakub Jelinek wrote:
> 2006-09-29 Jakub Jelinek <jakub@redhat.com>
>
> PR target/29198
> * gcc.dg/tls/opt-12.c: New test.
This testcase fails also on s390{,x}, on gcc-4_1-branch only.
This has been fixed on the trunk with
http://gcc.gnu.org/ml/gcc-patches/2006-02/msg01419.html
Ok to svn merge it from the trunk?
> --- gcc/testsuite/gcc.dg/tls/opt-12.c 2006-09-29 13:47:11.000000000 +0200
> +++ gcc/testsuite/gcc.dg/tls/opt-12.c 2006-09-29 13:47:11.000000000 +0200
> @@ -0,0 +1,50 @@
> +/* PR target/29198 */
> +/* { dg-do run } */
> +/* { dg-options "-O2 -fpic" } */
> +/* { dg-require-effective-target tls_runtime } */
> +/* { dg-require-effective-target fpic } */
> +
> +extern void abort (void);
> +
> +int f2 (int, int, int, int);
> +struct s { char b[4]; };
> +__thread struct s thra[2];
> +
> +void
> +__attribute__((noinline))
> +f1 (int a1, int a2)
> +{
> + int i, j;
> + for (i = 0; i < 4; i++)
> + {
> + int tot = 0;
> + for (j = 0; j < 4; j++)
> + tot += f2 (a1, a2, i, j);
> + *(&thra[0].b[0] + i) = tot;
> + }
> +}
> +
> +int
> +__attribute__((noinline))
> +f2 (int a, int b, int c, int d)
> +{
> + return a + b + c + d;
> +}
> +
> +int
> +main (void)
> +{
> + f1 (0, 0);
> + if (thra[0].b[0] != 6
> + || thra[0].b[1] != 10
> + || thra[0].b[2] != 14
> + || thra[0].b[3] != 18)
> + abort ();
> + f1 (2, 3);
> + if (thra[0].b[0] != 26
> + || thra[0].b[1] != 30
> + || thra[0].b[2] != 34
> + || thra[0].b[3] != 38)
> + abort ();
> + return 0;
> +}
Jakub