diff options
author | Daniel Kraft <d@domob.eu> | 2010-09-26 21:25:52 +0200 |
---|---|---|
committer | Daniel Kraft <domob@gcc.gnu.org> | 2010-09-26 21:25:52 +0200 |
commit | 414e8be2b09d9a50d39d8c6d48ebc0a95f6e2040 (patch) | |
tree | 1d9f1efb46f0580469c88e194c71c68ffeef9886 /gcc/fortran/resolve.c | |
parent | 1caeb1af0c71ad5639a4af71acf9fe06756e2e0e (diff) | |
download | gcc-414e8be2b09d9a50d39d8c6d48ebc0a95f6e2040.zip gcc-414e8be2b09d9a50d39d8c6d48ebc0a95f6e2040.tar.gz gcc-414e8be2b09d9a50d39d8c6d48ebc0a95f6e2040.tar.bz2 |
re PR fortran/45783 (ICE in gfc_add_component_ref, at fortran/class.c:77)
2010-09-26 Daniel Kraft <d@domob.eu>
PR fortran/45783
PR fortran/45795
* resolve.c (resolve_select_type): Clarify code.
(resolve_assoc_var): Only set typespec if it is currently unknown.
2010-09-26 Daniel Kraft <d@domob.eu>
PR fortran/45783
PR fortran/45795
* gfortran.dg/select_type_18.f03: New test.
From-SVN: r164638
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r-- | gcc/fortran/resolve.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 0dce3f8..6b5bbfa 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -7570,7 +7570,11 @@ resolve_assoc_var (gfc_symbol* sym, bool resolve_target) sym->attr.target = (tsym->attr.target || tsym->attr.pointer); } - sym->ts = target->ts; + /* Get type if this was not already set. Note that it can be + some other type than the target in case this is a SELECT TYPE + selector! So we must not update when the type is already there. */ + if (sym->ts.type == BT_UNKNOWN) + sym->ts = target->ts; gcc_assert (sym->ts.type != BT_UNKNOWN); /* See if this is a valid association-to-variable. */ @@ -7673,8 +7677,8 @@ resolve_select_type (gfc_code *code, gfc_namespace *old_ns) error++; continue; } - else - default_case = body; + + default_case = body; } } |