[patch, gfortran] Remove redunant code

Erik Edelmann erik.edelmann@iki.fi
Wed Feb 22 22:25:00 GMT 2006


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.
-------------- next part --------------
Index: gcc/fortran/module.c
===================================================================
--- gcc/fortran/module.c	(revision 111364)
+++ gcc/fortran/module.c	(working copy)
@@ -3189,12 +3189,6 @@ read_module (void)
       skip_list ();
 
       /* 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).  */


More information about the Gcc-patches mailing list