This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

[Bug fortran/88467] Silently accepts wrong array constructor


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88467

--- Comment #4 from kargl at gcc dot gnu.org ---
(In reply to kargl from comment #3)
> See pr88116 for a description of what appears to be happening.

So, in array.c (gfc_match_array_constructor), we have this 
bit of code


      /* Walk the constructor and ensure type conversion for numeric types.  */
      if (gfc_numeric_ts (&ts))
        {
          c = gfc_constructor_first (head);
          for (; c; c = gfc_constructor_next (c))
            gfc_convert_type (c->expr, &ts, 1);
        }

For a failing example of "[integer :: 1, [integer(8) :: '3', 4]]",
ts is integer.  The first constructor element is 1 and it has
an EXPR_CONSTANT type and integer type.  The next constructor has
EXPR_ARRAY and the type for the array is integer(8).  A conversion 
is applied to array.  What I haven't determined yet is why
gfc_match_array_constructor is called recursively or does reach 
the walk.

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