annotate gcc/testsuite/gcc.dg/pr57134.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* { dg-do compile } */
kono
parents:
diff changeset
2 /* { dg-require-effective-target stdint_types } */
kono
parents:
diff changeset
3 /* { dg-options "-O2" } */
kono
parents:
diff changeset
4 /* { dg-options "-O2 -mstrict-align" { target { powerpc*-*-linux* powerpc*-*-elf* } } } */
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 #include <stdint.h>
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 typedef struct {
kono
parents:
diff changeset
9 int64_t counter;
kono
parents:
diff changeset
10 } atomic64_t;
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 struct buffer_page {
kono
parents:
diff changeset
13 void *a, *b;
kono
parents:
diff changeset
14 atomic64_t entries;
kono
parents:
diff changeset
15 };
kono
parents:
diff changeset
16
kono
parents:
diff changeset
17 static __inline__ __attribute__((always_inline)) int64_t
kono
parents:
diff changeset
18 atomic64_read(const atomic64_t *v)
kono
parents:
diff changeset
19 {
kono
parents:
diff changeset
20 int64_t t;
kono
parents:
diff changeset
21 __asm__ __volatile__("" : "=r"(t) : "m"(v->counter));
kono
parents:
diff changeset
22 return t;
kono
parents:
diff changeset
23 }
kono
parents:
diff changeset
24
kono
parents:
diff changeset
25 int rb_remove_pages(void *p)
kono
parents:
diff changeset
26 {
kono
parents:
diff changeset
27 struct buffer_page *blah = (void *)((intptr_t) p & -4);
kono
parents:
diff changeset
28 return atomic64_read(&blah->entries);
kono
parents:
diff changeset
29 }