annotate gcc/testsuite/gcc.dg/tm/memopt-9.c @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +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 } */
kono
parents:
diff changeset
2 /* { dg-options "-fgnu-tm -O -fdump-tree-tmmark" } */
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 extern int something(void) __attribute__((transaction_safe));
kono
parents:
diff changeset
5 extern void *malloc (__SIZE_TYPE__) __attribute__((malloc,transaction_safe));
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 struct large { int foo[500]; };
kono
parents:
diff changeset
8
kono
parents:
diff changeset
9 int f()
kono
parents:
diff changeset
10 {
kono
parents:
diff changeset
11 int *p;
kono
parents:
diff changeset
12 struct large *lp;
kono
parents:
diff changeset
13
kono
parents:
diff changeset
14 __transaction_atomic {
kono
parents:
diff changeset
15 p = malloc (sizeof (*p) * 100);
kono
parents:
diff changeset
16 lp = malloc (sizeof (*lp) * 100);
kono
parents:
diff changeset
17
kono
parents:
diff changeset
18 /* No instrumentation necessary; P and LP are transaction local. */
kono
parents:
diff changeset
19 p[5] = 123;
kono
parents:
diff changeset
20 lp->foo[66] = 123;
kono
parents:
diff changeset
21
kono
parents:
diff changeset
22 if (something())
kono
parents:
diff changeset
23 __transaction_cancel;
kono
parents:
diff changeset
24 }
kono
parents:
diff changeset
25 return p[5];
kono
parents:
diff changeset
26 }
kono
parents:
diff changeset
27
kono
parents:
diff changeset
28 /* { dg-final { scan-tree-dump-times "ITM_WU" 0 "tmmark" } } */