This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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: Wierd test results for transfer_simplify_7.f90


On Saturday 22 December 2007 19:08:26 Dominique Dhumieres wrote:
> Error: Parameter 'cp' at (1) has not been declared or is a variable, which
> does not reduce to a constant expression
>
> Any idea of what could be wrong with ppc?

I'd hazard a guess that either the patch you applied or svn update was 
incomplete. Do you have the changes below in expr.c?

--- expr.c      (revision 131020)
+++ expr.c      (working copy)
@@ -2202,7 +2202,18 @@ check_init_expr (gfc_expr *e)

       if (e->symtree->n.sym->attr.flavor == FL_PARAMETER)
        {
-         t = simplify_parameter_variable (e, 0);
+         /* A PARAMETER shall not be used to define itself, i.e.
+               REAL, PARAMETER :: x = transfer(0, x)
+            is invalid.  */
+         if (!e->symtree->n.sym->value)
+           {
+              gfc_error("PARAMETER '%s' is used at %L before its definition "
+                        "is complete", e->symtree->n.sym->name, &e->where);
+             t = FAILURE;
+           }
+         else
+           t = simplify_parameter_variable (e, 0);
+
          break;
        }

Regards
	Daniel


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