blob: 3a0e94d4115e3f0cc2ca1aea9f9c8519fdc81194 (
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
38
39
40
41
42
43
|
/* { dg-do link { target natural_alignment_32 } } */
/* { dg-options "-O -fdump-tree-fre1-details" } */
void link_error (void);
void test1 (int *p, int *q)
{
*p = 1;
*q = 1;
if (*p != 1)
link_error ();
}
void test2 (int *p, int *q, int t)
{
*p = t;
*q = t;
if (*p != t)
link_error ();
}
void test3 (int *q, int *p)
{
int tem = *p;
*q = tem;
if (*p != tem)
link_error ();
}
char a[4];
struct A { char a[4]; };
void test4 (struct A *p)
{
a[0] = p->a[0];
a[0] = p->a[0];
a[0] = p->a[0];
}
int main() { return 0; }
/* { dg-final { scan-tree-dump-times "Replaced \\\*p" 3 "fre1" } } */
/* { dg-final { scan-tree-dump-times "Replaced p_.\\(D\\)->" 2 "fre1" } } */
/* { dg-final { scan-tree-dump-times "Deleted redundant store a\\\[0\\\]" 2 "fre1" } } */
|