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"