[Bug tree-optimization/65752] Too strong optimizations int -> pointer casts
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Jan 8 08:31:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65752
--- Comment #56 from Richard Biener <rguenth at gcc dot gnu.org> ---
Testcase from PR82177:
#include <stdio.h>
#include <stdint.h>
void f(int*, int*);
int main()
{
int a=0, y[1], x = 0;
uintptr_t pi = (uintptr_t) &x;
uintptr_t yi = (uintptr_t) (y+1);
uintptr_t n = pi != yi;
if (n) {
a = 100;
pi = yi;
}
if (n) {
a = 100;
pi = (uintptr_t) y;
}
*(int *)pi = 15;
printf("a=%d x=%d\n", a, x);
f(&x,y);
return 0;
}
More information about the Gcc-bugs
mailing list