[PATCH, PR69599] Fix GOMP/GOACC_parallel optimization in ipa-pta

Tom de Vries Tom_deVries@mentor.com
Mon Feb 8 21:12:00 GMT 2016

On 08/02/16 11:54, Richard Biener wrote:
> On Mon, 8 Feb 2016, Tom de Vries wrote:
>> 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?
> I don't like the in_lto_p checks, why's the check not working
> for non-LTO?

I was not sure if the partition flags were valid outside lto.

Updated patch removes the in_lto_p checks.

Bootstrapped on x86_64.

Build and reg-tested libgomp testsuite.


- Tom

- 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: 5787 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20160208/624e75b9/attachment.bin>

More information about the Gcc-patches mailing list