re PR fortran/34545 (ICE when compiling Fortran 95 code)

2008-01-06  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/34545
	* module.c (load_needed): If the namespace has no proc_name
	give it the module symbol.

2008-01-06  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/34545
	* gfortran.dg/use_12.f90: New test.

From-SVN: r131364
This commit is contained in:
Paul Thomas 2008-01-06 22:00:00 +00:00
parent b8c9ec3da0
commit 5989df83be
4 changed files with 46 additions and 4 deletions

View file

@ -1,8 +1,8 @@
2008-01-06 Tobias Burnus <burnus@net-b.de>
2008-01-06 Paul Thomas <pault@gcc.gnu.org>
PR fortran/34689
* interface.c (compare_actual_formal): Fix intent(out) check for
function result variables.
PR fortran/34545
* module.c (load_needed): If the namespace has no proc_name
give it the module symbol.
2008-01-06 Jerry DeLisle <jvdelisle@gcc.gnu.org>

View file

@ -3525,6 +3525,12 @@ load_needed (pointer_info *p)
associate_integer_pointer (q, ns);
}
/* Use the module sym as 'proc_name' so that gfc_get_symbol_decl
doesn't go pear-shaped if the symbol is used. */
if (!ns->proc_name)
gfc_find_symbol (p->u.rsym.module, gfc_current_ns,
1, &ns->proc_name);
sym = gfc_new_symbol (p->u.rsym.true_name, ns);
sym->module = gfc_get_string (p->u.rsym.module);
strcpy (sym->binding_label, p->u.rsym.binding_label);

View file

@ -1,3 +1,14 @@
2008-01-06 Paul Thomas <pault@gcc.gnu.org>
PR fortran/34545
* gfortran.dg/use_12.f90: New test.
2008-01-06 Tobias Burnus <burnus@net-b.de>
PR fortran/34689
* interface.c (compare_actual_formal): Fix intent(out) check for
function result variables.
2008-01-06 Tobias Burnus <burnus@net-b.de>
PR fortran/34690

View file

@ -0,0 +1,25 @@
! { dg-do compile }
! Tests the fix of PR34545, in which the 'numclusters' that determines the size
! of fnres was not properly associated.
!
! Reported by Jon D. Richards <jon_d_r@msn.com>
!
module m1
integer :: numclusters = 2
end module m1
module m2
contains
function get_nfirst( ) result(fnres)
use m1, only: numclusters
real :: fnres(numclusters) ! change to REAL and it works!!
end function get_nfirst
end module m2
program kmeans_driver
use m1
use m2
integer :: nfirst(3)
nfirst(1:numclusters) = get_nfirst( )
end program kmeans_driver
! { dg-final { cleanup-modules "m1 m2" } }