blob: 0ff4bab23e697fa655dd05842ebb5015af6ecdaf (
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
27
28
29
30
31
32
33
|
/* PR rtl-optimization/79032 */
/* Reported by Daniel Cederman <cederman@gaisler.com> */
extern void abort (void);
struct S {
short a;
long long b;
short c;
char d;
unsigned short e;
long *f;
};
static long foo (struct S *s) __attribute__((noclone, noinline));
static long foo (struct S *s)
{
long a = 1;
a /= s->e;
s->f[a]--;
return a;
}
int main (void)
{
long val = 1;
struct S s = { 0, 0, 0, 0, 2, &val };
val = foo (&s);
if (val != 0)
abort ();
return 0;
}
|