http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48412

--- Comment #2 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2011-04-03 
17:28:14 UTC ---
Hi Joost,

the following patch

Index: frontend-passes.c
===================================================================
--- frontend-passes.c   (Revision 171913)
+++ frontend-passes.c   (Arbeitskopie)
@@ -279,6 +279,20 @@
   return result;
 }

+/* Warn about function removal, uncontitionally for now.  */
+
+static void
+warn_function_removal(gfc_expr *e)
+{
+  if (e->expr_type != EXPR_FUNCTION)
+    return;
+  if (e->value.function.esym)
+    gfc_warning ("Removing call to function %s at %L",
+                e->value.function.esym->name, &(e->where));
+  else if (e->value.function.isym)
+    gfc_warning ("Removing call to function %s at %L",
+                e->value.function.isym->name, &(e->where));
+}
 /* Callback function for the code walker for doing common function
    elimination.  This builds up the list of functions in the expression
    and goes through them to detect duplicates, which it then replaces
@@ -311,6 +325,8 @@
            {
              if (newvar == NULL)
                newvar = create_var (*(expr_array[i]));
+
+             warn_function_removal (*(expr_array[j]));
              gfc_free (*(expr_array[j]));
              *(expr_array[j]) = gfc_copy_expr (newvar);
            }

could maybe help you debug this by showing which functions get removed.

Reply via email to