re PR fortran/33986 (ICE on allocatable function result)

2007-11-16  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/33986
	* trans-array.c (gfc_conv_array_parameter ): Allow allocatable
	function results.

2007-11-16  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/33986
	* gfortran.dg/allocatable_function_3.f90.

From-SVN: r130228
This commit is contained in:
Paul Thomas 2007-11-16 13:46:04 +00:00
parent 80941d6e88
commit 237b2f1b41
4 changed files with 34 additions and 6 deletions

View File

@ -1,9 +1,8 @@
2007-11-15 Tobias Burnus <burnus@net-b.de>
2007-11-16 Paul Thomas <pault@gcc.gnu.org>
PR fortran/33917
* decl.c (match_procedure_decl): Pre-resolve interface.
* resolve.c (resolve_symbol): Reject interfaces later
declared in procedure statements.
PR fortran/33986
* trans-array.c (gfc_conv_array_parameter ): Allow allocatable
function results.
2007-11-13 Jerry DeLisle <jvdelisle@gcc.gnu.org>

View File

@ -5003,7 +5003,7 @@ gfc_conv_array_parameter (gfc_se * se, gfc_expr * expr, gfc_ss * ss, int g77)
}
if (sym->attr.allocatable)
{
if (sym->attr.dummy)
if (sym->attr.dummy || sym->attr.result)
{
gfc_conv_expr_descriptor (se, expr, ss);
se->expr = gfc_conv_array_data (se->expr);

View File

@ -1,3 +1,8 @@
2007-11-16 Paul Thomas <pault@gcc.gnu.org>
PR fortran/33986
* gfortran.dg/allocatable_function_3.f90.
2007-11-16 Richard Guenther <rguenther@suse.de>
PR tree-optimization/34113

View File

@ -0,0 +1,24 @@
! { dg-do run }
! Tests the fix for PR33986, in which the call to scram would call
! an ICE because allocatable result actuals had not been catered for.
!
! Contributed by Damian Rouson <damian@rouson.net>
!
function transform_to_spectral_from() result(spectral)
integer, allocatable :: spectral(:)
allocate(spectral(2))
call scram(spectral)
end function transform_to_spectral_from
subroutine scram (x)
integer x(2)
x = (/1,2/)
end subroutine
interface
function transform_to_spectral_from() result(spectral)
integer, allocatable :: spectral(:)
end function transform_to_spectral_from
end interface
if (any (transform_to_spectral_from () .ne. (/1,2/))) call abort ()
end