https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65752

--- Comment #57 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #56)
> 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;
> }

With the C provenance proposal this example is undefined since 'a' is not
exposed (it's address is not converted to an integer).  The testcase
also relies on preserving the order of the variables on the stack.

Reply via email to