This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] MIPS: Fix __sync_nand for changed semantics.
- From: Adam Nemet <anemet at caviumnetworks dot com>
- To: Uros Bizjak <ubizjak at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, David Daney <ddaney at caviumnetworks dot com>
- Date: Sun, 07 Dec 2008 18:03:43 -0800
- Subject: Re: [PATCH] MIPS: Fix __sync_nand for changed semantics.
- References: <493AC0FA.6080900@gmail.com>
Uros Bizjak <ubizjak@gmail.com> writes:
>> We do however suffer a new failure in gcc.target/mips/atomic-memory-1.c,
>> which is due to the change in semantics. Someone will have to fix this
>> with a separate patch to the testcase.
>
> Can you test the attached patch? It should fix all remaining failures in
> gcc.dg/mips directory.
Yes it fixes the failures. Tested on mips64octeon-linux-gnu. Thanks for the
fix.
Adam
>
> Thanks,
> Uros.
>
> Index: fix-r10000-6.c
> ===================================================================
> --- fix-r10000-6.c (revision 142523)
> +++ fix-r10000-6.c (working copy)
> @@ -2,6 +2,8 @@
> /* { dg-mips-options "-O2 -march=mips4 -mfix-r10000" } */
> /* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */
>
> +/* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */
> +
> NOMIPS16 int
> f1 (int *z)
> {
> Index: fix-r10000-12.c
> ===================================================================
> --- fix-r10000-12.c (revision 142523)
> +++ fix-r10000-12.c (working copy)
> @@ -2,6 +2,8 @@
> /* { dg-mips-options "-O2 -march=mips4 -mfix-r10000" } */
> /* { dg-final { scan-assembler-times "\tbeql\t" 3 } } */
>
> +/* { dg-message "note: '__sync_nand_and_fetch' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */
> +
> NOMIPS16 int
> f1 (int *z)
> {
> Index: atomic-memory-1.c
> ===================================================================
> --- atomic-memory-1.c (revision 142523)
> +++ atomic-memory-1.c (working copy)
> @@ -1,4 +1,7 @@
> /* { dg-do run } */
> +
> +/* { dg-message "note: '__sync_nand_and_fetch' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */
> +
> extern void abort (void);
> extern void exit (int);
>
> @@ -16,9 +19,9 @@ NOMIPS16 int main ()
> __sync_sub_and_fetch (&v, 0x7fff);
> if (v != 34465)
> abort();
> - if (__sync_nand_and_fetch (&v, 0xff) != 94)
> + if (__sync_nand_and_fetch (&v, 0xff) != -162)
> abort();
> - if (__sync_fetch_and_add (&v, 6) != 94)
> + if (__sync_fetch_and_add (&v, 262) != -162)
> abort();
> if (v != 100)
> abort();