summaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorjanus <janus@138bc75d-0d04-0410-961f-82ee72b054a4>2011-05-29 20:32:11 +0000
committerjanus <janus@138bc75d-0d04-0410-961f-82ee72b054a4>2011-05-29 20:32:11 +0000
commite17fc13a381e99ff23ca7c8dbcb692d73eeda680 (patch)
tree83be5e8770207f2f43b48f36a2a57e316d85406a /gcc/fortran
parent45cc458fec7c9f59a7f539d4eff30f05703c8d22 (diff)
downloadgcc-e17fc13a381e99ff23ca7c8dbcb692d73eeda680.tar.gz
2011-05-29 Janus Weil <janus@gcc.gnu.org>
PR fortran/47601 * module.c (mio_component_ref): Handle components of extended types. * symbol.c (gfc_find_component): Return is sym is NULL. 2011-05-29 Janus Weil <janus@gcc.gnu.org> PR fortran/47601 * gfortran.dg/extends_13.f03: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@174416 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/module.c10
-rw-r--r--gcc/fortran/symbol.c2
3 files changed, 10 insertions, 8 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 5ffa5f673f9..da086438ab5 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2011-05-29 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/47601
+ * module.c (mio_component_ref): Handle components of extended types.
+ * symbol.c (gfc_find_component): Return is sym is NULL.
+
2011-05-29 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c
index b6acca3a5f1..533246d0c8d 100644
--- a/gcc/fortran/module.c
+++ b/gcc/fortran/module.c
@@ -2356,14 +2356,10 @@ mio_component_ref (gfc_component **cp, gfc_symbol *sym)
if (sym->components != NULL && p->u.pointer == NULL)
{
/* Symbol already loaded, so search by name. */
- for (q = sym->components; q; q = q->next)
- if (strcmp (q->name, name) == 0)
- break;
-
- if (q == NULL)
- gfc_internal_error ("mio_component_ref(): Component not found");
+ q = gfc_find_component (sym, name, true, true);
- associate_integer_pointer (p, q);
+ if (q)
+ associate_integer_pointer (p, q);
}
/* Make sure this symbol will eventually be loaded. */
diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c
index 4b4f75fe827..b761cdd47e8 100644
--- a/gcc/fortran/symbol.c
+++ b/gcc/fortran/symbol.c
@@ -1996,7 +1996,7 @@ gfc_find_component (gfc_symbol *sym, const char *name,
{
gfc_component *p;
- if (name == NULL)
+ if (name == NULL || sym == NULL)
return NULL;
sym = gfc_use_derived (sym);