blob: b0936be5e7756b2484352ca2993ebf2a730cf9db (
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
|
/* PR100112 and dups. */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-fre1-details -fdump-tree-optimized" } */
int *c, *b;
void foo()
{
int *tem = b;
*tem = 0;
int *footem = c;
c = footem;
}
void bar()
{
int *tem = b;
int *bartem = c;
*tem = 0;
c = bartem;
}
/* We should elide the redundant store in foo, in bar it is not redundant since
the *tem = 0 store might alias. */
/* { dg-final { scan-tree-dump "Deleted redundant store c = footem" "fre1" } } */
/* { dg-final { scan-tree-dump "c = bartem" "optimized" } } */
|