TREE_ADDRESSABLE problem
Jan Hubicka
jh@suse.cz
Wed Nov 19 23:17:00 GMT 2003
Hi,
the following testcase taken from testustie:
typedef struct {
int a, b, c, d, e, f;
} A;
void foo (A *v, int w1, int x, int *y, int *z)
{
}
void
bar (A *v, int x, int y, int w2, int h)
{
if (v->a != x || v->b != y) {
int oldw = w2;
int oldh = h;
int e = v->e;
int f = v->f;
int dx, dy;
foo(v, 0, 0, &w2, &h);
dx = (oldw - w2) * (double) e/2.0;
dy = (oldh - h) * (double) f/2.0;
x += dx;
y += dy;
v->a = x;
v->b = y;
v->c = w2;
v->d = h;
}
}
int main ()
{
A w = { 100, 110, 20, 30, -1, -1 };
bar (&w,400,420,50,70);
if (w.d != 70)
abort();
exit(0);
}
Does not pass TREE_ADDRESSABLE check with my checking code with -O3.
The problem is that we first compile function bar, inline foo and
elliminate reference to w2, clear TREE_ADDRESSABLE in must_alias pass.
Then we inline bar body into main but TREE_ADDRESSABLE is not set even
though it is used.
What to do? Re-setting TREE_ADDRESSABLE in tree-inline looks like
sollution. Better ideas?
Honza
More information about the Gcc
mailing list