aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/compile/sync-1.c
diff options
context:
space:
mode:
authorUros Bizjak <ubizjak@gmail.com>2008-11-17 11:19:06 +0000
committerUros Bizjak <ubizjak@gmail.com>2008-11-17 11:19:06 +0000
commit0c465689e60d593b5ba6f441aeab69b04429ece9 (patch)
treeec588937bd71d8c137cd8e58e26176a069ebf17b /gcc/testsuite/gcc.c-torture/compile/sync-1.c
parentb4d30c78d3880ce3f54d382962b14ac2923488d8 (diff)
PR middle-end/37908
* optabs.c (expand_sync_operation): Properly handle NAND case by calculating ~(t1 & val) instead of (~t1 & val). * builtins.c (expand_builtin_sync_operation): Warn for changed semantics in NAND builtins. * c.opt (Wsync-nand): New warning option. Describe -Wsync-nand. * doc/invoke.texi (Warning options): Add Wsync-nand. * doc/extend.texi (Atomic Builtins) [__sync_fetch_and_nand]: Correct __sync_fetch_and_nand builtin operation in the example. Add a note about changed semantics in GCC 4.4. [__sync_nand_and_fetch]: Correct __sync_nand_and_fetch builtin operation in the example. Add a note about changed semantics in GCC 4.4. testsuite/ChangeLog: PR middle-end/37908 * gcc.dg/pr37908.c: New test. * gcc.dg/ia64-sync-1.c: Correct __sync_fetch_and_nand and __sync_nand_and_fetch results. Add dg-message to look for the warning about changed semantics of NAND builtin. (init_si, init_di): Change init value for __sync_fetch_and_nand to -1. (test_si, test_di): Change expected result of __sync_nand_and_fetch to ~7. * gcc.dg/ia64-sync-2.c: Correct __sync_fetch_and_nand and __sync_nand_and_fetch results. Add dg-message to look for the warning about changed semantics of NAND builtin. (init_noret_si, init_noret_di): Change init value for __sync_fetch_and_nand to -1. (init_noret_si, init_noret_di): Change expected result of __sync_nand_and_fetch to ~7. * gcc.dg/sync-2.c: Correct __sync_fetch_and_nand and __sync_nand_and_fetch results. Add dg-message to look for the warning about changed semantics of NAND builtin. (init_qi, init_qi): Change init value for __sync_fetch_and_nand to -1. (init_hi, init_hi): Change expected result of __sync_nand_and_fetch to ~7. * gcc.dg/sync-3.c: Copy from sync-2.c instead of including the c source file. * gcc.c-torture/compile/sync-1.c: Add dg-message to look for the warning about changed semantics of NAND builtin. * gcc.c-torture/compile/sync-2.c: Ditto. * gcc.c-torture/compile/sync-3.c: Ditto. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@141942 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/compile/sync-1.c')
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/sync-1.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/compile/sync-1.c b/gcc/testsuite/gcc.c-torture/compile/sync-1.c
index 1703aaf267f..0354923d2dd 100644
--- a/gcc/testsuite/gcc.c-torture/compile/sync-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/sync-1.c
@@ -1,3 +1,6 @@
+/* { dg-message "note: '__sync_fetch_and_nand' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */
+/* { dg-message "note: '__sync_nand_and_fetch' changed semantics in GCC 4.4" "" { target *-*-* } 0 } */
+
/* Validate that each of the __sync builtins compiles. This won't
necessarily link, since the target might not support the builtin,
so this may result in external library calls. */