comparison gcc/testsuite/gcc.dg/pr67043.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
1 /* { dg-do compile } */
2 /* { dg-options "-O3 -fcompare-debug -w" } */
3
4 extern void rt_mutex_owner (void);
5 extern void rt_mutex_deadlock_account_lock (int);
6 extern void signal_pending (void);
7 __typeof__ (int *) a;
8 int b;
9
10 int
11 try_to_take_rt_mutex (int p1) {
12 rt_mutex_owner ();
13 if (b)
14 return 0;
15 rt_mutex_deadlock_account_lock (p1);
16 return 1;
17 }
18
19 void
20 __rt_mutex_slowlock (int p1) {
21 int c;
22 for (;;) {
23 c = ({
24 asm ("" : "=r"(a));
25 a;
26 });
27 if (try_to_take_rt_mutex (c))
28 break;
29 if (__builtin_expect (p1 == 0, 0))
30 signal_pending ();
31 }
32 }