This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/65752] Too strong optimizations int -> pointer casts


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]