[MacPorts] #47332: gcc46 @4.6.4_7 gfortran internal compiler error related to procedure pointers
MacPorts
noreply at macports.org
Wed Apr 1 09:58:14 PDT 2015
#47332: gcc46 @4.6.4_7 gfortran internal compiler error related to procedure
pointers
----------------------+--------------------------------
Reporter: wyeast@… | Owner: macports-tickets@…
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 2.3.3
Keywords: | Port: gcc46 gcc47 gcc48
----------------------+--------------------------------
When compiling with gfortran I get an internal compiler error when
compiling code that allocates a derived type that includes a function
(procedure) pointer which returns an array. I see the same error with all
of the following ports: gcc46 @4.6.4_7, gcc47 @4.7.4_3, and gcc48
@4.8.4_0. I am using a 10.6.8 Mac, but a coworker sees the same error
with 10.9.5 (and gcc46 @4.6.4_7).
The same code compiles fine with the same versions of gfortran listed
above on Ubuntu and Homebrew. Removing the array from being the return
argument (e.g., making it an output argument) makes the error go away.
The specific error is:
{{{
decomp.F: In function 'decomp_register_method':
decomp.F:27:0: internal compiler error: in gfc_conv_descriptor_data_set,
at fortran/trans-array.c:171
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://trac.macports.org/newticket> for instructions.
}}}
A minimal piece of code that can reproduce the bug is:
{{{
module decomp
implicit none
abstract interface
function decomp_function(input) result(output)
integer, intent(in) :: input
integer, dimension(:), pointer :: output
end function
end interface
type decomp_list
procedure (decomp_function), pointer, nopass :: decompFunc => null()
end type decomp_list
type (decomp_list), save, pointer :: decompositions => null()
contains
subroutine decomp_register_method(decompList, decompFunc)
type (decomp_list), pointer :: decompList
procedure (decomp_function), pointer :: decompFunc
type (decomp_list), pointer :: decompCursor
allocate(decompCursor )
decompCursor % decompFunc => decompFunc
end subroutine decomp_register_method
end module decomp
}}}
and can be compiled with "gfortran -ffree-form -c decomp.F" (assuming it's
named decomp.F).
A diff that will allow the code to compile is:
{{{
@@ -4,9 +4,10 @@ module decomp
implicit none
abstract interface
- function decomp_function(input) result(output)
+ function decomp_function(input, output) result(ierr)
integer, intent(in) :: input
- integer, dimension(:), pointer :: output
+ integer, dimension(:), pointer :: output
+ integer :: ierr
end function
end interface
}}}
--
Ticket URL: <https://trac.macports.org/ticket/47332>
MacPorts <https://www.macports.org/>
Ports system for OS X
More information about the macports-tickets
mailing list