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

Richard Biener rguenther@suse.de
Mon Feb 8 10:54:00 GMT 2016


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?

Thanks,
Richard.

> 
> Thanks,
> - Tom
> 

-- 
Richard Biener <rguenther@suse.de>
SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg)



More information about the Gcc-patches mailing list