Richard,
when compiling this testcase:
...
static int __attribute__((noinline, noclone))
foo (int *a, int *b)
{
*b = 1;
*a = 2;
return *b;
}
int __attribute__((noinline, noclone))
bar (int *a, int *b)
{
return foo (a, b);
}
...
with -O2 -fipa-pta we find in the pta dumpfile:
...
Generating constraints for bar (bar)
bar.arg0 = &NONLOCAL
bar.arg1 = &NONLOCAL
bar.arg1 = &NONLOCAL
...
The reason for the duplicate last two constraints is that with fipa-pta,
in create_function_info_for we link the function arguments in a next chain.
And in intra_create_variable_infos there are two iteration mechanism used:
- the loop over the function arguments
- the loop over the vi_next (p) for each function argument p
So when processing argument a, we generate constraints for both a and
it's next b.
And when processing argument b, we generate constraints for b again.
Is this a known issue? Should we fix this?
Thanks,
- Tom