blob: 599d1f1efd50d125aaefc09d00d4f283f3948dfc (
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
34
35
36
37
|
/* { dg-options "-O2 -fdump-tree-fre -w" } */
/* { dg-options "-O2 -fdump-tree-fre -w -msse" { target { i?86-*-* x86_64-*-* } } } */
/* { dg-do compile } */
#define vector __attribute__((vector_size(sizeof(int)*4) ))
struct s { vector int i; };
vector float f(struct s *sv)
{
sv->i = (vector int){1, 2, 3, 4};
return (vector float)sv->i;
}
vector float f1(struct s *sv, vector int a)
{
sv->i = a;
return (vector float)sv->i;
}
struct s1 { int i; };
void g(struct s1 *, float);
void a1 (struct s1 sv)
{
sv.i = 1;
g(&sv, *(float*)&sv.i);
}
void a2 (struct s1 sv, int i)
{
sv.i = i;
g(&sv, *(float*)&sv.i);
}
/* { dg-final { scan-tree-dump-times "sv_\[0-9\]\\\(D\\\)->i" 2 "fre" } } */
/* { dg-final { scan-tree-dump-times "sv.i" 2 "fre" } } */
/* { dg-final { cleanup-tree-dump "fre" } } */
|