Commit 9dd8004e by Paul Thomas

re PR fortran/30476 ([Regression 4.2, 4.3] Via other module imported generic interface rejected)

2007-01-17  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/30476
	* module.c (load_generic_interfaces): Make the marking of the
	symbol as ambiguous conditional on the module names being
	different.
	(write_generic): Ensure that the generic interface has a
	non-NULL module field.

2007-01-17  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/30476
	* gfortran.dg/generic_12.f90: New test.

From-SVN: r120860
parent 8086b65d
2007-01-17 Paul Thomas <pault@gcc.gnu.org>
PR fortran/30476
* module.c (load_generic_interfaces): Make the marking of the
symbol as ambiguous conditional on the module names being
different.
(write_generic): Ensure that the generic interface has a
non-NULL module field.
2007-01-16 Roger Sayle <roger@eyesopen.com>
PR fortran/30404
......
......@@ -3097,9 +3097,11 @@ load_generic_interfaces (void)
gfc_symtree *st;
p = p ? p : name;
st = gfc_find_symtree (gfc_current_ns->sym_root, p);
st->ambiguous = sym->attr.generic ? 0 : 1;
if (!sym->attr.generic
&& sym->module != NULL
&& strcmp(module, sym->module) != 0)
st->ambiguous = 1;
}
if (i == 1)
{
mio_interface_rest (&sym->generic);
......@@ -3748,6 +3750,9 @@ write_generic (gfc_symbol * sym)
|| !gfc_check_access (sym->attr.access, sym->ns->default_access))
return;
if (sym->module == NULL)
sym->module = gfc_get_string (module_name);
mio_symbol_interface (&sym->name, &sym->module, &sym->generic);
}
......
2007-01-17 Paul Thomas <pault@gcc.gnu.org>
PR fortran/30476
* gfortran.dg/generic_12.f90: New test.
2007-01-17 Dorit Nuzman <dorit@il.ibm.com>
* gcc.target/i386/vectorize1.c: Add cleanup-tree-dump.
! { dg-do compile }
! Test the fix for PR30476 in which the generic interface hello
! was found incorrectly to be ambiguous.
!
!Contributed by Tobias Burnus <burnus@gcc.gnu.org>
!
SUBROUTINE hello_x(dum)
IMPLICIT NONE
INTEGER :: dum
WRITE(0,*) "Hello world: ", dum
END SUBROUTINE hello_x
MODULE interfaces
IMPLICIT NONE
INTERFACE hello
SUBROUTINE hello_x(dum)
IMPLICIT NONE
INTEGER :: dum
END SUBROUTINE hello_x
END INTERFACE
END MODULE interfaces
MODULE global_module
USE interfaces
END MODULE global_module
PROGRAM main
USE global_module
IMPLICIT NONE
CALL hello(10)
END PROGRAM main
! { dg-final { cleanup-modules "interfaces global_module" } }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment