[Bug c++/81222] New: OpenMP 4.5 array reduction clause causes the program to crash

2017-06-27 Thread marcin.marcin.m at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81222

Bug ID: 81222
   Summary: OpenMP 4.5 array reduction clause causes the program
to crash
   Product: gcc
   Version: 6.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: marcin.marcin.m at gmail dot com
  Target Milestone: ---

I have a feeling I've just found a bug in GCC 6.3.0 OpenMP implementation (new
OpenMP 4.5 features)

I'm running this code: https://gitlab.com/marmistrz/pw-brandes

The parallelization is done by the following OpenMP directive:

#pragma omp parallel for reduction(+: results[:n])

Where results is obtained as here:
https://gitlab.com/marmistrz/pw-brandes/blob/master/brandes.cpp#L21

I get a segmentation fault when using the following datasets:
http://snap.stanford.edu/data/com-LiveJournal.html
http://snap.stanford.edu/data/web-Stanford.html
(all comment lines (starting with a #) should be removed prior to launching the
computation, otherwise there'll be a parsing error)

The segmentation fault appears only on an Intel Xeon E5-2697 v3 (Haswell)
processor, with 2 or more threads
I have managed to successfully complete the web-Stanford testcase on an Intel
i5-5200U processor, with 4 threads.

The backtrace points to gomp_thread_start:

#0  0x00407006 in brandes () at /home/marmistrz/brandes/brandes.cpp:21
#1  0x2b31fc56 in gomp_thread_start () at
../../../gcc-6.3.0/libgomp/team.c:119
#2  0x2b753aa1 in start_thread () from /lib64/libpthread.so.0
#3  0x2ba51bcd in clone () from /lib64/libc.so.6

It appears that the segfault appears at the very beginning of the thread start.

[Bug c++/82475] GCC is unable to compile OpenACC with class fields

2017-10-08 Thread marcin.marcin.m at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82475

--- Comment #1 from Marcin M.  ---
Created attachment 42324
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42324&action=edit
test.ii, result from -save-temps

[Bug c++/82475] New: GCC is unable to compile OpenACC with class fields

2017-10-08 Thread marcin.marcin.m at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82475

Bug ID: 82475
   Summary: GCC is unable to compile OpenACC with class fields
   Product: gcc
   Version: 7.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: marcin.marcin.m at gmail dot com
  Target Milestone: ---

Created attachment 42323
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42323&action=edit
test.cpp - the source code which triggers the bug

When trying to compile the attached code, g++ 7.2.0 bails out with

$ g++ -fopenacc test.cpp  
test.cpp: In constructor ‘foo::foo(float*, size_t)’:
test.cpp:7:42: error: ‘foo::_x’ is not a variable in ‘map’ clause
 #pragma acc enter data copyin(_x)
  ^
test.cpp:7:17: error: ‘#pragma acc enter data’ has no data movement clause
 #pragma acc enter data copyin(_x)
 ^~~

The code is properly compiled using PGI Professional 17.9

$ pgc++ -acc -ta=tesla:cc60 -Minfo=accel test.cpp -o test
foo::foo(float *, unsigned long):
  8, Generating enter data copyin(_x[:])

The OpenACC 2.5 Programming and Best Practice Guide, [1] page 32, clearly shows
that copying in member variables should be supported

System: Arch Linux
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc-multilib/src/gcc/configure --prefix=/usr
--libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/
--enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared
--enable-threads=posix --enable-libmpx --with-system-zlib --with-isl
--enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu
--disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object
--enable-linker-build-id --enable-lto --enable-plugin
--enable-install-libiberty --with-linker-hash-style=gnu
--enable-gnu-indirect-function --enable-multilib --disable-werror
--enable-checking=release --enable-default-pie --enable-default-ssp
Thread model: posix
gcc version 7.2.0 (GCC) 

[1]
https://www.openacc.org/sites/default/files/inline-files/OpenACC_Programming_Guide_0.pdf