OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [tm/] [pub-safety-1.c] - Blame information for rev 801

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-fgnu-tm -O1 -fdump-tree-lim1" } */
3
 
4
/* Test that thread visible loads do not get hoisted out of loops if
5
   the load would not have occurred on each path out of the loop.  */
6
 
7
int x[10] = {0,0,0,0,0,0,0,0,0,0};
8
int DATA_DATA = 0;
9
 
10
void reader()
11
{
12
  int i;
13
  __transaction_atomic
14
    {
15
      for (i = 0; i < 10; i++)
16
        if (x[i])
17
          x[i] += DATA_DATA;
18
      /* If we loaded DATA_DATA here, we could hoist it before the loop,
19
         but since we don't... we can't.  */
20
    }
21
}
22
 
23
/* { dg-final { scan-tree-dump-times "Cannot hoist.*DATA_DATA because it is in a transaction" 1 "lim1" } } */
24
/* { dg-final { cleanup-tree-dump "lim1" } } */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.