[Bug c/91920] New: ggc 9.2.0 failing openmp compile on ppc64le

2019-09-26 Thread robert at robbieab dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91920

Bug ID: 91920
   Summary: ggc 9.2.0 failing openmp compile on ppc64le
   Product: gcc
   Version: 9.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: robert at robbieab dot com
  Target Milestone: ---

Created attachment 46954
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46954&action=edit
The minimal test-case C file i used.

Compiling the attached program with "gcc -fopenmp" failes with the following
error on my ppc64le platform:
---
$ gcc -fopenmp test-openmp.c 
test-openmp.c: In function ‘testfunc’:
test-openmp.c:10:15: error: ‘*.LC0’ not specified in enclosing ‘parallel’
   10 | float k[3] = { 0.1f, 0.1f, 0.1f } ;
  |   ^
test-openmp.c:7:9: error: enclosing ‘parallel’
7 | #pragma omp parallel for default(none) shared(f)
  | ^~~
---

This errors does not appear if the 0.1f values are replaced with 0.0f in the
k[3] array.

gcc details:
---
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/powerpc64le-unknown-linux-gnu/9.2.0/lto-wrapper
Target: powerpc64le-unknown-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/gcc-9.2.0-r1/work/gcc-9.2.0/configure
--host=powerpc64le-unknown-linux-gnu --build=powerpc64le-unknown-linux-gnu
--prefix=/usr --bindir=/usr/powerpc64le-unknown-linux-gnu/gcc-bin/9.2.0
--includedir=/usr/lib/gcc/powerpc64le-unknown-linux-gnu/9.2.0/include
--datadir=/usr/share/gcc-data/powerpc64le-unknown-linux-gnu/9.2.0
--mandir=/usr/share/gcc-data/powerpc64le-unknown-linux-gnu/9.2.0/man
--infodir=/usr/share/gcc-data/powerpc64le-unknown-linux-gnu/9.2.0/info
--with-gxx-include-dir=/usr/lib/gcc/powerpc64le-unknown-linux-gnu/9.2.0/include/g++-v9
--with-python-dir=/share/gcc-data/powerpc64le-unknown-linux-gnu/9.2.0/python
--enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt
--disable-werror --with-system-zlib --enable-nls --without-included-gettext
--enable-checking=release --with-bugurl=https://bugs.gentoo.org/
--with-pkgversion='Gentoo 9.2.0-r1 p2' --disable-esp --enable-libstdcxx-time
--enable-shared --enable-threads=posix --enable-__cxa_atexit
--enable-clocale=gnu --disable-multilib --enable-altivec --disable-fixed-point
--enable-targets=all --enable-libgomp --disable-libmudflap --disable-libssp
--disable-systemtap --disable-vtable-verify --disable-libvtv --enable-lto
--with-isl --disable-isl-version-check --enable-default-pie
--enable-default-ssp
Thread model: posix
gcc version 9.2.0 (Gentoo 9.2.0-r1 p2) 
---

This problem does not appear to happen on my x86_64 system.

[Bug c/91920] ggc 9.2.0 failing openmp compile on ppc64le

2019-09-26 Thread robert at robbieab dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91920

--- Comment #1 from robert at robbieab dot com ---
Created attachment 46955
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46955&action=edit
Preprocessed copy of test-openmp.c

[Bug middle-end/91920] ggc 9.2.0 failing openmp compile on ppc64le

2019-09-27 Thread robert at robbieab dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91920

robert at robbieab dot com changed:

   What|Removed |Added

  Attachment #46954|0   |1
is obsolete||

--- Comment #5 from robert at robbieab dot com ---
Created attachment 46960
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46960&action=edit
Revised, more minimal, non-racy test case.

This is an even more minimal test-case with the racy-behaviour stripped out.

[Bug middle-end/91920] ggc 9.2.0 failing openmp compile on ppc64le

2019-09-27 Thread robert at robbieab dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91920

robert at robbieab dot com changed:

   What|Removed |Added

  Attachment #46955|0   |1
is obsolete||

--- Comment #6 from robert at robbieab dot com ---
Created attachment 46961
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46961&action=edit
Preprocessed version of the revised test case.

[Bug middle-end/91920] ggc 9.2.0 failing openmp compile on ppc64le

2019-09-27 Thread robert at robbieab dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91920

--- Comment #7 from robert at robbieab dot com ---
Yeah, what Daniel said. 

The test case here was just "something simple that triggers the problem".

The revised test cases also exhibit the problem for me, and shouldn't be racy,
or anything else really!

[Bug middle-end/91920] ggc 9.2.0 failing openmp compile on ppc64le

2019-09-27 Thread robert at robbieab dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91920

--- Comment #9 from robert at robbieab dot com ---
Does the patch mean k[] gets marked as shared?

[Bug middle-end/91920] ggc 9.2.0 failing openmp compile on ppc64le

2019-09-27 Thread robert at robbieab dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91920

--- Comment #12 from robert at robbieab dot com ---
Ah, thank you for the explanation.

I will try and test this today.

[Bug middle-end/91920] ggc 9.2.0 failing openmp compile on ppc64le

2019-09-27 Thread robert at robbieab dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91920

--- Comment #13 from robert at robbieab dot com ---
The patch appears to fix both my test-case, and the original problem in
Darktable.

Darktable is using a 3 member array which does get modified, initialized to
-FLT_MAX and than used to store the max value for a set of RGB values.

Thank you for fixing this.