https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86416

            Bug ID: 86416
           Summary: [OMPVV SOLLVE] Defaultmap issues on OpenMP 4.5
           Product: gcc
           Version: 8.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: josem at udel dot edu
  Target Milestone: ---

Created attachment 44357
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44357&action=edit
Reproducible code

Hi everyone, 

I hope this is useful

There are a couple of issues with the default mapping of scalar values on
device offloading of OpenMP 4.5 using gfortran. 

Please refer to the attached reproducible in which I have added #ifdef segments
to separate one issue from the other one.

I tried two different systems: power8 and Intel. And two versions of GCC 7.1.1
and 8.1.0

> gcc -v  #system1 GCC 8.1.0
> Using built-in specs.
> COLLECT_GCC=gcc
> COLLECT_LTO_WRAPPER=path/to/gcc/8.1/bin/../libexec/gcc/x86_64-pc-linux-gnu/8.1.0/lto-wrapper
> OFFLOAD_TARGET_NAMES=nvptx-none
> Target: x86_64-pc-linux-gnu
> Configured with: ../gcc_8_1_0_release/configure 
> --enable-offload-targets=nvptx-none 
> --with-cuda-driver-include=/software/apps/cuda/9.2/include/ 
> --with-cuda-driver-lib=/software/apps/cuda/9.2/lib64/ --disable-bootstrap 
> --disable-multilib --enable-languages=c,c++,fortran,lto 
> --prefix=/software/apps/gcc/8.1
> Thread model: posix
> gcc version 8.1.0 (GCC)

> gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/path/to/gcc/7.1.1-20170802/bin/../libexec/gcc/powerpc64le-unknown-linux-gnu/7.1.1/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
Target: powerpc64le-unknown-linux-gnu
Configured with: ../gcc/configure --enable-offload-targets=nvptx-none
--with-cuda-driver-include=/path/to/cuda/8.0.54/include
--with-cuda-driver-lib=/path/to/cuda/8.0.54/lib64
--with-cuda-driver=/path/to/cuda/8.0.54 --disable-bootstrap --disable-multilib
--enable-languages=c,c++,fortran,lto
--prefix=/path/to/gcc/7.1.1-svn250293-20170802/install
Thread model: posix
gcc version 7.1.1 20170718 (GCC)

The problems:
1. DOUBLE COMPLEX values produce a compiler LTO error:

Compilation command:
> gfortran -DDOUBLE_COMPLEX -fopenmp -foffload="-lm" -lm 
> gcc_defaultmap_doublecomplex.F90 -o gcc_defaultmap_doublecomplex.o

Compilation output error:
> lto1: fatal error: unsupported mode TF
> 
> compilation terminated.
> mkoffload: fatal error: x86_64-pc-linux-gnu-accel-nvptx-none-gcc returned 1 
> exit status
> compilation terminated.
> lto-wrapper: fatal error: 
> /path/to/gcc/x86_64-pc-linux-gnu/8.1.0/accel/nvptx-none/mkoffload returned 1 
> exit status
> compilation terminated.
> /usr/bin/ld: lto-wrapper failed
> collect2: error: ld returned 1 exit status

2. CHARACTER default mapping not correct according to the specs. 
When mapping a CHARACTER type variable by default, it is doing tofrom, even
though that it should be firstprivatized

Compiling the reproducible with the following line:
> gfortran -fopenmp -foffload="-lm" -lm gcc_defaultmap_doublecomplex.F90 -o 
> gcc_defaultmap_doublecomplex.F90.o

And running it yields to:

>  The value of scalar_char changed and it should not have

Thanks and have a good day.

Reply via email to