[Bug fortran/19926] Incorrect rank with PARAMETER and array element.

eedelman at acclab dot helsinki dot fi gcc-bugzilla@gcc.gnu.org
Fri Jun 10 23:35:00 GMT 2005


------- Additional Comments From eedelman at acclab dot helsinki dot fi  2005-06-10 23:35 -------
This patch seems to fixe the bug:

Index: gcc/fortran/primary.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/fortran/primary.c,v
retrieving revision 1.22.2.3
diff -u -p -r1.22.2.3 primary.c
--- gcc/fortran/primary.c       25 Apr 2005 00:09:14 -0000      1.22.2.3
+++ gcc/fortran/primary.c       10 Jun 2005 23:17:45 -0000
@@ -1804,7 +1804,10 @@ gfc_match_rvalue (gfc_expr ** result)
     case FL_PARAMETER:
       if (sym->value
          && sym->value->expr_type != EXPR_ARRAY)
-       e = gfc_copy_expr (sym->value);
+        {
+         e = gfc_copy_expr (sym->value);
+         e->rank = 0;
+        }
       else
        {
          e = gfc_get_expr ();

However, I suspect that this patch only hides the real problem instead of
solving it.  I'll have to investigate it some more before I send the patch for
review/committing.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |eedelman at acclab dot
                   |                            |helsinki dot fi


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



More information about the Gcc-bugs mailing list