module.c (load_generic_interfaces): Move call to find_symbol() so that only occurs...
authorAndrew Benson <abensonca@gmail.com>
Wed, 22 Aug 2018 17:47:53 +0000 (17:47 +0000)
committerAndrew Benson <abensonca@gcc.gnu.org>
Wed, 22 Aug 2018 17:47:53 +0000 (17:47 +0000)
2018-08-22  Andrew Benson  <abensonca@gmail.com>

        * module.c (load_generic_interfaces): Move call to find_symbol()
        so that only occurs if actually needed.

From-SVN: r263784

gcc/fortran/ChangeLog
gcc/fortran/module.c

index 2cd5dcf3304d4a87cf0585fce8cc79e471d4990f..88edff3eed6edfa94459e8b2fb84a8cd02517bdb 100644 (file)
@@ -1,3 +1,8 @@
+2018-08-22  Andrew Benson  <abensonca@gmail.com>
+
+       * module.c (load_generic_interfaces): Move call to find_symbol()
+       so that only occurs if actually needed.
+
 2018-08-22  Janus Weil  <janus@gcc.gnu.org>
 
        PR fortran/86888
index 196da9c0ff775067f3c9aeac925d41142197f920..993ea9f16b90331f893166fc5767a24ac37cf6c7 100644 (file)
@@ -4559,9 +4559,6 @@ load_generic_interfaces (void)
          /* Decide if we need to load this one or not.  */
          p = find_use_name_n (name, &i, false);
 
-         st = find_symbol (gfc_current_ns->sym_root,
-                           name, module_name, 1);
-
          if (!p || gfc_find_symbol (p, NULL, 0, &sym))
            {
              /* Skip the specific names for these cases.  */
@@ -4570,6 +4567,9 @@ load_generic_interfaces (void)
              continue;
            }
 
+         st = find_symbol (gfc_current_ns->sym_root,
+                           name, module_name, 1);
+
          /* If the symbol exists already and is being USEd without being
             in an ONLY clause, do not load a new symtree(11.3.2).  */
          if (!only_flag && st)