diff options
author | pbrook <pbrook@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-08-18 13:08:08 +0000 |
---|---|---|
committer | pbrook <pbrook@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-08-18 13:08:08 +0000 |
commit | 397cd81c4fc64e5ae9aa7769fdf6df1e49678a27 (patch) | |
tree | 3978a2344fc7077080e4e00ee88b25b8c50d4b73 | |
parent | ee617972a33fa25bf79765f8597fe70bcf186d3e (diff) | |
download | ppe42-gcc-397cd81c4fc64e5ae9aa7769fdf6df1e49678a27.tar.gz ppe42-gcc-397cd81c4fc64e5ae9aa7769fdf6df1e49678a27.zip |
* trans-types.c (gfc_sym_type): Use pointer types for optional args.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@86182 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/fortran/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/fortran/trans-types.c | 9 |
2 files changed, 12 insertions, 1 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index c6e5cbe191b..eae37c8c748 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,7 @@ +2004-08-18 Paul Brook <paul@codesourcery.com> + + * trans-types.c (gfc_sym_type): Use pointer types for optional args. + 2004-08-18 Victor Leikehman <lei@il.ibm.com> PR fortran/13278 diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c index 85c13fa1a21..2b4edfc0e27 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); } |