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]

[patch, gfortran] Remove redunant code


While browsing through the gfortran code, I found the following
piece of code in module .c (read_module):

      /* See if the symbol has already been loaded by a previous module.
         If so, we reference the existing symbol and prevent it from
         being loaded again.  */

      sym = find_true_name (info->u.rsym.true_name, info->u.rsym.module);

      /* See if the symbol has already been loaded by a previous module.
         If so, we reference the existing symbol and prevent it from
         being loaded again.  This should not happen if the symbol being
         read is an index for an assumed shape dummy array (ns != 1).  */

      sym = find_true_name (info->u.rsym.true_name, info->u.rsym.module);

The latter call to find_true_name() has a more elaborated
comment, but apart from that they are identical.  If I understand
find_true_name() correctly, the second call will not accomplish
anything that the first one didn't. I therefore assume that this
is a mistake, and I intend to commit the attached patch to trunk
thursday evening (UTC+2) unless anyone objects (regression tested
on trunk and 4.1, Linux/x86).

What about 4.1 (when it opens again)?  What will the policy be?
This patch doesn't fix any bug, it's just a code clean up,
but OTOH it ought to be pretty safe.


        Erik


2006-02-23  Erik Edelmann  <eedelman@gcc.gnu.org>

        * module.c (read_module): Remove redundant code lines.

Attachment: redundant.diff
Description: Text document


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