diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2017-11-20 16:02:55 +0000 |
---|---|---|
committer | Richard Sandiford <richard.sandiford@linaro.org> | 2017-11-20 16:02:55 +0000 |
commit | d58952aefb03632bbb5b441d5c0bd330711f0af1 (patch) | |
tree | d046e56bfbd6a40106ae6ab96fafc954f1dfc955 /gcc/fortran/interface.c | |
parent | 648f8fc59b2cc39abd24f4c22388b346cdebcc31 (diff) | |
parent | 50221fae802a10fafe95e61d40504a58da33e98f (diff) | |
download | gcc-linaro-dev/sve.tar.gz |
Merge trunk into svelinaro-dev/sve
Diffstat (limited to 'gcc/fortran/interface.c')
-rw-r--r-- | gcc/fortran/interface.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c index 9f0fcc82f24..1b7ebf56b92 100644 --- a/gcc/fortran/interface.c +++ b/gcc/fortran/interface.c @@ -1262,8 +1262,13 @@ generic_correspondence (gfc_formal_arglist *f1, gfc_formal_arglist *f2, static int symbol_rank (gfc_symbol *sym) { - gfc_array_spec *as; - as = (sym->ts.type == BT_CLASS) ? CLASS_DATA (sym)->as : sym->as; + gfc_array_spec *as = NULL; + + if (sym->ts.type == BT_CLASS && CLASS_DATA (sym) && CLASS_DATA (sym)->as) + as = CLASS_DATA (sym)->as; + else + as = sym->as; + return as ? as->rank : 0; } |