Region store was not able to see through this case to the actual
initialized value of STRUCT ff. This change addresses this case by
getting the direct binding. This was found and debugged in a downstream
compiler, with debug guidance from @steakhal. A positive and negative
test case is added.
The specific case where this issue was exposed.
typedef struct { int a:1; int b[2]; } STRUCT; int main() { STRUCT ff = {0}; STRUCT* pff = &ff; int a = ((int)pff + 1); return a; }
@steakhal @martong @NoQ
Isn't this actually a false positive here?
(int *)pff + 2 points to ff.b[1], which is initialized to 0.
https://godbolt.org/z/Gh8a4aMe8