Hi Andrew,
Nice example! But it perfectly works, in both cases, and even others. Let's
consider the file:
#include <stdio.h>
#define N 10
void kix_o_main() {
int a[N], i, j, k, *p;
FILE *f;
f = fopen("in", "rw");
f = fopen("in", &"rw"[0]);
f = fopen("in", &"11\0rw"[3]);
f = fopen("in", "11\0rw"+3);
if(p == NULL)
a[i] = a[i] * k + j;
return;
}
So, let's try:
[nic@paco C]$ ~/Gcc/graphite/inst/bin/gcc -c --tree-check="%X=fopen(%_,%Y)"
--tree-checks-verbose --dump-tree-gimple c.c
c.c: In function 'kix_o_main':
c.c:9: warning: user-defined warning %X=fopen(%_,%Y): .
c.c:9: instance = {X <- f, Y <- &"rw"[0]},
c.c:9: reached: f = f.0.
c.c:10: warning: user-defined warning %X=fopen(%_,%Y): .
c.c:10: instance = {X <- f, Y <- &"rw"[0]},
c.c:10: reached: f = f.1.
c.c:11: warning: user-defined warning %X=fopen(%_,%Y): .
c.c:11: instance = {X <- f, Y <- D.2121},
c.c:11: reached: f = f.2.
c.c:12: warning: user-defined warning %X=fopen(%_,%Y): .
c.c:12: instance = {X <- f, Y <- D.2123},
c.c:12: reached: f = f.3.
Everything is there!