[Bug fortran/90230] New: newunit in open function is not threadsafe with openmp

2019-04-24 Thread mweiland at freenet dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90230

Bug ID: 90230
   Summary: newunit in open function is not threadsafe with openmp
   Product: gcc
   Version: 7.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: mweiland at freenet dot de
  Target Milestone: ---

Created attachment 46239
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46239&action=edit
Source file to reproduce the error

The issue can be reproduced with:
gfortran -c -fopenmp minimal.f90
gfortran -fopenmp minimal.o
./a.out

It yields:
 opened file with lun: -10
At line 7 of file minimal.f90
Fortran runtime error: File already opened in another unit


It seems to me that the newunit feature of open() is not threadsafe.
I get the output:
 opened file with lun: -11
At line 7 of file minimal.f90
Fortran runtime error: File already opened in another unit

Error termination. Backtrace: 
...

With ifort/14.0 and NagCompiler, this example works, e.g.:
 ifort -c -fopenmp minimal.f90
 ifort -fopenmp minimal.o
./a.out
 opened file with lun:-130
 closed file with lun:-130
 opened file with lun:-133
 opened file with lun:-131
 opened file with lun:-134
 opened file with lun:-135
 closed file with lun:-134
 opened file with lun:-129
 closed file with lun:-133
 closed file with lun:-131
 closed file with lun:-129
 opened file with lun:-132
 closed file with lun:-132
 opened file with lun:-136
 opened file with lun:-137
 closed file with lun:-137
 closed file with lun:-135
 opened file with lun:-138
 closed file with lun:-138
 closed file with lun:-136


Not sure if this is really a bug, since I do not know if newunit is actually
supposed to be treadsafe from the Fortran standard.

[Bug fortran/89621] New: Internal Compiler Error with allocatable character and openmp

2019-03-07 Thread mweiland at freenet dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89621

Bug ID: 89621
   Summary: Internal Compiler Error with allocatable character and
openmp
   Product: gcc
   Version: 7.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: mweiland at freenet dot de
  Target Milestone: ---

Created attachment 45917
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45917&action=edit
Source code which triggers the compiler bug.

Bug is triggered by :
gfortran -c minimal.f90 -fopenmp
(minimal.f90 is in attachement).

--- Output of Compiler:

gfortran -c ../src/minimal.f90 -fopenmp
../src/minimal.f90:15:0:

   !$omp parallel do

internal compiler error: Segmentation fault
0xad4caf crash_signal
../../gcc/toplev.c:337
0x71dd9c gfc_omp_clause_copy_ctor(tree_node*, tree_node*, tree_node*)
../../gcc/fortran/trans-openmp.c:614
0x9f65c5 lower_rec_input_clauses
../../gcc/omp-low.c:4339
0x9f89ad lower_omp_taskreg
../../gcc/omp-low.c:7441
0x9f006e lower_omp_1
../../gcc/omp-low.c:8815
0x9f006e lower_omp
../../gcc/omp-low.c:8959
0x9f0e88 lower_omp_1
../../gcc/omp-low.c:8799
0x9f0e88 lower_omp
../../gcc/omp-low.c:8959
0x9f0dad lower_omp_1
../../gcc/omp-low.c:8807
0x9f0dad lower_omp
../../gcc/omp-low.c:8959
0x9f4a8f execute_lower_omp
../../gcc/omp-low.c:9001
0x9f4a8f execute
../../gcc/omp-low.c:9038
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.



- information about environment and gcc version: --
gcc -v
Reading specs from
/afs/ipp-garching.mpg.de/common/soft/gcc/7.2.0/@sys/bin/../lib/gcc/x86_64-pc-linux-gnu/7.2.0/specs
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/afs/ipp-garching.mpg.de/common/soft/gcc/7.2.0/@sys/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure --prefix=/afs/ipp/.cs/gcc/7.2.0/amd64_sles11
--enable-languages=c,c++,fortran
Thread model: posix
gcc version 7.2.0 (GCC)