[PATCH, PR69599] Fix GOMP/GOACC_parallel optimization in ipa-pta
Tom de Vries
Tom_deVries@mentor.com
Mon Feb 8 09:53:00 GMT 2016
Hi,
when compiling the fipa-pta tests in the libgomp testsuite
(omp-nested-2.c, pr46032.c) with -flto -flto-partition=max, the tests
fail in execution (PR69599).
The problem is related to the GOMP/GOACC_parallel optimization we do in
fipa-pta, where we interpret a call GOMP_parallel (&foo._0, data) as a
call foo._0 (data).
The problem is that this optimization is only legal in lto if both:
- foo containing the call GOMP_parallel (&foo._0, data) and
- foo._0
are contained in the same partition.
In the case of -flto-partition=max, foo is contained in it's own
partition, and foo._0 is contained in another partition. This means the
data argument to the GOMP_parallel call appears unused, and the setting
of the argument is optimized away, which causes the execution failure.
This patch fixes that by testing if foo and foo._0 are part of the same
partition.
[ Note that the node_address_taken change in the patch has no effect,
since nonlocal_p already tests for used_from_other_partition. But I
thought it was clearer to state the conditions under which we are
allowed to ignore node->address_taken explicitly. ]
Bootstrapped and reg-tested on x86_64.
Build for nvidia accelerator and reg-tested libgomp with various lto
settings.
OK for trunk, stage4?
Thanks,
- Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-GOMP-GOACC_parallel-optimization-in-ipa-pta.patch
Type: text/x-patch
Size: 5866 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20160208/309006ee/attachment.bin>
More information about the Gcc-patches
mailing list