2009-11-21 Jerry DeLisle <jvdelisle@gcc.gnu.org>
authorjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 22 Nov 2009 01:59:16 +0000 (01:59 +0000)
committerjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 22 Nov 2009 01:59:16 +0000 (01:59 +0000)
* trans-const.c (gfc_conv_const): Fix typo in comment. Replace assert
with error message if not constant.
* resolve.c (next_data_value): Delete check for constant.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154418 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/fortran/ChangeLog
gcc/fortran/resolve.c
gcc/fortran/trans-const.c

index 234a0d1..adba8ad 100644 (file)
@@ -1,3 +1,9 @@
+2009-11-21  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       * trans-const.c (gfc_conv_const): Fix typo in comment. Replace assert
+       with error message if not constant.
+       * resolve.c (next_data_value): Delete check for constant.
+
 2009-11-20  Janus Weil  <janus@gcc.gnu.org>
 
        * intrinsic.texi (C_F_PROCPOINTER): Remove obsolete comment.
index f3fce1b..bd690a7 100644 (file)
@@ -11083,9 +11083,6 @@ next_data_value (void)
 {
   while (mpz_cmp_ui (values.left, 0) == 0)
     {
-      if (!gfc_is_constant_expr (values.vnode->expr))
-       gfc_error ("non-constant DATA value at %L",
-                  &values.vnode->expr->where);
 
       if (values.vnode->next == NULL)
        return FAILURE;
index 035f40b..e2cd40b 100644 (file)
@@ -340,7 +340,7 @@ void
 gfc_conv_constant (gfc_se * se, gfc_expr * expr)
 {
   /* We may be receiving an expression for C_NULL_PTR or C_NULL_FUNPTR.  If
-     so, they expr_type will not yet be an EXPR_CONSTANT.  We need to make
+     so, the expr_type will not yet be an EXPR_CONSTANT.  We need to make
      it so here.  */
   if (expr->ts.type == BT_DERIVED && expr->ts.u.derived
       && expr->ts.u.derived->attr.is_iso_c)
@@ -353,7 +353,11 @@ gfc_conv_constant (gfc_se * se, gfc_expr * expr)
         }
     }
 
-  gcc_assert (expr->expr_type == EXPR_CONSTANT);
+  if (expr->expr_type != EXPR_CONSTANT)
+    {
+      gfc_error ("non-constant initialization expression at %L", &expr->where);
+      return;
+    }
 
   if (se->ss != NULL)
     {