[Patch] OpenMP: Fix 'omp declare target' handling for vars [PR99509]

Tobias Burnus tobias@codesourcery.com
Mon Mar 15 08:17:47 GMT 2021


On 12.03.21 13:20, Jakub Jelinek wrote:
> On Wed, Mar 10, 2021 at 03:20:42PM +0100, Tobias Burnus wrote:
>> The C/C++ FE sets for an 'omp declare target' ... 'omp end declare target'
>> the attribute 'omp declare target implicit'.
>>
>> That's later processed (for C++) in decl.c - which remove that attribute
>> and either keeps and explicit 'omp declare target' or 'omp declare target link'
>> attribute.
>>
>> Unfortunately, adding 'omp declare target' comes too late as the varpool
>> has been generated.
>>
>> Looking attributes on every get rather than just once is IMHO too expensive.
>> For explicit declare target, we use:
>> ...
>> (e.g. from cp/parser.c).
>> So, I think it would be better to do the same thing

I concur. I was already wondering whether it should be in the FE or
not, thinking about some separation between FE and ME. But given
the precedent and the performance issue, it surely makes sense to
solve it in c*/*decl.c.

Done now. OK for mainline?

Tobias

-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstrasse 201, 80634 München Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Frank Thürauf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: omp-decl-tgt-v2.diff
Type: text/x-patch
Size: 4284 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20210315/477235c3/attachment.bin>


More information about the Gcc-patches mailing list