[Bug libstdc++/71959] New: [OpenACC] #pragma acc parallel leads to segfault in x86_64-pc-linux-gnu-accel-nvptx-none-gcc

2016-07-21 Thread christopher.guc...@torq-dev.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71959

Bug ID: 71959
   Summary: [OpenACC] #pragma acc parallel leads to segfault in
x86_64-pc-linux-gnu-accel-nvptx-none-gcc
   Product: gcc
   Version: 6.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: christopher.guc...@torq-dev.de
  Target Milestone: ---

Created attachment 38947
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38947&action=edit
Source files and -save-temps files

I'm trying to modify libstdc++ by adding GPU offloaded code in omp_loop.h (my
version attached). I test the code using the attached measureParallel.cpp file.

Compiling the code using the following command:

> g++ -v -save-temps -Wall -Wextra measureParallel.cpp -D_GLIBCXX_PARALLEL 
> -lpthread -fopenacc -foffload=nvptx-none -foffload="-O3" -O3 -o 
> measureParallel.autotuned

gives me the following output:

> Using built-in specs.
> COLLECT_GCC=g++
> COLLECT_LTO_WRAPPER=/home/thonfeld.net/chris/git/gcc 
> offload/install/bin/../libexec/gcc/x86_64-pc-linux-gnu/6.1.0/lto-wrapper
> OFFLOAD_TARGET_NAMES=nvptx-none
> Target: x86_64-pc-linux-gnu
> Configured with: 
> /home/thonfeld.net/chris/git/gcc-offload/source/gcc-6.1.0/configure --prefix= 
> --disable-bootstrap --enable-languages=c,c++,fortran,lto --disable-multilib 
> --enable-offload-targets=nvptx-none=/home/thonfeld.net/chris/git/gcc-offload/install
>  --with-cuda-driver-include=/include CC='gcc -m64' CXX='g++ -m64' 
> --with-sysroot= : (reconfigured) 
> /home/thonfeld.net/chris/git/gcc-offload/source/gcc-6.1.0/configure --prefix= 
> --disable-bootstrap --enable-languages=c,c++,fortran,lto --disable-multilib 
> --enable-offload-targets=nvptx-none=/home/thonfeld.net/chris/git/gcc-offload/install
>  --with-cuda-driver-include=/include CC='gcc -m64' CXX='g++ -m64' 
> --with-sysroot=
> Thread model: posix
> gcc version 6.1.0 (GCC) 
> COLLECT_GCC_OPTIONS='-v' '-save-temps' '-Wall' '-Wextra' '-D' 
> '_GLIBCXX_PARALLEL' '-fopenacc' '-foffload=nvptx-none' '-foffload=-O3' '-O3' 
> '-o' 'measureParallel.autotuned' '-shared-libgcc' '-mtune=generic' 
> '-march=x86-64' '-pthread'
>  
> /home/thonfeld.net/chris/git/gcc-offload/install/bin/../libexec/gcc/x86_64-pc-linux-gnu/6.1.0/cc1plus
>  -E -quiet -v -imultiarch x86_64-linux-gnu -iprefix 
> /home/thonfeld.net/chris/git/gcc-offload/install/bin/../lib/gcc/x86_64-pc-linux-gnu/6.1.0/
>  -D_GNU_SOURCE -D_REENTRANT -D_GLIBCXX_PARALLEL measureParallel.cpp 
> -mtune=generic -march=x86-64 -Wall -Wextra -fopenacc -foffload=nvptx-none 
> -foffload=-O3 -O3 -fpch-preprocess -o measureParallel.ii
> ignoring nonexistent directory 
> "/home/thonfeld.net/chris/git/gcc-offload/install/bin/../lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../x86_64-pc-linux-gnu/include"
> ignoring nonexistent directory 
> "/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0"
> ignoring nonexistent directory 
> "/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/x86_64-pc-linux-gnu"
> ignoring nonexistent directory 
> "/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/backward"
> ignoring duplicate directory 
> "/home/thonfeld.net/chris/git/gcc-offload/install/bin/../lib/gcc/../../lib/gcc/x86_64-pc-linux-gnu/6.1.0/include"
> ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
> ignoring duplicate directory 
> "/home/thonfeld.net/chris/git/gcc-offload/install/bin/../lib/gcc/../../lib/gcc/x86_64-pc-linux-gnu/6.1.0/include-fixed"
> ignoring nonexistent directory 
> "/home/thonfeld.net/chris/git/gcc-offload/install/bin/../lib/gcc/../../lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../x86_64-pc-linux-gnu/include"
> #include "..." search starts here:
> #include <...> search starts here:
>  
> /home/thonfeld.net/chris/git/masterarbeit-chris/code/submodules/libtuning/include
>  
> /home/thonfeld.net/chris/git/gcc-offload/install/include/c++/6.1.0/x86_64-pc-linux-gnu
>  /home/thonfeld.net/chris/git/gcc-offload/install/include/c++/6.1.0
>  .
>  
> /home/thonfeld.net/chris/git/gcc-offload/install/bin/../lib/gcc/x86_64-pc-linux-gnu/6.1.0/include
>  
> /home/thonfeld.net/chris/git/gcc-offload/install/bin/../lib/gcc/x86_64-pc-linux-gnu/6.1.0/include-fixed
>  /usr/local/include
>  /home/thonfeld.net/chris/git/gcc-offload/install/bin/../lib/gcc/../../include
>  /usr/include/x86_64-linux-g

[Bug libstdc++/71959] [OpenACC] #pragma acc parallel leads to segfault in x86_64-pc-linux-gnu-accel-nvptx-none-gcc

2016-07-22 Thread christopher.guc...@torq-dev.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71959

--- Comment #1 from Christopher Guckes  ---
I replaced the iterator with an array but it still crashes. I assume it has
something to do with the function pointers or the use of templates. Will
investigate further.

[Bug libgomp/71959] [OpenACC] #pragma acc parallel leads to segfault in x86_64-pc-linux-gnu-accel-nvptx-none-gcc

2016-07-26 Thread christopher.guc...@torq-dev.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71959

--- Comment #2 from Christopher Guckes  ---
I hate to bother you again on this, but I'm kinda stuck with what I'm working
on. Does anyone have any advise on what might be causing the problem, so I can
avoid it? OpenACC-wise I'm relying on the route data and parallel loop pragmata
to work. Are there any known issues with these? The routines I'm using are
defined in a different file. Might this be a problem?

Many thanks in advance for anything you can give me...

[Bug libgomp/71959] [OpenACC] #pragma acc parallel leads to segfault in x86_64-pc-linux-gnu-accel-nvptx-none-gcc

2016-07-27 Thread christopher.guc...@torq-dev.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71959

--- Comment #3 from Christopher Guckes  ---
I've investigated a bit further. The problem seems to occur only if the routine
is passed by reference. Maybe that helps you isolate the problem any further.

[Bug libgomp/71959] [OpenACC] #pragma acc parallel leads to segfault in x86_64-pc-linux-gnu-accel-nvptx-none-gcc

2016-07-27 Thread christopher.guc...@torq-dev.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71959

--- Comment #5 from Christopher Guckes  ---
I'm using a very ugly workaround, since I'm only working on a proof of concept.
Can you comment on this post, once references are working? Many thanks for your
time.