This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] OpenACC use_device clause ICE fix


On 01/21/2016 03:22 PM, Chung-Lin Tang wrote:
On 2016/1/20 09:17 PM, Bernd Schmidt wrote:
On 01/05/2016 02:15 PM, Chung-Lin Tang wrote:
     * omp-low.c (scan_sharing_clauses): Call add_local_decl() for
     use_device/use_device_ptr variables.

It looks vaguely plausible, but if everything is part of the host
function, why make a copy of the decl at all? I.e. what happens if you
just remove the install_var_local call?

Because (only) inside the OpenMP context, the variable is supposed to
contain the device-side value; a runtime call is used to obtain the
value from the device back to host.  So a new variable is created, the
remap_decl mechanisms are used to change references inside the omp
context, and other references of the original variable are not touched.

Hmm, ok. Let's go with your patch then.


Bernd


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]