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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [tree-ssa/] [ssa-sink-5.c] - Blame information for rev 298

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-Os -fdump-tree-sink-stats" } */
3
 
4
typedef short int16_t;
5
typedef unsigned char uint8_t;
6
 
7
void foo(int16_t runs[], uint8_t alpha[], int x, int count)
8
{
9
    int16_t* next_runs = runs + x;
10
    uint8_t*  next_alpha = alpha + x;
11
 
12
    while (x > 0)
13
    {
14
        int n = runs[0];
15
 
16
        if (x < n)
17
        {
18
            alpha[x] = alpha[0];
19
            runs[0] = (int16_t)(x);
20
            runs[x] = (int16_t)(n - x);
21
            break;
22
        }
23
        runs += n;
24
        alpha += n;
25
        x -= n;
26
    }
27
 
28
    runs = next_runs;
29
    alpha = next_alpha;
30
    x = count;
31
 
32
   for (;;)
33
    {
34
        int n = runs[0];
35
 
36
        if (x < n)
37
        {
38
            alpha[x] = alpha[0];
39
            break;
40
        }
41
        x -= n;
42
        runs += n;
43
   }
44
}
45
 
46
/* We should not sink the next_runs = runs + x calculation after the loop.  */
47
/* { dg-final { scan-tree-dump-times "Sunk statements:" 0 "sink" } } */
48
/* { dg-final { cleanup-tree-dump "sink" } } */

powered by: WebSVN 2.1.0

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