* trans-types.c (gfc_sym_type): Use pointer types for optional args.
From-SVN: r86182
This commit is contained in:
parent
03904fb39d
commit
1619aa6f3e
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user