This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Duplicate constraints in ipa-pta
- From: Tom de Vries <Tom_deVries at mentor dot com>
- To: Richard Biener <rguenther at suse dot de>
- Cc: gcc Development <gcc at gcc dot gnu dot org>
- Date: Wed, 28 Oct 2015 08:06:12 +0100
- Subject: Duplicate constraints in ipa-pta
- Authentication-results: sourceware.org; auth=none
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