[Bug tree-optimization/65752] Too strong optimizations int -> pointer casts
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Nov 15 21:48:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65752
--- Comment #41 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Alexander Cherepanov from comment #40)
> Ok, this program:
>
> #include <stdint.h>
> #include <stdio.h>
>
> int main() {
> int y, x = 0;
> int *volatile v = &x;
> int *xp = v;
> int *i = &y + 1;
>
> if (xp != i) {
> printf("hello\n");
> xp = i;
> }
>
> printf("%d\n", xp == &x);
> }
>
Still undefined as &x and &y + 1 are not comparable.
More information about the Gcc-bugs
mailing list