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

Chung-Kil Hur <gil.hur at sf dot snu.ac.kr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gil.hur at sf dot snu.ac.kr

--- Comment #13 from Chung-Kil Hur <gil.hur at sf dot snu.ac.kr> ---
Hi, I have the following modified code.

#include <stdio.h>
#include <stdint.h>
#include <limits.h>

int main() {
  int x = 0, *p = 0;
  uintptr_t i;
  uintptr_t j = (uintptr_t) &x;
  uintptr_t k = j+j;
  uintptr_t l = 2*j - j - j;
  for (i = j+j-k+l; ; i++) {
    if (i == (uintptr_t)&x) { p = (int*)i; break; }
  }
  *p = 15;

  printf("%d\n", x);
}

This example still prints out "0" instead of "15".
In this example, it seems that the integer "j+j-k+l" has no provenance.
It is unclear to me how the provenance is calculated.
Is there any concrete rule for calculating provenance?

Reply via email to