PR fortran/30554
* module.c (read_module): If a symbol is excluded by an ONLY
clause, check to see if there is a symtree already loaded. If
so, attach the symtree to the pointer_info.
2007-01-29 Paul Thomas <pault@gcc.gnu.org>
PR fortran/30554
* gfortran.dg/used_dummy_types_6.f90: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121281
138bc75d-0d04-0410-961f-
82ee72b054a4
+2007-01-29 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/30554
+ * module.c (read_module): If a symbol is excluded by an ONLY
+ clause, check to see if there is a symtree already loaded. If
+ so, attach the symtree to the pointer_info.
+
2007-01-28 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/30389
/* Get the jth local name for this symbol. */
p = find_use_name_n (name, &j);
- /* Skip symtree nodes not in an ONLY clause. */
+ /* Skip symtree nodes not in an ONLY clause, unless there
+ is an existing symtree loaded from another USE
+ statement. */
if (p == NULL)
- continue;
+ {
+ st = gfc_find_symtree (gfc_current_ns->sym_root, name);
+ if (st != NULL)
+ info->u.rsym.symtree = st;
+ continue;
+ }
- /* Check for ambiguous symbols. */
st = gfc_find_symtree (gfc_current_ns->sym_root, p);
if (st != NULL)
{
+ /* Check for ambiguous symbols. */
if (st->n.sym != info->u.rsym.sym)
st->ambiguous = 1;
info->u.rsym.symtree = st;
+2007-01-29 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/30554
+ * gfortran.dg/used_dummy_types_6.f90: New test.
+
2007-01-28 Jan Hubicka <jh@suse.cz>
* gcc.dg/tree-prof/val-prof-6.c: New test.
--- /dev/null
+! { dg-do compile }
+! Tests the fix for PR30554, the USE statements in potential_energy
+! would cause a segfault because the pointer_info for nfree coming
+! from constraint would not find the existing symtree coming directly
+! from atom.
+!
+! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
+
+MODULE ATOMS
+INTEGER :: NFREE = 0
+END MODULE ATOMS
+
+MODULE CONSTRAINT
+USE ATOMS, ONLY: NFREE
+CONTAINS
+ SUBROUTINE ENERGY_CONSTRAINT ( HESSIAN )
+ REAL , DIMENSION(1:(3*NFREE*(3*NFREE+1))/2):: HESSIAN
+ END SUBROUTINE ENERGY_CONSTRAINT
+END MODULE CONSTRAINT
+
+MODULE POTENTIAL_ENERGY
+USE ATOMS
+USE CONSTRAINT, ONLY : ENERGY_CONSTRAINT
+END MODULE POTENTIAL_ENERGY
+! { dg-final { cleanup-modules "atoms constraint potential_energy" } }