annotate gcc/testsuite/gcc.dg/tm/memopt-15.c @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* { dg-do compile { target { i?86-*-linux* x86_64-*-linux* } } } */
kono
parents:
diff changeset
2 /* { dg-options "-fgnu-tm -O -msse2" } */
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 /* Test the TM vector logging functions. */
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 typedef int __attribute__((vector_size (16))) vectype;
kono
parents:
diff changeset
7 extern int something(void) __attribute__((transaction_safe));
kono
parents:
diff changeset
8 extern void *malloc (__SIZE_TYPE__) __attribute__((malloc,transaction_safe));
kono
parents:
diff changeset
9
kono
parents:
diff changeset
10 vectype vecky;
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 vectype f()
kono
parents:
diff changeset
13 {
kono
parents:
diff changeset
14 vectype *p;
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 p = malloc (sizeof (*p) * 100);
kono
parents:
diff changeset
17
kono
parents:
diff changeset
18 __transaction_atomic {
kono
parents:
diff changeset
19 /* p[5] is thread private, but not transaction local since the
kono
parents:
diff changeset
20 malloc is outside of the transaction. We can use the logging
kono
parents:
diff changeset
21 functions for this. */
kono
parents:
diff changeset
22 p[5] = vecky;
kono
parents:
diff changeset
23
kono
parents:
diff changeset
24 if (something())
kono
parents:
diff changeset
25 __transaction_cancel;
kono
parents:
diff changeset
26 }
kono
parents:
diff changeset
27 return p[5];
kono
parents:
diff changeset
28 }
kono
parents:
diff changeset
29
kono
parents:
diff changeset
30 /* { dg-final { scan-assembler "_ITM_LM128" } } */