Open
Description
The second load of x
is redundant because, even if y
aliases with x
, the final value will still be z
https://godbolt.org/z/GKdPrPj6T
int src(int* x, int* y, int z) {
*x = z;
*y = z;
return *x;
}
int tgt(int* x, int* y, int z) {
*x = z;
*y = z;
return z;
}
src:
str w2, [x0]
str w2, [x1]
ldr w0, [x0]
ret
tgt:
str w2, [x0]
mov w0, w2
str w2, [x1]
ret