[gfortran] Make all arguments to ENTRY master optional

Tobias Schlüter tobias.schlueter@physik.uni-muenchen.de
Tue Aug 24 15:45:00 GMT 2004

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

More information about the Gcc-patches mailing list