This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/65752] Too strong optimizations int -> pointer casts
- From: "ch3root at openwall dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 15 Nov 2015 21:38:40 +0000
- Subject: [Bug tree-optimization/65752] Too strong optimizations int -> pointer casts
- Auto-submitted: auto-generated
- References: <bug-65752-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65752
--- Comment #40 from Alexander Cherepanov <ch3root at openwall dot com> ---
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);
}
print 0 too even though it should print 1.