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]

[Committed] Testsuite: Add a typecast to the latest sync-{2|3}.c changes


Hello,

the attached patch fixes a minor glitch in the atomic builtin
testcases.  Without the type cast of the rhs the comparisons always
evaluate to false.

Committed to mainline as obvious.
The two testcase work on S/390 with that change.

Bye,

-Andreas-

2008-11-20  Andreas Krebbel  <krebbel1@de.ibm.com>

	* gcc.dg/sync-2.c: Add type cast to avoid folding.
	* gcc.dg/sync-3.c: Likewise.


Index: gcc/testsuite/gcc.dg/sync-2.c
===================================================================
*** gcc/testsuite/gcc.dg/sync-2.c.orig	2008-11-19 16:53:34.000000000 +0100
--- gcc/testsuite/gcc.dg/sync-2.c	2008-11-20 22:48:08.000000000 +0100
*************** do_qi (void)
*** 46,52 ****
      abort ();
    if (__sync_xor_and_fetch(AI+16, 9) != 9)
      abort ();
!   if (__sync_nand_and_fetch(AI+17, 7) != ~7)
      abort ();
  }
  
--- 46,52 ----
      abort ();
    if (__sync_xor_and_fetch(AI+16, 9) != 9)
      abort ();
!   if (__sync_nand_and_fetch(AI+17, 7) != (char)~7)
      abort ();
  }
  
Index: gcc/testsuite/gcc.dg/sync-3.c
===================================================================
*** gcc/testsuite/gcc.dg/sync-3.c.orig	2008-11-19 16:53:34.000000000 +0100
--- gcc/testsuite/gcc.dg/sync-3.c	2008-11-20 22:46:40.000000000 +0100
*************** do_qi (void)
*** 43,49 ****
      abort ();
    if (__sync_xor_and_fetch(AI+16, 9) != 9)
      abort ();
!   if (__sync_nand_and_fetch(AI+17, 7) != ~7) /* { dg-message "note: '__sync_nand_and_fetch' changed semantics in GCC 4.4" "" } */
      abort ();
  }
  
--- 43,49 ----
      abort ();
    if (__sync_xor_and_fetch(AI+16, 9) != 9)
      abort ();
!   if (__sync_nand_and_fetch(AI+17, 7) != (char)~7) /* { dg-message "note: '__sync_nand_and_fetch' changed semantics in GCC 4.4" "" } */
      abort ();
  }
  


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