This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gfortran] Make all arguments to ENTRY master optional
- From: Tobias Schlüter <tobias dot schlueter at physik dot uni-muenchen dot de>
- To: GCC Fortran mailing list <fortran at gcc dot gnu dot org>
- Cc: patch <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 24 Aug 2004 17:19:37 +0200
- Subject: Re: [gfortran] Make all arguments to ENTRY master optional
- References: <412B5A5F.6050205@physik.uni-muenchen.de>
Tobias Schlüter wrote:
> Just a little idea I had when reading some code (I'm still trying to
> understand what is wrong with pointers to strings): this small patch sets the
> optional attribute on arguments when merging argument lists for entry master
> functions. This allows removing some special handling when generating code.
>
Of course I didn't think of this before sending the patch, but everything
seems to be right: I thought, since the symbol node is shared between the
master function and the entry thunk, this might affect generated code. But
fortunately the code generating the entry thunks doesn't care about symbol
attributes, so adding the optional attribute to (some of) their arguments
shouldn't do any harm.
While reading build_entry_thunks(), I came across this code:
/* Remember the master function argument decls. */
for (formal = ns->proc_name->formal; formal; formal = formal->next)
{
}
My knowledge of C is not impeccable, but to me this looks like a do nothing
loop since all other users of formal in that function reset it to different
values anyway. Can this be removed?
- Tobi