public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/100892] New: ICE on procedure pointer to function returning array of size n
@ 2021-06-03 11:17 daniel.price at monash dot edu
  2021-06-03 14:02 ` [Bug fortran/100892] " marxin at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: daniel.price at monash dot edu @ 2021-06-03 11:17 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100892

            Bug ID: 100892
           Summary: ICE on procedure pointer to function returning array
                    of size n
           Product: gcc
           Version: 11.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: daniel.price at monash dot edu
  Target Milestone: ---

Created attachment 50920
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50920&action=edit
test code

Attached code shows test case giving ICE on associated(ptr, func) if the
function returns an array of size(n), where n is an input to the function:
```
module testmodule
  implicit none
  procedure(func1), pointer :: my_ptr => null()

contains

  subroutine test_sub

   if (associated(my_ptr, func1)) print*,'associated'

  end subroutine test_sub

  function func1(n)
   integer, intent(in) :: n
        real, dimension(n)  :: func1

  end function

end module testmodule
```
compiling this gives:

% gfortran -c test-ice.f90 -o test-ice.o
f951: internal compiler error: Segmentation fault: 11
Please submit a full bug report,
with preprocessed source if appropriate.

Checked with gfortran v11.1.0 via Homebrew on Mac OS:

% gfortran -v
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc/11.1.0_1/libexec/gcc/x86_64-apple-darwin20/11.1.0/lto-wrapper
Target: x86_64-apple-darwin20
Configured with: ../configure --prefix=/usr/local/Cellar/gcc/11.1.0_1
--libdir=/usr/local/Cellar/gcc/11.1.0_1/lib/gcc/11 --disable-nls
--enable-checking=release --enable-languages=c,c++,objc,obj-c++,fortran,d
--program-suffix=-11 --with-gmp=/usr/local/opt/gmp
--with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc
--with-isl=/usr/local/opt/isl --with-zstd=/usr/local/opt/zstd
--with-pkgversion='Homebrew GCC 11.1.0_1'
--with-bugurl=https://github.com/Homebrew/homebrew-core/issues
--enable-libphobos --build=x86_64-apple-darwin20 --with-system-zlib
--disable-multilib --without-build-config
--with-native-system-header-dir=/usr/include
--with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.1.0 (Homebrew GCC 11.1.0_1) 

Cheers,

Daniel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-03-30 20:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-03 11:17 [Bug fortran/100892] New: ICE on procedure pointer to function returning array of size n daniel.price at monash dot edu
2021-06-03 14:02 ` [Bug fortran/100892] " marxin at gcc dot gnu.org
2022-03-30 19:31 ` anlauf at gcc dot gnu.org
2022-03-30 20:38 ` cvs-commit at gcc dot gnu.org
2022-03-30 20:44 ` anlauf at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).