This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Ping: [Patch, fortran] PR24558, PR20877 and PR25047 - module function alternate entries.


Tobias' point (unless I misunderstood it) is that

  if (gfc_current_ns->parent == NULL)
    rc = gfc_get_symbol (name, NULL, result);
  else
    rc = gfc_get_symbol (name, gfc_current_ns->parent, result);

is, under the rules of the C language, strictly equivalent to


rc = gfc_get_symbol (name, gfc_current_ns->parent, result);

and that


  if (gfc_current_ns->parent == NULL || module_fcn_entry)
   rc = gfc_get_symbol (name, NULL, result);
 else
   rc = gfc_get_symbol (name, gfc_current_ns->parent, result);

is also strictly equivalent to


  if (module_fcn_entry)
   rc = gfc_get_symbol (name, NULL, result);
 else
   rc = gfc_get_symbol (name, gfc_current_ns->parent, result);

The strict equivalence does not arise from the Fortran standard or assumptions made elsewhere, it would be true of any C code of the form

 if (a == NULL)
   foo (NULL);
 else
   foo (a);

or


 if (a == NULL || b)
   foo (NULL);
 else
   foo (a);


Regards,
FX


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]