diff options
author | Paul Brook <paul@codesourcery.com> | 2004-08-18 13:08:08 +0000 |
---|---|---|
committer | Paul Brook <pbrook@gcc.gnu.org> | 2004-08-18 13:08:08 +0000 |
commit | 1619aa6f3e47bcb5f8e88c293a3c716a22288302 (patch) | |
tree | 3978a2344fc7077080e4e00ee88b25b8c50d4b73 /gcc/fortran/trans-types.c | |
parent | 03904fb39d9e6e8ef4686e35eb0809e42617dc4b (diff) | |
download | gcc-1619aa6f3e47bcb5f8e88c293a3c716a22288302.zip gcc-1619aa6f3e47bcb5f8e88c293a3c716a22288302.tar.gz gcc-1619aa6f3e47bcb5f8e88c293a3c716a22288302.tar.bz2 |
* trans-types.c (gfc_sym_type): Use pointer types for optional args.
From-SVN: r86182
Diffstat (limited to 'gcc/fortran/trans-types.c')
-rw-r--r-- | gcc/fortran/trans-types.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c index 85c13fa..2b4edfc 100644 --- a/gcc/fortran/trans-types.c +++ b/gcc/fortran/trans-types.c @@ -972,7 +972,14 @@ gfc_sym_type (gfc_symbol * sym) See f95_get_function_decl. For dummy function parameters return the function type. */ if (byref) - type = build_reference_type (type); + { + /* We must use pointer types for potentially absent variables. The + optimizers assume a reference type argument is never NULL. */ + if (sym->attr.optional || sym->ns->proc_name->attr.entry_master) + type = build_pointer_type (type); + else + type = build_reference_type (type); + } return (type); } |