This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR78027
- From: Cesar Philippidis <cesar at codesourcery dot com>
- To: Jeff Law <law at redhat dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, <hubicka at ucw dot cz>, <mliska at suse dot cz>, Fortran List <fortran at gcc dot gnu dot org>
- Date: Fri, 9 Dec 2016 06:05:55 -0800
- Subject: Re: [PATCH] Fix PR78027
- Authentication-results: sourceware.org; auth=none
- References: <bdd55ec0-ba12-4413-e79d-1b051533ea1b@codesourcery.com> <22bd95fe-0a89-fbd6-7a1c-e9049c0ab3fc@redhat.com>
On 12/08/2016 04:37 PM, Jeff Law wrote:
> On 12/08/2016 04:05 PM, Cesar Philippidis wrote:
>> PR78027 was classified as a fortran bug, but the underlying problem
>> turned out to be more generic. Basically, the IPA-ICF pass usually
>> ignores functions with omp decl attributes as candidates for aliasing.
>> Usually that works for OpenACC, because offloaded functions generated by
>> OpenACC PARALLEL or KERNELS regions usually have an 'omp target
>> entrypoint' attribute. However that is not the case in two situations:
>>
>> 1. ACC ROUTINES do not have an 'omp target entrypoint' attribute.
>>
>> 2. Nested offloaded regions inside 'omp declare target' functions do not
>> have 'omp target entrypoint' attributes either.
>>
>> The solution I chose for this problem is to teach the IPA-ICF pass to
>> ignore function with 'oacc *' decl attributes. Arguably 2) should be a
>> parser error when an OpenACC offloaded region is embedded within an
>> OpenMP offloaded function. The LTO linker does report an error for nvptx
>> targets, but not the host. With that in mind, this patch is still
>> necessary for case 1.
>>
>> Is this OK for trunk?
>>
>> Cesar
>>
>>
>> trunk-pr78027.diff
>>
>>
>> 2016-12-08 Cesar Philippidis <cesar@codesourcery.com>
>>
>> PR fortran/78027
>>
>> gcc/
>> * ipa-icf.c (sem_function::parse): Don't process functions with
>> oacc decl attributes, as they may be OpenACC routines.
>>
>> gcc/testsuite/
>> * c-c++-common/goacc/acc-icf.c: New test.
>> * gfortran.dg/goacc/pr78027.f90: New test.
> This follows the same approach as we do for openmp. This is fine for
> the trunk.
Is this also OK for gcc-6?
Thanks,
Cesar