[Bug c/79940] New: OpenMP pragma - internal compiler error with taskloop

2017-03-07 Thread aidan.chalk at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79940

Bug ID: 79940
   Summary: OpenMP pragma - internal compiler error with taskloop
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: aidan.chalk at gmail dot com
  Target Milestone: ---

Created attachment 40913
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40913&action=edit
The .i file produced by the compiler for the bug desribed here.

Using taskloop with an iterator declared prior to an OpenMP parallel region
causes an internal compiler error:

Compiled with: gcc-7 -fopenmp x.c

>> gcc-7 -v
Using built-in specs.
COLLECT_GCC=gcc-7
COLLECT_LTO_WRAPPER=/opt/gcc/7.20160925/lib/gcc/x86_64-suse-linux/7.0.0/lto-wrapper
Target: x86_64-suse-linux
Configured with: ./configure --prefix=/opt/gcc/7.20160925
--with-pkgversion='openSUSE Linux' --enable-languages=c,c++,fortran
--enable-checking=release --enable-ssp --disable-libssp --disable-libvtv
--disable-libcc1 --enable-plugin -with-system-zlib --enable-__cxa_atexit
--enable-libstdcxx-allocator=new --disable-libstdcxx-pch
--enable-version-specific-runtime-libs --enable-linker-build-id
--enable-linux-futex --program-suffix=-7 --without-system-libunwind
--with-tune=generic --build=x86_64-suse-linux --host=x86_64-suse-linux
--enable-bootstrap --disable-multilib
Thread model: posix
gcc version 7.0.0 20160925 (experimental) (openSUSE Linux)

I've attached the relevant .i file produced by 7.0. I have not checked if this
occurs with gfortran at this time.

This error can be avoided if removing the pragma omp parallel (which is
apparently fixed in bug 71371, but without the parallel this is not a useful
code). Also by replacing:
for(i =0; i < with for(int i = 0; i < ...) the bug disappears, however both
are OpenMP compliant.


I've also found the identical bug when compiling with gcc 6.3 on a different
machine:
> gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/gpfs/stfc/local/apps/gcc/gcc/6.3.0/libexec/gcc/x86_64-pc-linux-gnu/6.3.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure --prefix=/gpfs/stfc/local/apps/gcc/gcc/6.3.0
--disable-multilib --with-system-zlib --disable-bootstrap
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu
--enable-offload-targets=x86_64-intelmic-linux=/gpfs/stfc/local/apps/mic/gcc/6.3.0
--enable-languages=c,c++,fortran,lto : (reconfigured) ../configure
--prefix=/gpfs/stfc/local/apps/gcc/gcc/6.3.0 --disable-multilib
--with-system-zlib --disable-bootstrap --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--enable-languages=c,c++,fortran,lto
Thread model: posix
gcc version 6.3.0 (GCC)

> gcc -fopenmp main.c
main.c: In function 'main':
main.c:12:11: internal compiler error: in extract_omp_for_data, at
omp-low.c:635
   #pragma omp taskloop default(none) shared(a, b, c) private(i)
   ^~~
0x925815 extract_omp_for_data
../../gcc/omp-low.c:635
0x94178e lower_omp_for
../../gcc/omp-low.c:15149
0x93834e lower_omp_1
../../gcc/omp-low.c:17027
0x93834e lower_omp
../../gcc/omp-low.c:17164
0x93fc95 lower_omp_taskreg
../../gcc/omp-low.c:15650
0x938416 lower_omp_1
../../gcc/omp-low.c:17020
0x938416 lower_omp
../../gcc/omp-low.c:17164
0x9380f0 lower_omp_1
../../gcc/omp-low.c:17003
0x9380f0 lower_omp
../../gcc/omp-low.c:17164
0x9383a5 lower_omp_1
../../gcc/omp-low.c:17012
0x9383a5 lower_omp
../../gcc/omp-low.c:17164
0x93c2ca execute_lower_omp
../../gcc/omp-low.c:17899
0x93c2ca execute
../../gcc/omp-low.c:17936

[Bug c/79940] OpenMP pragma - internal compiler error with taskloop

2017-03-07 Thread aidan.chalk at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79940

Aidan Chalk  changed:

   What|Removed |Added

 CC||aidan.chalk at gmail dot com

--- Comment #1 from Aidan Chalk  ---
Missed the output from command line with gcc-7:
> gcc-7 -fopenmp mainbroke.c
mainbroke.c: In function ‘main’:
mainbroke.c:12:11: internal compiler error: in extract_omp_for_data, at
omp-low.c:636
   #pragma omp taskloop default(none) shared(a, b, c) private(i)
   ^~~
0x91ae63 extract_omp_for_data
../.././gcc/omp-low.c:636
0x9371c8 lower_omp_for
../.././gcc/omp-low.c:15161
0x92d81e lower_omp_1
../.././gcc/omp-low.c:17043
0x92d81e lower_omp
../.././gcc/omp-low.c:17180
0x9355a2 lower_omp_taskreg
../.././gcc/omp-low.c:15662
0x92d2be lower_omp_1
../.././gcc/omp-low.c:17036
0x92d2be lower_omp
../.././gcc/omp-low.c:17180
0x92e0c0 lower_omp_1
../.././gcc/omp-low.c:17019
0x92e0c0 lower_omp
../.././gcc/omp-low.c:17180
0x92d97d lower_omp_1
../.././gcc/omp-low.c:17028
0x92d97d lower_omp
../.././gcc/omp-low.c:17180
0x931bf1 execute_lower_omp
../.././gcc/omp-low.c:17915
0x931bf1 execute
../.././gcc/omp-low.c:17952
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

[Bug c/79940] [6/7 Regression] OpenMP pragma - internal compiler error with taskloop

2017-03-08 Thread aidan.chalk at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79940

--- Comment #4 from Aidan Chalk  ---
@Jakub ok - my bad, I had assumed the taskloop was a loop construct, but the
bug still exists with an omp single. Re: taskloop not being useful I made the
example to test syntax.