annotate gcc/testsuite/gcc.dg/tm/pub-safety-1.c @ 132:d34655255c78

update gcc-8.2
author mir3636
date Thu, 25 Oct 2018 10:21:07 +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 -O1 -fdump-tree-lim2" } */
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 /* Test that thread visible loads do not get hoisted out of loops if
kono
parents:
diff changeset
5 the load would not have occurred on each path out of the loop. */
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 int x[10] = {0,0,0,0,0,0,0,0,0,0};
kono
parents:
diff changeset
8 int DATA_DATA = 0;
kono
parents:
diff changeset
9
kono
parents:
diff changeset
10 void reader()
kono
parents:
diff changeset
11 {
kono
parents:
diff changeset
12 int i;
kono
parents:
diff changeset
13 __transaction_atomic
kono
parents:
diff changeset
14 {
kono
parents:
diff changeset
15 for (i = 0; i < 10; i++)
kono
parents:
diff changeset
16 if (x[i])
kono
parents:
diff changeset
17 x[i] += DATA_DATA;
kono
parents:
diff changeset
18 /* If we loaded DATA_DATA here, we could hoist it before the loop,
kono
parents:
diff changeset
19 but since we don't... we can't. */
kono
parents:
diff changeset
20 }
kono
parents:
diff changeset
21 }
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23 /* { dg-final { scan-tree-dump-times "Cannot hoist.*DATA_DATA because it is in a transaction" 1 "lim2" } } */