summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr24257.c
blob: d685df63d52d9e84b2abe773dad6948e9d5c896c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* { dg-do compile } */
/* { dg-options "-fgcse -fgcse-sm" } */

typedef struct A {
    int buf, left;
} A;

static void flush(A *s, int n)
{
    s->buf <<= n;

    while (s->left < 32) {
        s->buf <<= 8;
        s->left += 8;
    }

    s->buf=0;
}

void oof(A *s, int n)
{
    s->buf = n;
    s->left = n;

    flush(s, n);
}