public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/32331]  New: Better error message for variable bond of DATA implied do
@ 2007-06-14  6:14 burnus at gcc dot gnu dot org
  2007-08-12 10:25 ` [Bug fortran/32331] " fxcoudert at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-06-14  6:14 UTC (permalink / raw)
  To: gcc-bugs

subroutine test(n)
    character(len=20), dimension(n) :: string
    data ( string(i) ,i=1,n ) / &
        'A', 'B', 'C', 'D', 'E' /
end subroutine

gives currently:
    data ( string(i) ,i=1,n ) / &
                         1
Error: iterator end at (1) does not simplify

which is unclear, how about something like:

ifort: Error: x.f90, line 3: This symbol must be a defined parameter or an
argument of an inquiry function that evaluates to a compile-time constant.  
[N]
or
NAG f95: Error: Static array STRING cannot have variable bounds


-- 
           Summary: Better error message for variable bond of DATA implied
                    do
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: enhancement
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug fortran/32331] Better error message for variable bond of DATA implied do
  2007-06-14  6:14 [Bug fortran/32331] New: Better error message for variable bond of DATA implied do burnus at gcc dot gnu dot org
@ 2007-08-12 10:25 ` fxcoudert at gcc dot gnu dot org
  2010-05-01 18:30 ` dfranke at gcc dot gnu dot org
  2010-05-05 19:41 ` dfranke at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-08-12 10:25 UTC (permalink / raw)
  To: gcc-bugs



-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-08-12 10:25:36
               date|                            |


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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug fortran/32331] Better error message for variable bond of DATA implied do
  2007-06-14  6:14 [Bug fortran/32331] New: Better error message for variable bond of DATA implied do burnus at gcc dot gnu dot org
  2007-08-12 10:25 ` [Bug fortran/32331] " fxcoudert at gcc dot gnu dot org
@ 2010-05-01 18:30 ` dfranke at gcc dot gnu dot org
  2010-05-05 19:41 ` dfranke at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2010-05-01 18:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from dfranke at gcc dot gnu dot org  2010-05-01 18:30 -------
How about this?

Index: resolve.c
===================================================================
--- resolve.c   (revision 158958)
+++ resolve.c   (working copy)
@@ -11824,6 +11827,7 @@ traverse_data_list (gfc_data_variable *v
   gfc_try retval = SUCCESS;

   mpz_init (frame.value);
+  mpz_init (trip);

   start = gfc_copy_expr (var->iter.start);
   end = gfc_copy_expr (var->iter.end);
@@ -11832,26 +11836,29 @@ traverse_data_list (gfc_data_variable *v
   if (gfc_simplify_expr (start, 1) == FAILURE
       || start->expr_type != EXPR_CONSTANT)
     {
-      gfc_error ("iterator start at %L does not simplify", &start->where);
+      gfc_error ("start of implied-do loop at %L can not be "
+                "simplified to a constant value ", &start->where);
       retval = FAILURE;
       goto cleanup;
     }
   if (gfc_simplify_expr (end, 1) == FAILURE
       || end->expr_type != EXPR_CONSTANT)
     {
-      gfc_error ("iterator end at %L does not simplify", &end->where);
+      gfc_error ("end of implied-do loop at %L can not be "
+                "simplified to a constant value ", &start->where);
       retval = FAILURE;
       goto cleanup;
     }
   if (gfc_simplify_expr (step, 1) == FAILURE
       || step->expr_type != EXPR_CONSTANT)
     {
-      gfc_error ("iterator step at %L does not simplify", &step->where);
+      gfc_error ("step of implied-do loop at %L can not be "
+                "simplified to a constant value ", &start->where);
       retval = FAILURE;
       goto cleanup;
     }

-  mpz_init_set (trip, end->value.integer);
+  mpz_set (trip, end->value.integer);
   mpz_sub (trip, trip, start->value.integer);
   mpz_add (trip, trip, step->value.integer);

@@ -11867,7 +11874,6 @@ traverse_data_list (gfc_data_variable *v
     {
       if (traverse_data_var (var->list, where) == FAILURE)
        {
-         mpz_clear (trip);
          retval = FAILURE;
          goto cleanup;
        }
@@ -11876,7 +11882,6 @@ traverse_data_list (gfc_data_variable *v
       if (gfc_simplify_expr (e, 1) == FAILURE)
        {
          gfc_free_expr (e);
-         mpz_clear (trip);
          retval = FAILURE;
          goto cleanup;
        }
@@ -11886,9 +11891,9 @@ traverse_data_list (gfc_data_variable *v
       mpz_sub_ui (trip, trip, 1);
     }

-  mpz_clear (trip);
 cleanup:
   mpz_clear (frame.value);
+  mpz_clear (trip);

   gfc_free_expr (start);
   gfc_free_expr (end);


-- 

dfranke at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dfranke at gcc dot gnu dot
                   |                            |org


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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug fortran/32331] Better error message for variable bond of DATA implied do
  2007-06-14  6:14 [Bug fortran/32331] New: Better error message for variable bond of DATA implied do burnus at gcc dot gnu dot org
  2007-08-12 10:25 ` [Bug fortran/32331] " fxcoudert at gcc dot gnu dot org
  2010-05-01 18:30 ` dfranke at gcc dot gnu dot org
@ 2010-05-05 19:41 ` dfranke at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2010-05-05 19:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from dfranke at gcc dot gnu dot org  2010-05-05 19:40 -------
See:
    http://gcc.gnu.org/viewcvs?view=revision&revision=159080

Fixed in trunk. Closing.


-- 

dfranke at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-05-05 19:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-14  6:14 [Bug fortran/32331] New: Better error message for variable bond of DATA implied do burnus at gcc dot gnu dot org
2007-08-12 10:25 ` [Bug fortran/32331] " fxcoudert at gcc dot gnu dot org
2010-05-01 18:30 ` dfranke at gcc dot gnu dot org
2010-05-05 19:41 ` dfranke at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).