[Bug c++/82629] OpenMP 4.5 Target Region mangling problem

2017-10-27 Thread thorstenkurth at me dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82629

--- Comment #4 from Thorsten Kurth  ---
Hello Richard,

Was the test case received?

Best Regards
Thorsten Kurth

[Bug c++/82629] OpenMP 4.5 Target Region mangling problem

2017-10-20 Thread thorstenkurth at me dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82629

--- Comment #3 from Thorsten Kurth  ---
One more thing,

In the test case I send, please change the $(XPPFLAGS) in the main.x target
compilation to $(CXXFLAGS), so that -fopenmp is used at link time also.
However, that does not solve the problem but it makes the Makefile more correct
(the XPPFLAGS was a remnant from something I tried out earlier). Sorry for
that. 

Best Regards
Thorsten Kurth

[Bug c++/82629] OpenMP 4.5 Target Region mangling problem

2017-10-20 Thread thorstenkurth at me dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82629

--- Comment #2 from Thorsten Kurth  ---
Created attachment 42420
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42420&action=edit
This is the test case demonstrating the problem.

Linking this code will produce:

-bash-4.2$ make main.x
g++ -O2 -std=c++11 -fopenmp -foffload=nvptx-none -c aclass.cpp -o aclass.o
g++ -O2 -std=c++11 -fopenmp -foffload=nvptx-none -c bclass.cpp -o bclass.o
g++  aclass.o bclass.o -o main.x 
lto1: fatal error: aclass.o: section _ZN6master4copyERKS_$_omp_fn$1 is missing
compilation terminated.
mkoffload: fatal error: powerpc64le-unknown-linux-gnu-accel-nvptx-none-gcc
returned 1 exit status
compilation terminated.
lto-wrapper: fatal error:
/autofs/nccs-svm1_sw/summitdev/gcc/7.1.1-20170802/bin/../libexec/gcc/powerpc64le-unknown-linux-gnu/7.1.1//accel/nvptx-none/mkoffload
returned 1 exit status
compilation terminated.
/usr/bin/ld: lto-wrapper failed
/usr/bin/sha1sum: main.x: No such file or directory
collect2: error: ld returned 1 exit status
make: *** [main.x] Error 1

But looking at the object in question shows:

-bash-4.2$ nm aclass.o
 U .TOC.
 d .offload_func_table
 d .offload_var_table
 U GOMP_parallel
 U GOMP_target_enter_exit_data
 U GOMP_target_ext
 U GOMP_teams
0350 T _ZN6aclass4copyERKS_
0250 T _ZN6aclass8allocateERKj
0130 t _ZN6master4copyERKS_._omp_fn.0
 t _ZN6master4copyERKS_._omp_fn.1
 d _ZZN6master10deallocateEvE18.omp_data_kinds.20
 b _ZZN6master10deallocateEvE18.omp_data_sizes.19
0002 d _ZZN6master4copyERKS_E18.omp_data_kinds.11
0008 d _ZZN6master4copyERKS_E18.omp_data_sizes.10
 U _ZdaPv
 U _Znam
 U __cxa_throw_bad_array_new_length
0001 C __gnu_lto_v1
 U omp_get_num_teams
 U omp_get_num_threads
 U omp_get_team_num
 U omp_get_thread_num

The function is actually there.

Best Regards
Thorsten Kurth

[Bug c++/82629] OpenMP 4.5 Target Region mangling problem

2017-10-20 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82629

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING
   Last reconfirmed||2017-10-20
 Ever confirmed|0   |1

--- Comment #1 from Richard Biener  ---
Can you provide a testcase?