FINAL subroutines

Salvatore Filippone filippone.salvatore@gmail.com
Mon Jan 24 13:50:20 GMT 2022


Hi all
The attached code compiles and runs fine under both GNU and Intel, but it
produces different results, in particular the FINAL subroutine is invoked
just once with GNU, three times with Intel.

It seems to me that they cannot both be right; I am not sure what the
standard is mandating in this case.
Any ideas?
Salvatore
---------------  Intel
[pr1eio03@login1: newstuff]$ ifort -v
ifort version 19.1.1.217
[pr1eio03@login1: newstuff]$ ifort -o testfinal testfinal.f90
[pr1eio03@login1: newstuff]$ ./testfinal
 Allocating wrapper
 Calling new_outer_type
 Assigning outer%test_item
 Called delete_test_type
 Called delete_test_type
 End of new_outer_type
 DeAllocating wrapper
 Called delete_test_type
----------------------------- GNU
sfilippo@lagrange newstuff]$ gfortran -v
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/11/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap
--enable-languages=c,c++,fortran,objc,obj-c++,ada,go,d,lto --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=
http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix
--enable-checking=release --enable-multilib --with-system-zlib
--enable-__cxa_atexit --disable-libunwind-exceptions
--enable-gnu-unique-object --enable-linker-build-id
--with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin
--enable-initfini-array
--with-isl=/builddir/build/BUILD/gcc-11.2.1-20210728/obj-x86_64-redhat-linux/isl-install
--enable-offload-targets=nvptx-none --without-cuda-driver
--enable-gnu-indirect-function --enable-cet --with-tune=generic
--with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.2.1 20210728 (Red Hat 11.2.1-1) (GCC)
[sfilippo@lagrange newstuff]$ gfortran -o testfinal testfinal.f90
[sfilippo@lagrange newstuff]$ ./testfinal
 Allocating wrapper
 Calling new_outer_type
 Assigning outer%test_item
 End of new_outer_type
 DeAllocating wrapper
 Called delete_test_type
---------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testfinal.f90
Type: text/x-fortran
Size: 1460 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/fortran/attachments/20220124/5eab2a00/attachment.bin>


More information about the Fortran mailing list