[Bug fortran/82943] [F03] Error with type-bound procedure of parametrized derived type

2020-09-13 Thread paul.luck...@rwth-aachen.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82943

paul.luck...@rwth-aachen.de changed:

   What|Removed |Added

 CC||paul.luck...@rwth-aachen.de

--- Comment #7 from paul.luck...@rwth-aachen.de ---
Still arises in gfortran V10.1

[Bug fortran/96495] [gfortran] MERGE does not copy ALLOCATABLE property of derived type

2020-08-11 Thread paul.luck...@rwth-aachen.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96495

paul.luck...@rwth-aachen.de changed:

   What|Removed |Added

  Attachment #49042|0   |1
is obsolete||

--- Comment #2 from paul.luck...@rwth-aachen.de ---
Created attachment 49044
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49044&action=edit
proof of concept code -- version 3

The bug is not specific to binary/unary operators 
BUT RATHER 
the combination of an elemental operator where one argument is an array and the
other argument a scalar result of another operator.

The current code example (poc version 3) shows the bug using 

 =  .. (.. )
OR
 =  .. ( ..
)

[Bug fortran/96495] [gfortran] MERGE does not copy ALLOCATABLE property of derived type

2020-08-11 Thread paul.luck...@rwth-aachen.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96495

paul.luck...@rwth-aachen.de changed:

   What|Removed |Added

  Attachment #49011|0   |1
is obsolete||

--- Comment #1 from paul.luck...@rwth-aachen.de ---
Created attachment 49042
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49042&action=edit
proof of concept code -- version 2

I investigated further and the bug arises under the following circumstances:
- derived type with ALLOCATABLE property
- a binary ELEMENTAL operator
- an unary operator

The following code will crash

f(1:2) = f(1:2) .binary. (.unary. f(1))

and the error message is as follows:
"Program received signal SIGSEGV: Segmentation fault - invalid memory
reference."

[Bug fortran/96495] New: [gfortran] MERGE does not copy ALLOCATABLE property of derived type

2020-08-06 Thread paul.luck...@rwth-aachen.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96495

Bug ID: 96495
   Summary: [gfortran] MERGE does not copy ALLOCATABLE property of
derived type
   Product: gcc
   Version: 10.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: paul.luck...@rwth-aachen.de
  Target Milestone: ---

Created attachment 49011
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49011&action=edit
proof of concept code

There is a bug in gfortran and I singled out the problem this far:

- a derived type with ALLOCATABLE data 
- a MERGE call
- an operator overloading used as argument to the MERGE call
- ELEMENTAL procedure

it is best to look at the proof of concept codes attached.
There are 4 highlighted code sections which should all yield similar results
but only one works whereas the others are broken.

The bug arises when called using a vector (using the ELEMENTAL feature).


Supplementary information
$ gfortran --version
GNU Fortran (GCC) 10.1.0

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/opt/exports/gcc-10.1.0/bin/../libexec/gcc/x86_64-pc-linux-gnu/10.1.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-10.1.0-source/gcc-10.1.0/configure
--enable-languages=c,c++,fortran --enable-checking=release
--disable-libstdcxx-pch --enable-libgomp --enable-lto --enable-gold
--with-plugin-ld=gold --prefix=/usr/local/gcc-10.1.0
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.1.0 (GCC) 

$ cat /etc/os-release 
NAME="openSUSE Leap"
VERSION="15.1"