https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66714
cesar at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |cesar at gcc dot gnu.org --- Comment #20 from cesar at gcc dot gnu.org --- Created attachment 36030 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36030&action=edit replace block vars fix Tom, thanks for your detailed analysis and reduced test case. As you suspected, replace_block_vars_by_duplicates isn't updating the DECL_VALUE_EXPR properly. That function is setting the value expr to be the original decl, not the new offloaded copy. My patch teaches it how to use an offloaded copy. All of the value exprs we're interested in for openacc are INDIRECT_REFs and I think that holds true for openmp too. Fortran cray pointers caused some minor problems because those get represented by a INDIRECT_REF to a CONVERT_EXPR as you in the patch. I tested this patch in gomp-4_0-branch libgomp and everything appears to work. Does this issue present in trunk too? Cesar